diff options
-rw-r--r-- | tools/perf/arch/x86/tests/regs_load.S | 8 | ||||
-rw-r--r-- | tools/perf/config/Makefile | 4 |
2 files changed, 11 insertions, 1 deletions
diff --git a/tools/perf/arch/x86/tests/regs_load.S b/tools/perf/arch/x86/tests/regs_load.S index 99167bf644ea..60875d5c556c 100644 --- a/tools/perf/arch/x86/tests/regs_load.S +++ b/tools/perf/arch/x86/tests/regs_load.S | |||
@@ -1,4 +1,3 @@ | |||
1 | |||
2 | #include <linux/linkage.h> | 1 | #include <linux/linkage.h> |
3 | 2 | ||
4 | #define AX 0 | 3 | #define AX 0 |
@@ -90,3 +89,10 @@ ENTRY(perf_regs_load) | |||
90 | ret | 89 | ret |
91 | ENDPROC(perf_regs_load) | 90 | ENDPROC(perf_regs_load) |
92 | #endif | 91 | #endif |
92 | |||
93 | /* | ||
94 | * We need to provide note.GNU-stack section, saying that we want | ||
95 | * NOT executable stack. Otherwise the final linking will assume that | ||
96 | * the ELF stack should not be restricted at all and set it RWX. | ||
97 | */ | ||
98 | .section .note.GNU-stack,"",@progbits | ||
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 | |||
117 | CFLAGS += -Wextra | 117 | CFLAGS += -Wextra |
118 | CFLAGS += -std=gnu99 | 118 | CFLAGS += -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. | ||
122 | LDFLAGS += -Wl,-z,noexecstack | ||
123 | |||
120 | EXTLIBS = -lelf -lpthread -lrt -lm -ldl | 124 | EXTLIBS = -lelf -lpthread -lrt -lm -ldl |
121 | 125 | ||
122 | ifneq ($(OUTPUT),) | 126 | ifneq ($(OUTPUT),) |