Commit 660da0947abff3bc98bb0baa37a6db5050ff46d6
Committed by
Shinya Kuribayashi
1 parent
7aa1f198c8
Exists in
master
and in
57 other branches
MIPS: Introduce --gc-sections for MIPS
All architectures but MIPS are using --gc-sections on final linking. This patch introduces that feature for MIPS to reduce the memory and flash footprint. Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com> Cc: Wolfgang Denk <wd@denx.de> Cc: Stefan Roese <sr@denx.de> Cc: Thomas Lange <thomas@corelatus.se> Cc: Vlad Lungu <vlad.lungu@windriver.com> Signed-off-by: Shinya Kuribayashi <skuribay@pobox.com>
Showing 9 changed files with 42 additions and 40 deletions Side-by-side Diff
arch/mips/config.mk
board/dbau1x00/u-boot.lds
| ... | ... | @@ -34,14 +34,14 @@ |
| 34 | 34 | . = ALIGN(4); |
| 35 | 35 | .text : |
| 36 | 36 | { |
| 37 | - *(.text) | |
| 37 | + *(.text*) | |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | . = ALIGN(4); |
| 41 | 41 | .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) } |
| 42 | 42 | |
| 43 | 43 | . = ALIGN(4); |
| 44 | - .data : { *(.data) } | |
| 44 | + .data : { *(.data*) } | |
| 45 | 45 | |
| 46 | 46 | . = .; |
| 47 | 47 | _gp = ALIGN(16) + 0x7ff0; |
| ... | ... | @@ -52,7 +52,7 @@ |
| 52 | 52 | __got_end = .; |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - .sdata : { *(.sdata) } | |
| 55 | + .sdata : { *(.sdata*) } | |
| 56 | 56 | |
| 57 | 57 | .u_boot_cmd : { |
| 58 | 58 | __u_boot_cmd_start = .; |
| ... | ... | @@ -64,8 +64,8 @@ |
| 64 | 64 | num_got_entries = (__got_end - __got_start) >> 2; |
| 65 | 65 | |
| 66 | 66 | . = ALIGN(4); |
| 67 | - .sbss (NOLOAD) : { *(.sbss) } | |
| 68 | - .bss (NOLOAD) : { *(.bss) . = ALIGN(4); } | |
| 67 | + .sbss (NOLOAD) : { *(.sbss*) } | |
| 68 | + .bss (NOLOAD) : { *(.bss*) . = ALIGN(4); } | |
| 69 | 69 | uboot_end = .; |
| 70 | 70 | } |
board/gth2/u-boot.lds
| ... | ... | @@ -34,14 +34,14 @@ |
| 34 | 34 | . = ALIGN(4); |
| 35 | 35 | .text : |
| 36 | 36 | { |
| 37 | - *(.text) | |
| 37 | + *(.text*) | |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | . = ALIGN(4); |
| 41 | 41 | .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) } |
| 42 | 42 | |
| 43 | 43 | . = ALIGN(4); |
| 44 | - .data : { *(.data) } | |
| 44 | + .data : { *(.data*) } | |
| 45 | 45 | |
| 46 | 46 | . = .; |
| 47 | 47 | _gp = ALIGN(16) + 0x7ff0; |
| ... | ... | @@ -52,7 +52,7 @@ |
| 52 | 52 | __got_end = .; |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - .sdata : { *(.sdata) } | |
| 55 | + .sdata : { *(.sdata*) } | |
| 56 | 56 | |
| 57 | 57 | .u_boot_cmd : { |
| 58 | 58 | __u_boot_cmd_start = .; |
| ... | ... | @@ -64,8 +64,8 @@ |
| 64 | 64 | num_got_entries = (__got_end - __got_start) >> 2; |
| 65 | 65 | |
| 66 | 66 | . = ALIGN(4); |
| 67 | - .sbss (NOLOAD) : { *(.sbss) } | |
| 68 | - .bss (NOLOAD) : { *(.bss) . = ALIGN(4); } | |
| 67 | + .sbss (NOLOAD) : { *(.sbss*) } | |
| 68 | + .bss (NOLOAD) : { *(.bss*) . = ALIGN(4); } | |
| 69 | 69 | uboot_end = .; |
| 70 | 70 | } |
board/incaip/u-boot.lds
| ... | ... | @@ -34,14 +34,14 @@ |
| 34 | 34 | . = ALIGN(4); |
| 35 | 35 | .text : |
| 36 | 36 | { |
| 37 | - *(.text) | |
| 37 | + *(.text*) | |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | . = ALIGN(4); |
| 41 | 41 | .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) } |
| 42 | 42 | |
| 43 | 43 | . = ALIGN(4); |
| 44 | - .data : { *(.data) } | |
| 44 | + .data : { *(.data*) } | |
| 45 | 45 | |
| 46 | 46 | . = .; |
| 47 | 47 | _gp = ALIGN(16) + 0x7ff0; |
| ... | ... | @@ -52,7 +52,7 @@ |
| 52 | 52 | __got_end = .; |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - .sdata : { *(.sdata) } | |
| 55 | + .sdata : { *(.sdata*) } | |
| 56 | 56 | |
| 57 | 57 | .u_boot_cmd : { |
| 58 | 58 | __u_boot_cmd_start = .; |
| ... | ... | @@ -64,8 +64,8 @@ |
| 64 | 64 | num_got_entries = (__got_end - __got_start) >> 2; |
| 65 | 65 | |
| 66 | 66 | . = ALIGN(4); |
| 67 | - .sbss (NOLOAD) : { *(.sbss) } | |
| 68 | - .bss (NOLOAD) : { *(.bss) . = ALIGN(4); } | |
| 67 | + .sbss (NOLOAD) : { *(.sbss*) } | |
| 68 | + .bss (NOLOAD) : { *(.bss*) . = ALIGN(4); } | |
| 69 | 69 | uboot_end = .; |
| 70 | 70 | } |
board/micronas/vct/u-boot.lds
| ... | ... | @@ -31,14 +31,14 @@ |
| 31 | 31 | . = ALIGN(4); |
| 32 | 32 | .text : |
| 33 | 33 | { |
| 34 | - *(.text) | |
| 34 | + *(.text*) | |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | . = ALIGN(4); |
| 38 | 38 | .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) } |
| 39 | 39 | |
| 40 | 40 | . = ALIGN(4); |
| 41 | - .data : { *(.data) } | |
| 41 | + .data : { *(.data*) } | |
| 42 | 42 | |
| 43 | 43 | . = .; |
| 44 | 44 | _gp = ALIGN(16) + 0x7ff0; |
| ... | ... | @@ -50,7 +50,7 @@ |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | . = ALIGN(4); |
| 53 | - .sdata : { *(.sdata) } | |
| 53 | + .sdata : { *(.sdata*) } | |
| 54 | 54 | |
| 55 | 55 | . = ALIGN(4); |
| 56 | 56 | .u_boot_cmd : { |
| 57 | 57 | |
| ... | ... | @@ -64,9 +64,9 @@ |
| 64 | 64 | num_got_entries = (__got_end - __got_start) >> 2; |
| 65 | 65 | |
| 66 | 66 | . = ALIGN(4); |
| 67 | - .sbss (NOLOAD) : { *(.sbss) } | |
| 67 | + .sbss (NOLOAD) : { *(.sbss*) } | |
| 68 | 68 | . = ALIGN(4); |
| 69 | - .bss (NOLOAD) : { *(.bss) } | |
| 69 | + .bss (NOLOAD) : { *(.bss*) } | |
| 70 | 70 | uboot_end = .; |
| 71 | 71 | } |
board/pb1x00/u-boot.lds
| ... | ... | @@ -34,14 +34,14 @@ |
| 34 | 34 | . = ALIGN(4); |
| 35 | 35 | .text : |
| 36 | 36 | { |
| 37 | - *(.text) | |
| 37 | + *(.text*) | |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | . = ALIGN(4); |
| 41 | 41 | .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) } |
| 42 | 42 | |
| 43 | 43 | . = ALIGN(4); |
| 44 | - .data : { *(.data) } | |
| 44 | + .data : { *(.data*) } | |
| 45 | 45 | |
| 46 | 46 | . = .; |
| 47 | 47 | _gp = ALIGN(16) + 0x7ff0; |
| ... | ... | @@ -52,7 +52,7 @@ |
| 52 | 52 | __got_end = .; |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - .sdata : { *(.sdata) } | |
| 55 | + .sdata : { *(.sdata*) } | |
| 56 | 56 | |
| 57 | 57 | .u_boot_cmd : { |
| 58 | 58 | __u_boot_cmd_start = .; |
| ... | ... | @@ -64,8 +64,8 @@ |
| 64 | 64 | num_got_entries = (__got_end - __got_start) >> 2; |
| 65 | 65 | |
| 66 | 66 | . = ALIGN(4); |
| 67 | - .sbss (NOLOAD) : { *(.sbss) } | |
| 68 | - .bss (NOLOAD) : { *(.bss) . = ALIGN(4); } | |
| 67 | + .sbss (NOLOAD) : { *(.sbss*) } | |
| 68 | + .bss (NOLOAD) : { *(.bss*) . = ALIGN(4); } | |
| 69 | 69 | uboot_end = .; |
| 70 | 70 | } |
board/qemu-mips/u-boot.lds
| ... | ... | @@ -34,14 +34,14 @@ |
| 34 | 34 | . = ALIGN(4); |
| 35 | 35 | .text : |
| 36 | 36 | { |
| 37 | - *(.text) | |
| 37 | + *(.text*) | |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | . = ALIGN(4); |
| 41 | 41 | .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) } |
| 42 | 42 | |
| 43 | 43 | . = ALIGN(4); |
| 44 | - .data : { *(.data) } | |
| 44 | + .data : { *(.data*) } | |
| 45 | 45 | |
| 46 | 46 | . = .; |
| 47 | 47 | _gp = ALIGN(16) +0x7ff0; |
| ... | ... | @@ -53,7 +53,7 @@ |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | . = ALIGN(4); |
| 56 | - .sdata : { *(.sdata) } | |
| 56 | + .sdata : { *(.sdata*) } | |
| 57 | 57 | |
| 58 | 58 | . = .; |
| 59 | 59 | .u_boot_cmd : { |
| ... | ... | @@ -66,8 +66,8 @@ |
| 66 | 66 | num_got_entries = (__got_end - __got_start) >> 2; |
| 67 | 67 | |
| 68 | 68 | . = ALIGN(4); |
| 69 | - .sbss : { *(.sbss) } | |
| 70 | - .bss : { *(.bss) . = ALIGN(4); } | |
| 69 | + .sbss : { *(.sbss*) } | |
| 70 | + .bss : { *(.bss*) . = ALIGN(4); } | |
| 71 | 71 | uboot_end = .; |
| 72 | 72 | } |
board/tb0229/u-boot.lds
| ... | ... | @@ -34,14 +34,14 @@ |
| 34 | 34 | . = ALIGN(4); |
| 35 | 35 | .text : |
| 36 | 36 | { |
| 37 | - *(.text) | |
| 37 | + *(.text*) | |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | . = ALIGN(4); |
| 41 | 41 | .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) } |
| 42 | 42 | |
| 43 | 43 | . = ALIGN(4); |
| 44 | - .data : { *(.data) } | |
| 44 | + .data : { *(.data*) } | |
| 45 | 45 | |
| 46 | 46 | . = .; |
| 47 | 47 | _gp = ALIGN(16) + 0x7ff0; |
| ... | ... | @@ -52,7 +52,7 @@ |
| 52 | 52 | __got_end = .; |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - .sdata : { *(.sdata) } | |
| 55 | + .sdata : { *(.sdata*) } | |
| 56 | 56 | |
| 57 | 57 | .u_boot_cmd : { |
| 58 | 58 | __u_boot_cmd_start = .; |
| ... | ... | @@ -64,8 +64,8 @@ |
| 64 | 64 | num_got_entries = (__got_end - __got_start) >> 2; |
| 65 | 65 | |
| 66 | 66 | . = ALIGN(4); |
| 67 | - .sbss (NOLOAD) : { *(.sbss) } | |
| 68 | - .bss (NOLOAD) : { *(.bss) . = ALIGN(4); } | |
| 67 | + .sbss (NOLOAD) : { *(.sbss*) } | |
| 68 | + .bss (NOLOAD) : { *(.bss*) . = ALIGN(4); } | |
| 69 | 69 | uboot_end = .; |
| 70 | 70 | } |
examples/standalone/mips.lds
| ... | ... | @@ -30,14 +30,14 @@ |
| 30 | 30 | { |
| 31 | 31 | .text : |
| 32 | 32 | { |
| 33 | - *(.text) | |
| 33 | + *(.text*) | |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | . = ALIGN(4); |
| 37 | 37 | .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) } |
| 38 | 38 | |
| 39 | 39 | . = ALIGN(4); |
| 40 | - .data : { *(.data) } | |
| 40 | + .data : { *(.data*) } | |
| 41 | 41 | |
| 42 | 42 | . = .; |
| 43 | 43 | _gp = ALIGN(16) + 0x7ff0; |
| 44 | 44 | |
| ... | ... | @@ -48,12 +48,12 @@ |
| 48 | 48 | __got_end = .; |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | - .sdata : { *(.sdata) } | |
| 51 | + .sdata : { *(.sdata*) } | |
| 52 | 52 | |
| 53 | 53 | . = ALIGN(4); |
| 54 | 54 | __bss_start = .; |
| 55 | - .sbss (NOLOAD) : { *(.sbss) } | |
| 56 | - .bss (NOLOAD) : { *(.bss) . = ALIGN(4); } | |
| 55 | + .sbss (NOLOAD) : { *(.sbss*) } | |
| 56 | + .bss (NOLOAD) : { *(.bss*) . = ALIGN(4); } | |
| 57 | 57 | |
| 58 | 58 | _end = .; |
| 59 | 59 | } |