diff --git a/libraries/config/templates/stratosphere.mk b/libraries/config/templates/stratosphere.mk index f8a86bb54..6f4395b1f 100644 --- a/libraries/config/templates/stratosphere.mk +++ b/libraries/config/templates/stratosphere.mk @@ -36,7 +36,7 @@ export CXXWRAPS := -Wl,--wrap,__cxa_pure_virtual \ -Wl,--wrap,_ZSt20__throw_length_errorPKc \ -Wl,--wrap,_ZNSt11logic_errorC2EPKc -export LDFLAGS = -specs=$(DEVKITPRO)/libnx/switch.specs $(SETTINGS) $(CXXWRAPS) -Wl,-Map,$(notdir $*.map) +export LDFLAGS = -specs=$(ATMOSPHERE_LIBRARIES_DIR)/libstratosphere/stratosphere.specs -specs=$(DEVKITPRO)/libnx/switch.specs $(SETTINGS) $(CXXWRAPS) -Wl,-Map,$(notdir $*.map) export LIBS = -lstratosphere -lnx diff --git a/libraries/libstratosphere/discard-ehframe.ld b/libraries/libstratosphere/discard-ehframe.ld new file mode 100644 index 000000000..b3b067e0e --- /dev/null +++ b/libraries/libstratosphere/discard-ehframe.ld @@ -0,0 +1,7 @@ +SECTIONS +{ + /* Discard .eh_frame section */ + /DISCARD/ : { *(.group .comment .note .interp) + EXCLUDE_FILE(*crtbegin.o) *(.eh_frame_hdr .eh_frame) + } +} diff --git a/libraries/libstratosphere/stratosphere.specs b/libraries/libstratosphere/stratosphere.specs new file mode 100644 index 000000000..d1ba47aef --- /dev/null +++ b/libraries/libstratosphere/stratosphere.specs @@ -0,0 +1,4 @@ +%rename link pre_old_link + +*link: +%(pre_old_link) -T %:getenv(ATMOSPHERE_LIBRARIES_DIR /libstratosphere/discard-ehframe.ld)