Skip to content

Commit

Permalink
MIPS: fix linking of standalone programs
Browse files Browse the repository at this point in the history
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]/.

Signed-off-by: Daniel Schwierzeck <[email protected]>
  • Loading branch information
danielschwierzeck committed Nov 18, 2018
1 parent d3a9ba7 commit 1bef0c5
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 98 deletions.
4 changes: 4 additions & 0 deletions arch/mips/config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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__
Expand Down Expand Up @@ -65,3 +67,5 @@ 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 += --gc-sections
7 changes: 0 additions & 7 deletions arch/mips/cpu/mips32/config.mk

This file was deleted.

7 changes: 0 additions & 7 deletions arch/mips/cpu/mips64/config.mk

This file was deleted.

42 changes: 0 additions & 42 deletions examples/standalone/mips.lds

This file was deleted.

42 changes: 0 additions & 42 deletions examples/standalone/mips64.lds

This file was deleted.

0 comments on commit 1bef0c5

Please sign in to comment.