diff options
author | Jiri Olsa <[email protected]> | 2012-02-01 13:54:08 +0100 |
---|---|---|
committer | Arnaldo Carvalho de Melo <[email protected]> | 2012-02-06 19:14:17 -0200 |
commit | e89cef136a8b56eef1acf702591fd3039fc3385d (patch) | |
tree | f3d5eeee5a8e4172834e7e3a6b41dfcea10cf358 | |
parent | 5ddf146f70a44ed4133dea4d377b172605a1cfa5 (diff) |
perf tool: Fix perf stack to non executable on x86_64
By adding following objects:
bench/mem-memset-x86-64-asm.o
bench/mem-memcpy-x86-64-asm.o
the x86_64 perf binary ended up with executable stack.
The reason was that above objects are assembler sourced and are missing the
GNU-stack note section. In such case the linker assumes that the final binary
should not be restricted at all and mark the stack as RWX.
Adding section ".note.GNU-stack" definition to mentioned objects, with all
flags disabled, thus omiting those objects from linker stack flags decision.
Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=783570
Reported-by: Clark Williams <[email protected]>
Acked-by: Eric Dumazet <[email protected]>
Cc: Corey Ashford <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Jiri Olsa <[email protected]>
[ committer note: Remaining bits after what was already added to perf/urgent ]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
-rw-r--r-- | tools/perf/bench/mem-memset-x86-64-asm.S | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/perf/bench/mem-memset-x86-64-asm.S b/tools/perf/bench/mem-memset-x86-64-asm.S index cb9217063776..9e5af89ed13a 100644 --- a/tools/perf/bench/mem-memset-x86-64-asm.S +++ b/tools/perf/bench/mem-memset-x86-64-asm.S @@ -4,3 +4,10 @@ #define Lmemset_c globl memset_c; memset_c #define Lmemset_c_e globl memset_c_e; memset_c_e #include "../../../arch/x86/lib/memset_64.S" + +/* + * We need to provide note.GNU-stack section, saying that we want + * NOT executable stack. Otherwise the final linking will assume that + * the ELF stack should not be restricted at all and set it RWX. + */ +.section .note.GNU-stack,"",@progbits |