Skip to contentSkip to conversation

MIPS: fix building and linking of standalone programs

PATCH New Daniel Schwierzeck 3 participants 12 messages Sep 23, 2018 – Nov 2, 2018 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover MIPS: fix building and linking of standalone programs

This series fixes the long-time broken support of standalone programs on MIPS. All MIPS standalone programs now use the main MIPS linker script and all available code size optimizations. Finally the deprecated Makefiles arch/mips/cpu/mips[32,64]/config.mk could be removed.

The series also improves the passing of additional linker flags to standalone programs by introducing a Makefile variable LDFLAGS_STANDALONE. Currently the variable CONFIG_STANDALONE_LOAD_ADDR is misused on some archs to pass the path to the linker script. The variable LDFLAGS_STANDALONE now provides a cleaner way to do that. Furthermore it is now possible to migrate CONFIG_STANDALONE_LOAD_ADDR to Kconfig as a hex symbol.

Sample test session with Malta board in Qemu:

U-Boot 2018.09-00270-g19936da8bc (Sep 23 2018 - 18:43:17 +0200)

Board: MIPS Malta CoreLV
DRAM:  256 MiB
Flash: 4 MiB

*** Warning - bad CRC, using default environment

In:    serial at 3f8
Out:   serial at 3f8
Err:   serial at 3f8
Net:   pcnet#0
IDE:   Bus 0: not available

malta #
malta #
malta # dhcp 80200000 hello_world.bin
BOOTP broadcast 1
DHCP client bound to address 10.0.2.15 (3 ms) Using pcnet#0 device
TFTP from server 10.0.2.2; our IP address is 10.0.2.15 Filename 'hello_world.bin'.
Load address: 0x80200000
Loading: ###

	 32.2 MiB/s

done
Bytes transferred = 33784 (83f8 hex)
malta # go 80200000
Example expects ABI version 9
Actual U-Boot ABI version 9
Hello World
argc = 1
argv[0] = "80200000"
argv[1] = "<NULL>"
Hit any key to exit ...

malta # go 80200000 666
Example expects ABI version 9
Actual U-Boot ABI version 9
Hello World
argc = 2
argv[0] = "80200000"
argv[1] = "666"
argv[2] = "<NULL>"
Hit any key to exit ...

Daniel Schwierzeck (3):
Kbuild: add LDFLAGS_STANDALONE
Kbuild: standalone: do not ignore platform-specific OBJCOPYFLAGS
MIPS: fix linking of standalone programs

 arch/mips/config.mk            |  5 ++++
 arch/mips/cpu/mips32/config.mk |  7 ------
 arch/mips/cpu/mips64/config.mk |  7 ------
 arch/nds32/config.mk           |  4 ++--
 arch/riscv/config.mk           |  4 ++--
 arch/sh/config.mk              |  2 +-
 config.mk                      |  2 ++
 examples/standalone/Makefile   |  8 ++++---
 examples/standalone/mips.lds   | 42 ----------------------------------
 examples/standalone/mips64.lds | 42 ----------------------------------
 10 files changed, 17 insertions(+), 106 deletions(-)
 delete mode 100644 arch/mips/cpu/mips32/config.mk
 delete mode 100644 arch/mips/cpu/mips64/config.mk
 delete mode 100644 examples/standalone/mips.lds
 delete mode 100644 examples/standalone/mips64.lds
Signature · 1 line
2.19.0
#1 lore raw

PATCH 1/3 Kbuild: add LDFLAGS_STANDALONE

Introduce a new Makefile variable for passing LDFLAGS to standalone programs. Currently the variable CONFIG_STANDALONE_LOAD_ADDR is misued on some archs to pass a specific linker script.

---

 arch/mips/cpu/mips32/config.mk | 4 ++--
 arch/mips/cpu/mips64/config.mk | 4 ++--
 arch/nds32/config.mk           | 4 ++--
 arch/riscv/config.mk           | 4 ++--
 arch/sh/config.mk              | 2 +-
 config.mk                      | 2 ++
 examples/standalone/Makefile   | 4 +++-
 7 files changed, 14 insertions(+), 10 deletions(-)
arch/mips/cpu/mips32/config.mk +2 -2
index a0247596f5..662e4f8fc8 100644
@@ -3,5 +3,5 @@
 # (C) Copyright 2003
 # Wolfgang Denk, DENX Software Engineering, <[email protected]>
 
-CONFIG_STANDALONE_LOAD_ADDR ?= 0x80200000 \
-			       -T $(srctree)/examples/standalone/mips.lds
+CONFIG_STANDALONE_LOAD_ADDR ?= 0x80200000
+LDFLAGS_STANDALONE	+= -T $(srctree)/examples/standalone/mips.lds
arch/mips/cpu/mips64/config.mk +2 -2
index cd96bbcce9..6a53976b5c 100644
@@ -3,5 +3,5 @@
 # (C) Copyright 2003
 # Wolfgang Denk, DENX Software Engineering, <[email protected]>
 
-CONFIG_STANDALONE_LOAD_ADDR ?= 0xffffffff80200000 \
-			       -T $(srctree)/examples/standalone/mips64.lds
+CONFIG_STANDALONE_LOAD_ADDR ?= 0xffffffff80200000
+LDFLAGS_STANDALONE	+= -T $(srctree)/examples/standalone/mips64.lds
arch/nds32/config.mk +2 -2
index cb3d8b35b5..0a93fd428d 100644
@@ -12,8 +12,8 @@ ifeq ($(CROSS_COMPILE),)
 CROSS_COMPILE := nds32le-linux-
 endif
 
-CONFIG_STANDALONE_LOAD_ADDR = 0x300000 \
-			      -T $(srctree)/examples/standalone/nds32.lds
+CONFIG_STANDALONE_LOAD_ADDR = 0x300000
+LDFLAGS_STANDALONE	+= -T $(srctree)/examples/standalone/nds32.lds
 
 PLATFORM_RELFLAGS	+= -fno-strict-aliasing -fno-common -mrelax
 PLATFORM_RELFLAGS	+= -gdwarf-2
arch/riscv/config.mk +2 -2
index 219e66683d..d0b7e8e88b 100644
@@ -27,8 +27,8 @@ PLATFORM_LDFLAGS	+= -m $(64bit-emul)
 EFI_LDS			:= elf_riscv64_efi.lds
 endif
 
-CONFIG_STANDALONE_LOAD_ADDR = 0x00000000 \
-			      -T $(srctree)/examples/standalone/riscv.lds
+CONFIG_STANDALONE_LOAD_ADDR = 0x00000000
+LDFLAGS_STANDALONE += -T $(srctree)/examples/standalone/riscv.lds
 
 PLATFORM_CPPFLAGS	+= -ffixed-gp -fpic
 PLATFORM_RELFLAGS += -fno-strict-aliasing -fno-common -gdwarf-2 -ffunction-sections
arch/sh/config.mk +1 -1
index 92abee17ad..6ef44638ab 100644
@@ -9,7 +9,7 @@ endif
 
 CONFIG_STANDALONE_LOAD_ADDR ?= 0x8C000000
 ifeq ($(CPU),sh2)
-CONFIG_STANDALONE_LOAD_ADDR += -EB
+LDFLAGS_STANDALONE += -EB
 endif
 
 PLATFORM_CPPFLAGS += -DCONFIG_SH -D__SH__
config.mk +2 -0
index b4e4618982..caf0dd9b81 100644
@@ -15,6 +15,7 @@ PLATFORM_CPPFLAGS :=
 PLATFORM_LDFLAGS :=
 LDFLAGS :=
 LDFLAGS_FINAL :=
+LDFLAGS_STANDALONE :=
 OBJCOPYFLAGS :=
 # clear VENDOR for tcsh
 VENDOR :=
@@ -75,4 +76,5 @@ LDFLAGS_FINAL += -Bstatic
 export PLATFORM_CPPFLAGS
 export RELFLAGS
 export LDFLAGS_FINAL
+export LDFLAGS_STANDALONE
 export CONFIG_STANDALONE_LOAD_ADDR
examples/standalone/Makefile +3 -1
index 09364d84a0..abe1bf1883 100644
@@ -45,6 +45,8 @@ endif
 # source file.
 ccflags-y += $(call cc-option,-fno-toplevel-reorder)
 
+LDFLAGS_STANDALONE	+= -Ttext $(CONFIG_STANDALONE_LOAD_ADDR)
+
 #########################################################################
 
 quiet_cmd_link_lib = LD      $@
@@ -54,7 +56,7 @@ $(LIB):	$(LIBOBJS) FORCE
 	$(call if_changed,link_lib)
 
 quiet_cmd_link_elf = LD      $@
-      cmd_link_elf = $(LD) $(LDFLAGS) -g -Ttext $(CONFIG_STANDALONE_LOAD_ADDR) \
+      cmd_link_elf = $(LD) $(LDFLAGS) $(LDFLAGS_STANDALONE) -g  \
 		     -o $@ -e $(SYM_PREFIX)$(@F) $< $(LIB) $(PLATFORM_LIBGCC)
 
 $(ELF): $(obj)/%: $(obj)/%.o $(LIB) FORCE
Signature · 1 line
2.19.0
#2 lore raw

PATCH 1/3 Kbuild: add LDFLAGS_STANDALONE

Am 23.09.18 um 19:15 schrieb Daniel Schwierzeck:

Quoted 3 lines

Introduce a new Makefile variable for passing LDFLAGS to standalone programs. Currently the variable CONFIG_STANDALONE_LOAD_ADDR is misued on some archs to pass a specific linker script.

are there any objections or can I apply this to u-boot-mips/next? Thanks.

Quoted 121 lines

---

 arch/mips/cpu/mips32/config.mk | 4 ++--
 arch/mips/cpu/mips64/config.mk | 4 ++--
 arch/nds32/config.mk           | 4 ++--
 arch/riscv/config.mk           | 4 ++--
 arch/sh/config.mk              | 2 +-
 config.mk                      | 2 ++
 examples/standalone/Makefile   | 4 +++-
 7 files changed, 14 insertions(+), 10 deletions(-)
arch/mips/cpu/mips32/config.mk +2 -2
index a0247596f5..662e4f8fc8 100644
@@ -3,5 +3,5 @@
 # (C) Copyright 2003
 # Wolfgang Denk, DENX Software Engineering, <[email protected]>
 
-CONFIG_STANDALONE_LOAD_ADDR ?= 0x80200000 \
-			       -T $(srctree)/examples/standalone/mips.lds
+CONFIG_STANDALONE_LOAD_ADDR ?= 0x80200000
+LDFLAGS_STANDALONE	+= -T $(srctree)/examples/standalone/mips.lds
arch/mips/cpu/mips64/config.mk +2 -2
index cd96bbcce9..6a53976b5c 100644
@@ -3,5 +3,5 @@
 # (C) Copyright 2003
 # Wolfgang Denk, DENX Software Engineering, <[email protected]>
 
-CONFIG_STANDALONE_LOAD_ADDR ?= 0xffffffff80200000 \
-			       -T $(srctree)/examples/standalone/mips64.lds
+CONFIG_STANDALONE_LOAD_ADDR ?= 0xffffffff80200000
+LDFLAGS_STANDALONE	+= -T $(srctree)/examples/standalone/mips64.lds
arch/nds32/config.mk +2 -2
index cb3d8b35b5..0a93fd428d 100644
@@ -12,8 +12,8 @@ ifeq ($(CROSS_COMPILE),)
 CROSS_COMPILE := nds32le-linux-
 endif
 
-CONFIG_STANDALONE_LOAD_ADDR = 0x300000 \
-			      -T $(srctree)/examples/standalone/nds32.lds
+CONFIG_STANDALONE_LOAD_ADDR = 0x300000
+LDFLAGS_STANDALONE	+= -T $(srctree)/examples/standalone/nds32.lds
 
 PLATFORM_RELFLAGS	+= -fno-strict-aliasing -fno-common -mrelax
 PLATFORM_RELFLAGS	+= -gdwarf-2
arch/riscv/config.mk +2 -2
index 219e66683d..d0b7e8e88b 100644
@@ -27,8 +27,8 @@ PLATFORM_LDFLAGS	+= -m $(64bit-emul)
 EFI_LDS			:= elf_riscv64_efi.lds
 endif
 
-CONFIG_STANDALONE_LOAD_ADDR = 0x00000000 \
-			      -T $(srctree)/examples/standalone/riscv.lds
+CONFIG_STANDALONE_LOAD_ADDR = 0x00000000
+LDFLAGS_STANDALONE += -T $(srctree)/examples/standalone/riscv.lds
 
 PLATFORM_CPPFLAGS	+= -ffixed-gp -fpic
 PLATFORM_RELFLAGS += -fno-strict-aliasing -fno-common -gdwarf-2 -ffunction-sections
arch/sh/config.mk +1 -1
index 92abee17ad..6ef44638ab 100644
@@ -9,7 +9,7 @@ endif
 
 CONFIG_STANDALONE_LOAD_ADDR ?= 0x8C000000
 ifeq ($(CPU),sh2)
-CONFIG_STANDALONE_LOAD_ADDR += -EB
+LDFLAGS_STANDALONE += -EB
 endif
 
 PLATFORM_CPPFLAGS += -DCONFIG_SH -D__SH__
config.mk +2 -0
index b4e4618982..caf0dd9b81 100644
@@ -15,6 +15,7 @@ PLATFORM_CPPFLAGS :=
 PLATFORM_LDFLAGS :=
 LDFLAGS :=
 LDFLAGS_FINAL :=
+LDFLAGS_STANDALONE :=
 OBJCOPYFLAGS :=
 # clear VENDOR for tcsh
 VENDOR :=
@@ -75,4 +76,5 @@ LDFLAGS_FINAL += -Bstatic
 export PLATFORM_CPPFLAGS
 export RELFLAGS
 export LDFLAGS_FINAL
+export LDFLAGS_STANDALONE
 export CONFIG_STANDALONE_LOAD_ADDR
examples/standalone/Makefile +3 -1
index 09364d84a0..abe1bf1883 100644
@@ -45,6 +45,8 @@ endif
 # source file.
 ccflags-y += $(call cc-option,-fno-toplevel-reorder)
 
+LDFLAGS_STANDALONE	+= -Ttext $(CONFIG_STANDALONE_LOAD_ADDR)
+
 #########################################################################
 
 quiet_cmd_link_lib = LD      $@
@@ -54,7 +56,7 @@ $(LIB):	$(LIBOBJS) FORCE
 	$(call if_changed,link_lib)
 
 quiet_cmd_link_elf = LD      $@
-      cmd_link_elf = $(LD) $(LDFLAGS) -g -Ttext $(CONFIG_STANDALONE_LOAD_ADDR) \
+      cmd_link_elf = $(LD) $(LDFLAGS) $(LDFLAGS_STANDALONE) -g  \
 		     -o $@ -e $(SYM_PREFIX)$(@F) $< $(LIB) $(PLATFORM_LIBGCC)
 
 $(ELF): $(obj)/%: $(obj)/%.o $(LIB) FORCE
Signature · 9 lines
- Daniel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181028/2593aef8/attachment.sig>
#3 lore raw

PATCH 1/3 Kbuild: add LDFLAGS_STANDALONE

Quoted 8 lines · Daniel Schwierzeck

Am 23.09.18 um 19:15 schrieb Daniel Schwierzeck:

Quoted 3 lines

Introduce a new Makefile variable for passing LDFLAGS to standalone programs. Currently the variable CONFIG_STANDALONE_LOAD_ADDR is misued on some archs to pass a specific linker script.

are there any objections or can I apply this to u-boot-mips/next? Thanks.

Go ahead:

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181029/97e673f1/attachment.sig>

A message that is not in the archive (sent off-list or not yet received): [email protected]

#5 lore raw

PATCH 1/3 Kbuild: add LDFLAGS_STANDALONE

Quoted 10 lines
Quoted 10 lines
Quoted 5 lines
Quoted 3 lines

Introduce a new Makefile variable for passing LDFLAGS to standalone programs. Currently the variable CONFIG_STANDALONE_LOAD_ADDR is misued on some archs to pass a specific linker script.

are there any objections or can I apply this to u-boot-mips/next? Thanks.

Go ahead:

Quoted 2 lines
Quoted 2 lines

--
Tom

#6 lore raw

PATCH 1/3 Kbuild: add LDFLAGS_STANDALONE

In reply to Daniel Schwierzeck

Am 23.09.18 um 19:15 schrieb Daniel Schwierzeck:

Quoted 7 lines

Introduce a new Makefile variable for passing LDFLAGS to standalone programs. Currently the variable CONFIG_STANDALONE_LOAD_ADDR is misued on some archs to pass a specific linker script.

---

Quoted 9 lines
 arch/mips/cpu/mips32/config.mk | 4 ++--
 arch/mips/cpu/mips64/config.mk | 4 ++--
 arch/nds32/config.mk           | 4 ++--
 arch/riscv/config.mk           | 4 ++--
 arch/sh/config.mk              | 2 +-
 config.mk                      | 2 ++
 examples/standalone/Makefile   | 4 +++-
 7 files changed, 14 insertions(+), 10 deletions(-)

applied to u-boot-mips/next

Signature · 9 lines
- Daniel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181102/feb424bc/attachment.sig>
#7 lore raw

PATCH 2/3 Kbuild: standalone: do not ignore platform-specific OBJCOPYFLAGS

In reply to Daniel Schwierzeck

Currently the OBJCOPYFLAGS are cleared when assigning "-O srec" or "-O binary" for standalone programs. All flags set by arch-specific Makefiles are lost. This is bad if an arch demands arch-specific flags for the objcopy step.

---

 examples/standalone/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
examples/standalone/Makefile +2 -2
index abe1bf1883..f01816f24f 100644
@@ -62,11 +62,11 @@ quiet_cmd_link_elf = LD      $@
 $(ELF): $(obj)/%: $(obj)/%.o $(LIB) FORCE
 	$(call if_changed,link_elf)
 
-$(obj)/%.srec: OBJCOPYFLAGS := -O srec
+$(obj)/%.srec: OBJCOPYFLAGS += -O srec
 $(obj)/%.srec: $(obj)/% FORCE
 	$(call if_changed,objcopy)
 
-$(obj)/%.bin: OBJCOPYFLAGS := -O binary
+$(obj)/%.bin: OBJCOPYFLAGS += -O binary
 $(obj)/%.bin: $(obj)/% FORCE
 	$(call if_changed,objcopy)
 
Signature · 1 line
2.19.0
#8 lore raw

PATCH 2/3 Kbuild: standalone: do not ignore platform-specific OBJCOPYFLAGS

Am 23.09.18 um 19:15 schrieb Daniel Schwierzeck:

Quoted 4 lines

Currently the OBJCOPYFLAGS are cleared when assigning "-O srec" or "-O binary" for standalone programs. All flags set by arch-specific Makefiles are lost. This is bad if an arch demands arch-specific flags for the objcopy step.

are there any objections or can I apply this to u-boot-mips/next? Thanks.

Quoted 26 lines

---

 examples/standalone/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
examples/standalone/Makefile +2 -2
index abe1bf1883..f01816f24f 100644
@@ -62,11 +62,11 @@ quiet_cmd_link_elf = LD      $@
 $(ELF): $(obj)/%: $(obj)/%.o $(LIB) FORCE
 	$(call if_changed,link_elf)
 
-$(obj)/%.srec: OBJCOPYFLAGS := -O srec
+$(obj)/%.srec: OBJCOPYFLAGS += -O srec
 $(obj)/%.srec: $(obj)/% FORCE
 	$(call if_changed,objcopy)
 
-$(obj)/%.bin: OBJCOPYFLAGS := -O binary
+$(obj)/%.bin: OBJCOPYFLAGS += -O binary
 $(obj)/%.bin: $(obj)/% FORCE
 	$(call if_changed,objcopy)
 
Signature · 9 lines
- Daniel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181028/23e6b6b6/attachment.sig>
#9 lore raw

PATCH 2/3 Kbuild: standalone: do not ignore platform-specific OBJCOPYFLAGS

Quoted 9 lines · Daniel Schwierzeck

Am 23.09.18 um 19:15 schrieb Daniel Schwierzeck:

Quoted 4 lines

Currently the OBJCOPYFLAGS are cleared when assigning "-O srec" or "-O binary" for standalone programs. All flags set by arch-specific Makefiles are lost. This is bad if an arch demands arch-specific flags for the objcopy step.

are there any objections or can I apply this to u-boot-mips/next? Thanks.

Go ahead:

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181029/0f23b56b/attachment.sig>
#10 lore raw

PATCH 2/3 Kbuild: standalone: do not ignore platform-specific OBJCOPYFLAGS

In reply to Daniel Schwierzeck

Am 23.09.18 um 19:15 schrieb Daniel Schwierzeck:

Quoted 11 lines

Currently the OBJCOPYFLAGS are cleared when assigning "-O srec" or "-O binary" for standalone programs. All flags set by arch-specific Makefiles are lost. This is bad if an arch demands arch-specific flags for the objcopy step.

---

 examples/standalone/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

applied to u-boot-mips/next

Signature · 9 lines
- Daniel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181102/06337b75/attachment.sig>
#11 lore raw

PATCH 3/3 MIPS: fix linking of standalone programs

In reply to Daniel Schwierzeck

Use the global MIPS specific u-boot.lds for linking standalone programs instead of the outdated ones in examples/standalone/. Also pass --gc-sections in LDFLAGS_STANDALONE to optimize the size of standalone programs. Finally remove the deprecated config.mk files in arch/mips/cpu/mips[32,64]/.

---

 arch/mips/config.mk            |  5 ++++
 arch/mips/cpu/mips32/config.mk |  7 ------
 arch/mips/cpu/mips64/config.mk |  7 ------
 examples/standalone/mips.lds   | 42 ----------------------------------
 examples/standalone/mips64.lds | 42 ----------------------------------
 5 files changed, 5 insertions(+), 98 deletions(-)
 delete mode 100644 arch/mips/cpu/mips32/config.mk
 delete mode 100644 arch/mips/cpu/mips64/config.mk
 delete mode 100644 examples/standalone/mips.lds
 delete mode 100644 examples/standalone/mips64.lds
arch/mips/config.mk +5 -0
index 8aa45fc45c..1ae8bf7b71 100644
@@ -25,12 +25,14 @@ ifdef CONFIG_32BIT
 PLATFORM_CPPFLAGS	+= -mabi=32
 PLATFORM_LDFLAGS	+= -m $(32bit-emul)
 OBJCOPYFLAGS		+= -O $(32bit-bfd)
+CONFIG_STANDALONE_LOAD_ADDR	?= 0x80200000
 endif
 
 ifdef CONFIG_64BIT
 PLATFORM_CPPFLAGS	+= -mabi=64
 PLATFORM_LDFLAGS	+= -m$(64bit-emul)
 OBJCOPYFLAGS		+= -O $(64bit-bfd)
+CONFIG_STANDALONE_LOAD_ADDR	?= 0xffffffff80200000
 endif
 
 PLATFORM_CPPFLAGS += -D__MIPS__
@@ -65,3 +67,6 @@ PLATFORM_LDFLAGS		+= -G 0 -static -n -nostdlib
 PLATFORM_RELFLAGS		+= -ffunction-sections -fdata-sections
 LDFLAGS_FINAL			+= --gc-sections
 OBJCOPYFLAGS			+= -j .text -j .rodata -j .data -j .u_boot_list
+
+LDFLAGS_STANDALONE		+= -T $(srctree)/arch/mips/cpu/u-boot.lds
+LDFLAGS_STANDALONE		+= --gc-sections
arch/mips/cpu/mips32/config.mk deleted +0 -7
deleted file mode 100644
index 662e4f8fc8..0000000000
@@ -1,7 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0+
-#
-# (C) Copyright 2003
-# Wolfgang Denk, DENX Software Engineering, <[email protected]>
-
-CONFIG_STANDALONE_LOAD_ADDR ?= 0x80200000
-LDFLAGS_STANDALONE	+= -T $(srctree)/examples/standalone/mips.lds
arch/mips/cpu/mips64/config.mk deleted +0 -7
deleted file mode 100644
index 6a53976b5c..0000000000
@@ -1,7 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0+
-#
-# (C) Copyright 2003
-# Wolfgang Denk, DENX Software Engineering, <[email protected]>
-
-CONFIG_STANDALONE_LOAD_ADDR ?= 0xffffffff80200000
-LDFLAGS_STANDALONE	+= -T $(srctree)/examples/standalone/mips64.lds
examples/standalone/mips.lds deleted +0 -42

42 lines not on this page · raw message

examples/standalone/mips64.lds deleted +0 -42

42 lines not on this page · raw message

Signature · 1 line
2.19.0
#12 lore raw

PATCH 3/3 MIPS: fix linking of standalone programs

Am 23.09.18 um 19:15 schrieb Daniel Schwierzeck:

Quoted 9 lines

Use the global MIPS specific u-boot.lds for linking standalone programs instead of the outdated ones in examples/standalone/. Also pass --gc-sections in LDFLAGS_STANDALONE to optimize the size of standalone programs. Finally remove the deprecated config.mk files in arch/mips/cpu/mips[32,64]/.

---

Quoted 11 lines
 arch/mips/config.mk            |  5 ++++
 arch/mips/cpu/mips32/config.mk |  7 ------
 arch/mips/cpu/mips64/config.mk |  7 ------
 examples/standalone/mips.lds   | 42 ----------------------------------
 examples/standalone/mips64.lds | 42 ----------------------------------
 5 files changed, 5 insertions(+), 98 deletions(-)
 delete mode 100644 arch/mips/cpu/mips32/config.mk
 delete mode 100644 arch/mips/cpu/mips64/config.mk
 delete mode 100644 examples/standalone/mips.lds
 delete mode 100644 examples/standalone/mips64.lds

applied to u-boot-mips/next

Signature · 9 lines
- Daniel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181102/81e70a45/attachment.sig>