Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
- Makefile | 5 +++++
- 1 file changed, 5 insertions(+)
+ Makefile | 3 +++
+ 1 file changed, 3 insertions(+)
--- a/Makefile
+++ b/Makefile
-@@ -873,6 +873,11 @@ ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATI
+@@ -873,6 +873,9 @@ ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATI
LDFLAGS_vmlinux += $(call ld-option, --gc-sections,)
endif
+LDFLAGS += -z noexecstack
-+ifeq ($(CONFIG_LD_IS_BFD),y)
+LDFLAGS += $(call ld-option,--no-warn-rwx-segments)
-+endif
+
ifeq ($(CONFIG_STRIP_ASM_SYMS),y)
LDFLAGS_vmlinux += $(call ld-option, -X,)
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/x86/boot/Makefile | 2 +-
- arch/x86/boot/compressed/Makefile | 6 ++++++
+ arch/x86/boot/compressed/Makefile | 4 ++++
arch/x86/entry/vdso/Makefile | 2 +-
- 3 files changed, 8 insertions(+), 2 deletions(-)
+ 3 files changed, 6 insertions(+), 2 deletions(-)
--- a/arch/x86/boot/Makefile
+++ b/arch/x86/boot/Makefile
--- a/arch/x86/boot/compressed/Makefile
+++ b/arch/x86/boot/compressed/Makefile
-@@ -55,6 +55,12 @@ else
+@@ -55,6 +55,10 @@ else
LDFLAGS += $(shell $(LD) --help 2>&1 | grep -q "\-z noreloc-overflow" \
&& echo "-z noreloc-overflow -pie --no-dynamic-linker")
endif
+
+LDFLAGS += -z noexecstack
-+ifeq ($(CONFIG_LD_IS_BFD),y)
+LDFLAGS += $(call ld-option,--no-warn-rwx-segments)
-+endif
+
LDFLAGS_vmlinux := -T
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
- Makefile | 5 +++++
- 1 file changed, 5 insertions(+)
+ Makefile | 3 +++
+ 1 file changed, 3 insertions(+)
--- a/Makefile
+++ b/Makefile
-@@ -876,6 +876,11 @@ LDFLAGS_BUILD_ID := $(call ld-option, --
+@@ -876,6 +876,9 @@ LDFLAGS_BUILD_ID := $(call ld-option, --
KBUILD_LDFLAGS_MODULE += $(LDFLAGS_BUILD_ID)
LDFLAGS_vmlinux += $(LDFLAGS_BUILD_ID)
+KBUILD_LDFLAGS += -z noexecstack
-+ifeq ($(CONFIG_LD_IS_BFD),y)
+KBUILD_LDFLAGS += $(call ld-option,--no-warn-rwx-segments)
-+endif
+
ifeq ($(CONFIG_STRIP_ASM_SYMS),y)
LDFLAGS_vmlinux += $(call ld-option, -X,)
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/x86/boot/Makefile | 2 +-
- arch/x86/boot/compressed/Makefile | 6 ++++++
+ arch/x86/boot/compressed/Makefile | 4 ++++
arch/x86/entry/vdso/Makefile | 2 +-
- 3 files changed, 8 insertions(+), 2 deletions(-)
+ 3 files changed, 6 insertions(+), 2 deletions(-)
--- a/arch/x86/boot/Makefile
+++ b/arch/x86/boot/Makefile
--- a/arch/x86/boot/compressed/Makefile
+++ b/arch/x86/boot/compressed/Makefile
-@@ -57,6 +57,12 @@ else
+@@ -57,6 +57,10 @@ else
KBUILD_LDFLAGS += $(shell $(LD) --help 2>&1 | grep -q "\-z noreloc-overflow" \
&& echo "-z noreloc-overflow -pie --no-dynamic-linker")
endif
+
+KBUILD_LDFLAGS += -z noexecstack
-+ifeq ($(CONFIG_LD_IS_BFD),y)
+KBUILD_LDFLAGS += $(call ld-option,--no-warn-rwx-segments)
-+endif
+
LDFLAGS_vmlinux := -T
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
- Makefile | 5 +++++
- 1 file changed, 5 insertions(+)
+ Makefile | 3 +++
+ 1 file changed, 3 insertions(+)
--- a/Makefile
+++ b/Makefile
-@@ -870,6 +870,11 @@ ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATI
+@@ -870,6 +870,9 @@ ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATI
LDFLAGS_vmlinux += $(call ld-option, --gc-sections,)
endif
+LDFLAGS += -z noexecstack
-+ifeq ($(CONFIG_LD_IS_BFD),y)
+LDFLAGS += $(call ld-option,--no-warn-rwx-segments)
-+endif
+
ifeq ($(CONFIG_STRIP_ASM_SYMS),y)
LDFLAGS_vmlinux += $(call ld-option, -X,)
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/x86/boot/Makefile | 2 +-
- arch/x86/boot/compressed/Makefile | 6 ++++++
+ arch/x86/boot/compressed/Makefile | 4 ++++
arch/x86/entry/vdso/Makefile | 2 +-
- 3 files changed, 8 insertions(+), 2 deletions(-)
+ 3 files changed, 6 insertions(+), 2 deletions(-)
--- a/arch/x86/boot/Makefile
+++ b/arch/x86/boot/Makefile
--- a/arch/x86/boot/compressed/Makefile
+++ b/arch/x86/boot/compressed/Makefile
-@@ -54,6 +54,12 @@ else
+@@ -54,6 +54,10 @@ else
LDFLAGS += $(shell $(LD) --help 2>&1 | grep -q "\-z noreloc-overflow" \
&& echo "-z noreloc-overflow -pie --no-dynamic-linker")
endif
+
+LDFLAGS += -z noexecstack
-+ifeq ($(CONFIG_LD_IS_BFD),y)
+LDFLAGS += $(call ld-option,--no-warn-rwx-segments)
-+endif
+
LDFLAGS_vmlinux := -T
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
- Makefile | 5 +++++
- 1 file changed, 5 insertions(+)
+ Makefile | 3 +++
+ 1 file changed, 3 insertions(+)
--- a/Makefile
+++ b/Makefile
-@@ -983,6 +983,11 @@ KBUILD_CFLAGS += $(KCFLAGS)
+@@ -983,6 +983,9 @@ KBUILD_CFLAGS += $(KCFLAGS)
KBUILD_LDFLAGS_MODULE += --build-id=sha1
LDFLAGS_vmlinux += --build-id=sha1
+KBUILD_LDFLAGS += -z noexecstack
-+ifeq ($(CONFIG_LD_IS_BFD),y)
+KBUILD_LDFLAGS += $(call ld-option,--no-warn-rwx-segments)
-+endif
+
ifeq ($(CONFIG_STRIP_ASM_SYMS),y)
LDFLAGS_vmlinux += $(call ld-option, -X,)
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/x86/boot/Makefile | 2 +-
- arch/x86/boot/compressed/Makefile | 4 ++++
+ arch/x86/boot/compressed/Makefile | 2 ++
arch/x86/entry/vdso/Makefile | 2 +-
- 3 files changed, 6 insertions(+), 2 deletions(-)
+ 3 files changed, 4 insertions(+), 2 deletions(-)
--- a/arch/x86/boot/Makefile
+++ b/arch/x86/boot/Makefile
--- a/arch/x86/boot/compressed/Makefile
+++ b/arch/x86/boot/compressed/Makefile
-@@ -68,6 +68,10 @@ LDFLAGS_vmlinux := -pie $(call ld-option
+@@ -68,6 +68,8 @@ LDFLAGS_vmlinux := -pie $(call ld-option
ifdef CONFIG_LD_ORPHAN_WARN
LDFLAGS_vmlinux += --orphan-handling=warn
endif
+LDFLAGS_vmlinux += -z noexecstack
-+ifeq ($(CONFIG_LD_IS_BFD),y)
+LDFLAGS_vmlinux += $(call ld-option,--no-warn-rwx-segments)
-+endif
LDFLAGS_vmlinux += -T
hostprogs := mkpiggy
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
- Makefile | 5 +++++
- 1 file changed, 5 insertions(+)
+ Makefile | 3 +++
+ 1 file changed, 3 insertions(+)
--- a/Makefile
+++ b/Makefile
-@@ -932,6 +932,11 @@ KBUILD_CFLAGS += $(KCFLAGS)
+@@ -932,6 +932,9 @@ KBUILD_CFLAGS += $(KCFLAGS)
KBUILD_LDFLAGS_MODULE += --build-id
LDFLAGS_vmlinux += --build-id
+KBUILD_LDFLAGS += -z noexecstack
-+ifeq ($(CONFIG_LD_IS_BFD),y)
+KBUILD_LDFLAGS += $(call ld-option,--no-warn-rwx-segments)
-+endif
+
ifeq ($(CONFIG_STRIP_ASM_SYMS),y)
LDFLAGS_vmlinux += $(call ld-option, -X,)
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/x86/boot/Makefile | 2 +-
- arch/x86/boot/compressed/Makefile | 6 ++++++
+ arch/x86/boot/compressed/Makefile | 4 ++++
arch/x86/entry/vdso/Makefile | 2 +-
- 3 files changed, 8 insertions(+), 2 deletions(-)
+ 3 files changed, 6 insertions(+), 2 deletions(-)
--- a/arch/x86/boot/Makefile
+++ b/arch/x86/boot/Makefile
--- a/arch/x86/boot/compressed/Makefile
+++ b/arch/x86/boot/compressed/Makefile
-@@ -57,6 +57,12 @@ else
+@@ -57,6 +57,10 @@ else
KBUILD_LDFLAGS += $(shell $(LD) --help 2>&1 | grep -q "\-z noreloc-overflow" \
&& echo "-z noreloc-overflow -pie --no-dynamic-linker")
endif
+
+KBUILD_LDFLAGS += -z noexecstack
-+ifeq ($(CONFIG_LD_IS_BFD),y)
+KBUILD_LDFLAGS += $(call ld-option,--no-warn-rwx-segments)
-+endif
+
LDFLAGS_vmlinux := -T