diff options
author | Wolfgang Denk <wd@denx.de> | 2009-08-17 14:00:53 +0200 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2009-08-21 23:13:34 +0200 |
commit | 1aada9cd643567d351667138851e9231ccfa245a (patch) | |
tree | d307bc75577677a3fdf1d3e3ccd075287977a24f /nand_spl/board/sheldon | |
parent | f772acf8a584067033eff1e231fcd1fb3a00d3d9 (diff) | |
download | u-boot-imx-1aada9cd643567d351667138851e9231ccfa245a.zip u-boot-imx-1aada9cd643567d351667138851e9231ccfa245a.tar.gz u-boot-imx-1aada9cd643567d351667138851e9231ccfa245a.tar.bz2 |
Fix all linker scripts for older binutils versions (pre-2.16)
Commit f62fb99941c6 fixed handling of all rodata sections by using a
wildcard combined with calls to ld's builtin functions SORT_BY_ALIGNMENT()
and SORT_BY_NAME(). Unfortunately these functions were only
introduced with biunutils version 2.16, so the modification broke
building with all tool chains using older binutils.
This patch makes it work again. This is done by omitting the use of
these functions for such old tool chains. This will result in
slightly larger target binaries, as the rodata sections are no longer
in optimal order alignment-wise which reauls in unused gaps, but the
effect was found to be insignificant - especially compared to the fact
that you cannot build U-Boot at all in the current state.
As ld seems to have no support for conditionals we run the linker
script through the C preprocessor which can be easily used to remove
the unwanted function calls.
Note that the C preprocessor must be run with the "-ansi" (or a
"-std=") option to make sure all the system-specific predefined
macros outside the reserved namespace are suppressed. Otherise, cpp
might for example substitute "powerpc" to "1", thus corrupting for
example "OUTPUT_ARCH(powerpc)" etc.
Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'nand_spl/board/sheldon')
-rw-r--r-- | nand_spl/board/sheldon/simpc8313/Makefile | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/nand_spl/board/sheldon/simpc8313/Makefile b/nand_spl/board/sheldon/simpc8313/Makefile index 20199c7..6920fe8 100644 --- a/nand_spl/board/sheldon/simpc8313/Makefile +++ b/nand_spl/board/sheldon/simpc8313/Makefile @@ -29,7 +29,7 @@ TEXT_BASE := 0xfff00000 include $(TOPDIR)/config.mk LDSCRIPT= $(TOPDIR)/nand_spl/board/$(BOARDDIR)/u-boot.lds -LDFLAGS = -Bstatic -T $(LDSCRIPT) -Ttext $(TEXT_BASE) $(PLATFORM_LDFLAGS) +LDFLAGS = -Bstatic -T $(nandobj)u-boot.lds -Ttext $(TEXT_BASE) $(PLATFORM_LDFLAGS) AFLAGS += -DCONFIG_NAND_SPL CFLAGS += -DCONFIG_NAND_SPL @@ -54,11 +54,14 @@ $(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl $(nandobj)u-boot-spl.bin: $(nandobj)u-boot-spl $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@ -$(nandobj)u-boot-spl: $(OBJS) +$(nandobj)u-boot-spl: $(OBJS) $(nandobj)u-boot.lds cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) \ -Map $(nandobj)u-boot-spl.map \ -o $(nandobj)u-boot-spl +$(nandobj)u-boot.lds: $(LDSCRIPT) + $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@ + # create symbolic links for common files $(obj)start.S: |