diff options
-rw-r--r-- | src/Makefile.housekeeping | 7 | ||||
-rw-r--r-- | src/arch/x86/Makefile.pcbios | 7 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/Makefile.housekeeping b/src/Makefile.housekeeping index b32003ea5..4a90b3ca4 100644 --- a/src/Makefile.housekeeping +++ b/src/Makefile.housekeeping @@ -502,6 +502,13 @@ LDFLAGS += --gc-sections # LDFLAGS += -static +# Use separate code segment if supported by linker +# +ZSC_TEST = $(LD) -z separate-code --version 2>&1 > /dev/null +ZSC_FLAGS := $(shell [ -z "`$(ZSC_TEST)`" ] && \ + $(ECHO) '-z separate-code -z max-page-size=4096') +LDFLAGS += $(ZSC_FLAGS) + # compiler.h is needed for our linking and debugging system # CFLAGS += -include include/compiler.h 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 |