Skip to content
This repository has been archived by the owner on Oct 2, 2024. It is now read-only.

Commit

Permalink
Makefile: Silence new GNU linker warnings
Browse files Browse the repository at this point in the history
The next version of the linker will complain about rwx segments with
permissions and executable stacks:

 https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=ba951afb99912da01a6e8434126b8fac7aa75107
 https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=0d38576a34ec64a1b4500c9277a8e9d0f07e6774

These warnings are relevant for ELF binaries loaded by an operating
system linker, but do not make sense in the context of u-boot where the
objects are loaded by other means.

Disable the warnings using the following options:

 --no-warn-rwx-segments

  warning: u-boot has a LOAD segment with RWX permissions
  warning: u-boot-spl has a LOAD segment with RWX permissions

 --no-warn-execstack

  warning: arch/arm/lib/setjmp.o: missing .note.GNU-stack section implies executable stack
  NOTE: This behaviour is deprecated and will be removed in a future version of the linker

Signed-off-by: Joel Stanley <[email protected]>
  • Loading branch information
@ authored and reocat committed Jan 24, 2024
1 parent 571c266 commit 9d2db6d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,8 @@ endif
KBUILD_AFLAGS_KERNEL :=
KBUILD_CFLAGS_KERNEL :=
KBUILD_AFLAGS := -D__ASSEMBLY__ $(call cc-option,-fno-PIE)
KBUILD_LDFLAGS := $(call ld-option, --no-warn-rwx-segments) \
$(call ld-option, --no-warn-execstack)
KBUILD_AFLAGS_MODULE := -DMODULE
KBUILD_CFLAGS_MODULE := -DMODULE
KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds
Expand All @@ -417,6 +419,7 @@ export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS
export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE CFLAGS_GCOV
export CFLAGS_KASAN CFLAGS_UBSAN CFLAGS_KASAN_NOSANITIZE
export CFLAGS_KCOV
export KBUILD_LDFLAGS
export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE
export KBUILD_AFLAGS_MODULE KBUILD_CFLAGS_MODULE KBUILD_LDFLAGS_MODULE
export KBUILD_AFLAGS_KERNEL KBUILD_CFLAGS_KERNEL
Expand Down

0 comments on commit 9d2db6d

Please sign in to comment.