aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/config/Makefile
diff options
context:
space:
mode:
authorMathias Krause <minipli@googlemail.com>2014-04-27 12:51:05 -0400
committerJiri Olsa <jolsa@kernel.org>2014-04-30 11:02:30 -0400
commit6392b4ebdc1acfbed605d68c437ff5597d0a8d95 (patch)
tree5a14df4426377d88702769dbb1859fbce076b4ab /tools/perf/config/Makefile
parent603940b6b8b1347ec13a628165c00194ebc17ed2 (diff)
perf x86: Fix perf to use non-executable stack, again
arch/x86/tests/regs_load.S is missing the linker note about the stack requirements, therefore making the linker fall back to an executable stack. As this object gets linked against the final perf binary, it'll needlessly end up with an executable stack. Fix this by adding the appropriate linker note. Also add a global linker flag to prevent future regressions, as suggested by Jiri. This way perf won't get an executable stack even if we fail to add the .GNU-stack linker note to future assembler files. Though, doing so might create regressions the other way around, when (statically) linking against libraries needing an executable stack. But, apparently, regressing in that direction is wanted as it is an indicator of poor code quality -- or just missing linker notes. Fixes: 3c8b06f981 ("perf tests x86: Introduce perf_regs_load function") Signed-off-by: Mathias Krause <minipli@googlemail.com> Acked-by: Ingo Molnar <mingo@kernel.org> Cc: Arnaldo Carvalho de Melo <acme@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1398617466-22749-1-git-send-email-minipli@googlemail.com Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Diffstat (limited to 'tools/perf/config/Makefile')
-rw-r--r--tools/perf/config/Makefile4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index a57d59e7fe4b..802cf544202b 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -117,6 +117,10 @@ CFLAGS += -Wall
117CFLAGS += -Wextra 117CFLAGS += -Wextra
118CFLAGS += -std=gnu99 118CFLAGS += -std=gnu99
119 119
120# Enforce a non-executable stack, as we may regress (again) in the future by
121# adding assembler files missing the .GNU-stack linker note.
122LDFLAGS += -Wl,-z,noexecstack
123
120EXTLIBS = -lelf -lpthread -lrt -lm -ldl 124EXTLIBS = -lelf -lpthread -lrt -lm -ldl
121 125
122ifneq ($(OUTPUT),) 126ifneq ($(OUTPUT),)