Skip to content

Commit

Permalink
perf symbols: Set PLT entry/header sizes properly on Sparc
Browse files Browse the repository at this point in the history
[ Upstream commit d6afa561e1471ccfdaf7191230c0c59a37e45a5b ]

Using the sh_entsize for both values isn't correct.  It happens to be
correct on x86...

For both 32-bit and 64-bit sparc, there are four PLT entries in the PLT
section.

Signed-off-by: David S. Miller <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Alexis Berlemont <[email protected]>
Cc: David Tolnay <[email protected]>
Cc: Hanjun Guo <[email protected]>
Cc: Hemant Kumar <[email protected]>
Cc: Li Bin <[email protected]>
Cc: Masami Hiramatsu <[email protected]>
Cc: Milian Wolff <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Wang Nan <[email protected]>
Cc: [email protected]
Fixes: b2f7605 ("perf symbols: Fix plt entry calculation for ARM and AARCH64")
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
  • Loading branch information
davem330 authored and gregkh committed Nov 27, 2018
1 parent 070bbd5 commit b7d1a78
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion tools/perf/util/symbol-elf.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,17 @@ int dso__synthesize_plt_symbols(struct dso *dso, struct symsrc *ss)
plt_entry_size = 16;
break;

default: /* FIXME: s390/alpha/mips/parisc/poperpc/sh/sparc/xtensa need to be checked */
case EM_SPARC:
plt_header_size = 48;
plt_entry_size = 12;
break;

case EM_SPARCV9:
plt_header_size = 128;
plt_entry_size = 32;
break;

default: /* FIXME: s390/alpha/mips/parisc/poperpc/sh/xtensa need to be checked */
plt_header_size = shdr_plt.sh_entsize;
plt_entry_size = shdr_plt.sh_entsize;
break;
Expand Down

0 comments on commit b7d1a78

Please sign in to comment.