mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
Change the order of global linker options and -T.
95e23de
made -Wl,--gc-sections appear after -T by combining it with the global
linker options. Moving the global linker options in front of -T seems to fix
the crash observed on mini2g after that change -- as it seems the linker
behaves differently if --gc-sections is passed after -T.
Fixes FS#12857.
Change-Id: Id64dc6b91726760d75a1a0cd85bb7c06208d2f45
This commit is contained in:
parent
8a1cd81b3a
commit
736c3780f1
1 changed files with 6 additions and 4 deletions
|
@ -214,21 +214,23 @@ $(LINKROM): $(ROMLDS)
|
|||
$(call PRINTS,PP $(@F))
|
||||
$(call preprocess2file,$<,$@,-DLOADADDRESS=$(LOADADDRESS))
|
||||
|
||||
# Note: make sure -Wl,--gc-sections comes before -T in the linker options.
|
||||
# Having the latter first caused crashes on (at least) mini2g.
|
||||
$(BUILDDIR)/rockbox.elf : $$(OBJ) $(FIRMLIB) $(VOICESPEEXLIB) $(CORE_LIBS) $$(LINKRAM)
|
||||
$(call PRINTS,LD $(@F))$(CC) $(GCCOPTS) -Os -nostdlib -o $@ $(OBJ) \
|
||||
-L$(BUILDDIR)/firmware -lfirmware \
|
||||
-L$(RBCODEC_BLD)/codecs $(call a2lnk, $(VOICESPEEXLIB)) \
|
||||
-L$(BUILDDIR)/lib $(call a2lnk, $(CORE_LIBS)) \
|
||||
-lgcc -T$(LINKRAM) \
|
||||
$(CORE_LDOPTS) -Wl,-Map,$(BUILDDIR)/rockbox.map
|
||||
-lgcc $(CORE_LDOPTS) -T$(LINKRAM) \
|
||||
-Wl,-Map,$(BUILDDIR)/rockbox.map
|
||||
|
||||
$(BUILDDIR)/rombox.elf : $$(OBJ) $(FIRMLIB) $(VOICESPEEXLIB) $(CORE_LIBS) $$(LINKROM)
|
||||
$(call PRINTS,LD $(@F))$(CC) $(GCCOPTS) -Os -nostdlib -o $@ $(OBJ) \
|
||||
-L$(BUILDDIR)/firmware -lfirmware \
|
||||
-L$(RBCODEC_BLD)/codecs $(call a2lnk, $(VOICESPEEXLIB)) \
|
||||
-L$(BUILDDIR)/lib $(call a2lnk, $(CORE_LIBS)) \
|
||||
-lgcc -T$(LINKROM) \
|
||||
$(CORE_LDOPTS) -Wl,-Map,$(BUILDDIR)/rombox.map
|
||||
-lgcc $(CORE_LDOPTS) -T$(LINKROM) \
|
||||
-Wl,-Map,$(BUILDDIR)/rombox.map
|
||||
|
||||
$(BUILDDIR)/rockbox.bin : $(BUILDDIR)/rockbox.elf
|
||||
$(call PRINTS,OC $(@F))$(call objcopy,$<,$@)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue