diff options
author | Michael Brown <mcb30@ipxe.org> | 2023-06-30 12:03:41 +0100 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2023-07-03 13:31:31 +0100 |
commit | 6f57d919357a43507935a5ea78a66702ac0f3d54 (patch) | |
tree | a4a8cae96746ed0a8f78802004706f96ed3bb045 /src/arch | |
parent | e17568ad0642490143d0c6b154c874b9b9e285bf (diff) | |
download | ipxe-6f57d919357a43507935a5ea78a66702ac0f3d54.tar.gz |
[build] Use separate code segment if supported by linkersepcode
Some versions of ld will complain that the automatically created (and
unused by our build process) ELF program headers include a "LOAD
segment with RWX permissions".
Silence this warning by adding "-z separate-code" to the linker
options, where supported.
For BIOS builds, where the prefix will generally require writable
access to its own (tiny) code segment, simply inhibit the warning
completely via "--no-warn-rwx-segments".
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/arch')
-rw-r--r-- | src/arch/x86/Makefile.pcbios | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/arch/x86/Makefile.pcbios b/src/arch/x86/Makefile.pcbios index b9f8e6c28..38dfa087c 100644 --- a/src/arch/x86/Makefile.pcbios +++ b/src/arch/x86/Makefile.pcbios @@ -13,6 +13,13 @@ LDSCRIPT_PREFIX = arch/x86/scripts/prefixonly.lds # LDFLAGS += -N --no-check-sections +# Do not warn about RWX segments (required by most prefixes) +# +WRWX_TEST = $(LD) --warn-rwx-segments --version 2>&1 > /dev/null +WRWX_FLAGS := $(shell [ -z "`$(WRWX_TEST)`" ] && \ + $(ECHO) '--no-warn-rwx-segments') +LDFLAGS += $(WRWX_FLAGS) + # Media types. # MEDIA += rom |