diff --git a/arch/mips/config.mk b/arch/mips/config.mk index 318d34b1e6887198bea8d15ff9df09b28a2ded8a..6ab8acdb17b4cef1affce9760f6329b0c83b6cd5 100644 --- a/arch/mips/config.mk +++ b/arch/mips/config.mk @@ -50,3 +50,5 @@ PLATFORM_CPPFLAGS += -DCONFIG_MIPS -D__MIPS__ PLATFORM_CPPFLAGS += -G 0 -mabicalls -fpic PLATFORM_CPPFLAGS += -msoft-float PLATFORM_LDFLAGS += -G 0 -static -n -nostdlib +PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections +LDFLAGS_FINAL += --gc-sections diff --git a/board/dbau1x00/u-boot.lds b/board/dbau1x00/u-boot.lds index 3c4fbe3ee96115954c3957892569526b934e77dd..4a59cea80f86aa0b7d1de31e28b7bf1cefd2939d 100644 --- a/board/dbau1x00/u-boot.lds +++ b/board/dbau1x00/u-boot.lds @@ -34,14 +34,14 @@ SECTIONS . = ALIGN(4); .text : { - *(.text) + *(.text*) } . = ALIGN(4); .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) } . = ALIGN(4); - .data : { *(.data) } + .data : { *(.data*) } . = .; _gp = ALIGN(16) + 0x7ff0; @@ -52,7 +52,7 @@ SECTIONS __got_end = .; } - .sdata : { *(.sdata) } + .sdata : { *(.sdata*) } .u_boot_cmd : { __u_boot_cmd_start = .; @@ -64,7 +64,7 @@ SECTIONS num_got_entries = (__got_end - __got_start) >> 2; . = ALIGN(4); - .sbss (NOLOAD) : { *(.sbss) } - .bss (NOLOAD) : { *(.bss) . = ALIGN(4); } + .sbss (NOLOAD) : { *(.sbss*) } + .bss (NOLOAD) : { *(.bss*) . = ALIGN(4); } uboot_end = .; } diff --git a/board/gth2/u-boot.lds b/board/gth2/u-boot.lds index aeb0fcc004311046c20330d8d763b4182234420a..9fc417f3bca4994268541d729617779713f249e4 100644 --- a/board/gth2/u-boot.lds +++ b/board/gth2/u-boot.lds @@ -34,14 +34,14 @@ SECTIONS . = ALIGN(4); .text : { - *(.text) + *(.text*) } . = ALIGN(4); .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) } . = ALIGN(4); - .data : { *(.data) } + .data : { *(.data*) } . = .; _gp = ALIGN(16) + 0x7ff0; @@ -52,7 +52,7 @@ SECTIONS __got_end = .; } - .sdata : { *(.sdata) } + .sdata : { *(.sdata*) } .u_boot_cmd : { __u_boot_cmd_start = .; @@ -64,7 +64,7 @@ SECTIONS num_got_entries = (__got_end - __got_start) >> 2; . = ALIGN(4); - .sbss (NOLOAD) : { *(.sbss) } - .bss (NOLOAD) : { *(.bss) . = ALIGN(4); } + .sbss (NOLOAD) : { *(.sbss*) } + .bss (NOLOAD) : { *(.bss*) . = ALIGN(4); } uboot_end = .; } diff --git a/board/incaip/u-boot.lds b/board/incaip/u-boot.lds index 3c4fbe3ee96115954c3957892569526b934e77dd..4a59cea80f86aa0b7d1de31e28b7bf1cefd2939d 100644 --- a/board/incaip/u-boot.lds +++ b/board/incaip/u-boot.lds @@ -34,14 +34,14 @@ SECTIONS . = ALIGN(4); .text : { - *(.text) + *(.text*) } . = ALIGN(4); .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) } . = ALIGN(4); - .data : { *(.data) } + .data : { *(.data*) } . = .; _gp = ALIGN(16) + 0x7ff0; @@ -52,7 +52,7 @@ SECTIONS __got_end = .; } - .sdata : { *(.sdata) } + .sdata : { *(.sdata*) } .u_boot_cmd : { __u_boot_cmd_start = .; @@ -64,7 +64,7 @@ SECTIONS num_got_entries = (__got_end - __got_start) >> 2; . = ALIGN(4); - .sbss (NOLOAD) : { *(.sbss) } - .bss (NOLOAD) : { *(.bss) . = ALIGN(4); } + .sbss (NOLOAD) : { *(.sbss*) } + .bss (NOLOAD) : { *(.bss*) . = ALIGN(4); } uboot_end = .; } diff --git a/board/micronas/vct/u-boot.lds b/board/micronas/vct/u-boot.lds index b90b1864728d823aa52ea402b06d95465634fdf3..3a05ef90499cf0b4b1daf0fabe2b307b4eece051 100644 --- a/board/micronas/vct/u-boot.lds +++ b/board/micronas/vct/u-boot.lds @@ -31,14 +31,14 @@ SECTIONS . = ALIGN(4); .text : { - *(.text) + *(.text*) } . = ALIGN(4); .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) } . = ALIGN(4); - .data : { *(.data) } + .data : { *(.data*) } . = .; _gp = ALIGN(16) + 0x7ff0; @@ -50,7 +50,7 @@ SECTIONS } . = ALIGN(4); - .sdata : { *(.sdata) } + .sdata : { *(.sdata*) } . = ALIGN(4); .u_boot_cmd : { @@ -64,8 +64,8 @@ SECTIONS num_got_entries = (__got_end - __got_start) >> 2; . = ALIGN(4); - .sbss (NOLOAD) : { *(.sbss) } + .sbss (NOLOAD) : { *(.sbss*) } . = ALIGN(4); - .bss (NOLOAD) : { *(.bss) } + .bss (NOLOAD) : { *(.bss*) } uboot_end = .; } diff --git a/board/pb1x00/u-boot.lds b/board/pb1x00/u-boot.lds index 358cc54a8b985153f474a6b9b305b1f87b52ee80..bd0dee1efb9a8798d749332478fb6bb1ef49bcaa 100644 --- a/board/pb1x00/u-boot.lds +++ b/board/pb1x00/u-boot.lds @@ -34,14 +34,14 @@ SECTIONS . = ALIGN(4); .text : { - *(.text) + *(.text*) } . = ALIGN(4); .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) } . = ALIGN(4); - .data : { *(.data) } + .data : { *(.data*) } . = .; _gp = ALIGN(16) + 0x7ff0; @@ -52,7 +52,7 @@ SECTIONS __got_end = .; } - .sdata : { *(.sdata) } + .sdata : { *(.sdata*) } .u_boot_cmd : { __u_boot_cmd_start = .; @@ -64,7 +64,7 @@ SECTIONS num_got_entries = (__got_end - __got_start) >> 2; . = ALIGN(4); - .sbss (NOLOAD) : { *(.sbss) } - .bss (NOLOAD) : { *(.bss) . = ALIGN(4); } + .sbss (NOLOAD) : { *(.sbss*) } + .bss (NOLOAD) : { *(.bss*) . = ALIGN(4); } uboot_end = .; } diff --git a/board/qemu-mips/u-boot.lds b/board/qemu-mips/u-boot.lds index bd16786cbc6cbef33bbd2233185bb96d9605184d..9460b2010cc6f5643a336220bd42c9df3ac19f03 100644 --- a/board/qemu-mips/u-boot.lds +++ b/board/qemu-mips/u-boot.lds @@ -34,14 +34,14 @@ SECTIONS . = ALIGN(4); .text : { - *(.text) + *(.text*) } . = ALIGN(4); .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) } . = ALIGN(4); - .data : { *(.data) } + .data : { *(.data*) } . = .; _gp = ALIGN(16) +0x7ff0; @@ -53,7 +53,7 @@ SECTIONS } . = ALIGN(4); - .sdata : { *(.sdata) } + .sdata : { *(.sdata*) } . = .; .u_boot_cmd : { @@ -66,7 +66,7 @@ SECTIONS num_got_entries = (__got_end - __got_start) >> 2; . = ALIGN(4); - .sbss : { *(.sbss) } - .bss : { *(.bss) . = ALIGN(4); } + .sbss : { *(.sbss*) } + .bss : { *(.bss*) . = ALIGN(4); } uboot_end = .; } diff --git a/board/tb0229/u-boot.lds b/board/tb0229/u-boot.lds index 56d7c254487b4ea4a2d2e004d720d3acaf0030bd..5ea1094067214b62b9e0be84f3f5295b9a3fa2f4 100644 --- a/board/tb0229/u-boot.lds +++ b/board/tb0229/u-boot.lds @@ -34,14 +34,14 @@ SECTIONS . = ALIGN(4); .text : { - *(.text) + *(.text*) } . = ALIGN(4); .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) } . = ALIGN(4); - .data : { *(.data) } + .data : { *(.data*) } . = .; _gp = ALIGN(16) + 0x7ff0; @@ -52,7 +52,7 @@ SECTIONS __got_end = .; } - .sdata : { *(.sdata) } + .sdata : { *(.sdata*) } .u_boot_cmd : { __u_boot_cmd_start = .; @@ -64,7 +64,7 @@ SECTIONS num_got_entries = (__got_end - __got_start) >> 2; . = ALIGN(4); - .sbss (NOLOAD) : { *(.sbss) } - .bss (NOLOAD) : { *(.bss) . = ALIGN(4); } + .sbss (NOLOAD) : { *(.sbss*) } + .bss (NOLOAD) : { *(.bss*) . = ALIGN(4); } uboot_end = .; } diff --git a/examples/standalone/mips.lds b/examples/standalone/mips.lds index 63a1c92ab623be8b6daa28a2dd236518fc614f11..5f766ed37815c0d841de4ba216389d72f0a3f047 100644 --- a/examples/standalone/mips.lds +++ b/examples/standalone/mips.lds @@ -30,14 +30,14 @@ SECTIONS { .text : { - *(.text) + *(.text*) } . = ALIGN(4); .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) } . = ALIGN(4); - .data : { *(.data) } + .data : { *(.data*) } . = .; _gp = ALIGN(16) + 0x7ff0; @@ -48,12 +48,12 @@ SECTIONS __got_end = .; } - .sdata : { *(.sdata) } + .sdata : { *(.sdata*) } . = ALIGN(4); __bss_start = .; - .sbss (NOLOAD) : { *(.sbss) } - .bss (NOLOAD) : { *(.bss) . = ALIGN(4); } + .sbss (NOLOAD) : { *(.sbss*) } + .bss (NOLOAD) : { *(.bss*) . = ALIGN(4); } _end = .; }