summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tools/perf/util/symbol-elf.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
index 7ef5f6d7d415..ae810d4cf3cd 100644
--- a/tools/perf/util/symbol-elf.c
+++ b/tools/perf/util/symbol-elf.c
@@ -542,9 +542,12 @@ static u32 get_x86_64_plt_disp(const u8 *p)
n += 1;
/* jmp with 4-byte displacement */
if (p[n] == 0xff && p[n + 1] == 0x25) {
+ u32 disp;
+
n += 2;
/* Also add offset from start of entry to end of instruction */
- return n + 4 + le32toh(*(const u32 *)(p + n));
+ memcpy(&disp, p + n, sizeof(disp));
+ return n + 4 + le32toh(disp);
}
return 0;
}