MIPS: remove OUTPUT_FORMAT from linker scripts
authorGabor Juhos <juhosg@openwrt.org>
Wed, 30 Jan 2013 02:22:51 +0000 (02:22 +0000)
committerDaniel Schwierzeck <daniel.schwierzeck@gmail.com>
Wed, 30 Jan 2013 22:34:10 +0000 (23:34 +0100)
The OUTPUT_FORMAT command in linker scripts
was always misused due to some endianess and
toolchain problems.

Use GCC flags to ensure proper output format,
and get rid of the OUTPUT_FORMAT commands in
the board specific u-boot.lds files.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Cc: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
Cc: Stefan Roese <sr@denx.de>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Xiangfu Liu <xiangfu@openmobilefree.net>
arch/mips/cpu/mips32/config.mk
arch/mips/cpu/xburst/config.mk
board/dbau1x00/u-boot.lds
board/incaip/u-boot.lds
board/micronas/vct/u-boot.lds
board/pb1x00/u-boot.lds
board/qemu-mips/u-boot.lds
board/qi/qi_lb60/u-boot.lds

index 481e9844db232474da43344bac63b6f226924a97..7399701fe9656d9ef5e7e49d99f1d7974030ee11 100644 (file)
 MIPSFLAGS := -march=mips32r2
 
 PLATFORM_CPPFLAGS += $(MIPSFLAGS)
+PLATFORM_CPPFLAGS += -mabi=32 -DCONFIG_32BIT
+ifdef CONFIG_SYS_BIG_ENDIAN
+PLATFORM_LDFLAGS  += -m elf32btsmip
+else
+PLATFORM_LDFLAGS  += -m elf32ltsmip
+endif
 
 CONFIG_STANDALONE_LOAD_ADDR ?= 0x80200000 -T mips.lds
index 1536746c974b4cf4ae7294e18096b9101a2e5761..cf5fa6ab6bd5b29e2a0d629563d21a77ae12752a 100644 (file)
 #
 
 PLATFORM_CPPFLAGS += -march=mips32
+PLATFORM_CPPFLAGS += -mabi=32 -DCONFIG_32BIT
+ifdef CONFIG_SYS_BIG_ENDIAN
+PLATFORM_LDFLAGS  += -m elf32btsmip
+else
+PLATFORM_LDFLAGS  += -m elf32ltsmip
+endif
 
 CONFIG_STANDALONE_LOAD_ADDR ?= 0x80200000 -T mips.lds
index 8a871cff49c7496a0f9fff3d8e4741c221d921c9..d9c01af126dd5f4da7eced34a5c11727e0f6bbe5 100644 (file)
  * MA 02111-1307 USA
  */
 
-/*
-OUTPUT_FORMAT("elf32-bigmips", "elf32-bigmips", "elf32-bigmips")
-*/
-OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradlittlemips")
 OUTPUT_ARCH(mips)
 ENTRY(_start)
 SECTIONS
index 8a871cff49c7496a0f9fff3d8e4741c221d921c9..d9c01af126dd5f4da7eced34a5c11727e0f6bbe5 100644 (file)
  * MA 02111-1307 USA
  */
 
-/*
-OUTPUT_FORMAT("elf32-bigmips", "elf32-bigmips", "elf32-bigmips")
-*/
-OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradlittlemips")
 OUTPUT_ARCH(mips)
 ENTRY(_start)
 SECTIONS
index 2ce8d0e158f4cb29b5d05ebc4e762000b26f92f4..cc7db1b33fc4c0afea434c212f3e1b71155619d2 100644 (file)
@@ -21,7 +21,6 @@
  * MA 02111-1307 USA
  */
 
-OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradlittlemips")
 OUTPUT_ARCH(mips)
 ENTRY(_start)
 SECTIONS
index 07ddd364a09dbab67309d1be0aee1112aff3ea86..d9c01af126dd5f4da7eced34a5c11727e0f6bbe5 100644 (file)
  * MA 02111-1307 USA
  */
 
-/*
-OUTPUT_FORMAT("elf32-bigmips", "elf32-bigmips", "elf32-bigmips")
-*/
-OUTPUT_FORMAT("elf32-tradlittlemips", "elf32-tradbigmips", "elf32-tradlittlemips")
 OUTPUT_ARCH(mips)
 ENTRY(_start)
 SECTIONS
index cb2356f731cf9102125e55922e975bce857277d7..33b42f312885edeb404ae1444764289303bfc0ff 100644 (file)
  * MA 02111-1307 USA
  */
 
-/*
-OUTPUT_FORMAT("elf32-bigmips", "elf32-bigmips", "elf32-bigmips")
-*/
-#if defined(CONFIG_64BIT)
-OUTPUT_FORMAT("elf64-tradbigmips", "elf64-tradbigmips", "elf64-tradlittlemips")
-#else
-OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradlittlemips")
-#endif
 OUTPUT_ARCH(mips)
 ENTRY(_start)
 SECTIONS
index b3cb86974837581cd541b8a8b5a282a2ee530cf3..d074a279c6c5749083bd4008ee85c076b22194a3 100644 (file)
@@ -18,8 +18,6 @@
  * MA 02111-1307 USA
  */
 
-OUTPUT_FORMAT("elf32-tradlittlemips", "elf32-tradlittlemips", "elf32-tradlittlemips")
-
 OUTPUT_ARCH(mips)
 ENTRY(_start)
 SECTIONS