summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Schwierzeck <daniel.schwierzeck@googlemail.com>2011-04-15 17:16:44 +0200
committerShinya Kuribayashi <skuribay@pobox.com>2011-05-10 00:08:10 +0900
commit660da0947abff3bc98bb0baa37a6db5050ff46d6 (patch)
tree8586e9594f64d2a366706b3729180e0516a913d6
parent7aa1f198c897e48a011f9f0dca6b3088bc474236 (diff)
downloadu-boot-imx-660da0947abff3bc98bb0baa37a6db5050ff46d6.zip
u-boot-imx-660da0947abff3bc98bb0baa37a6db5050ff46d6.tar.gz
u-boot-imx-660da0947abff3bc98bb0baa37a6db5050ff46d6.tar.bz2
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>
-rw-r--r--arch/mips/config.mk2
-rw-r--r--board/dbau1x00/u-boot.lds10
-rw-r--r--board/gth2/u-boot.lds10
-rw-r--r--board/incaip/u-boot.lds10
-rw-r--r--board/micronas/vct/u-boot.lds10
-rw-r--r--board/pb1x00/u-boot.lds10
-rw-r--r--board/qemu-mips/u-boot.lds10
-rw-r--r--board/tb0229/u-boot.lds10
-rw-r--r--examples/standalone/mips.lds10
9 files changed, 42 insertions, 40 deletions
diff --git a/arch/mips/config.mk b/arch/mips/config.mk
index 318d34b..6ab8acd 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 3c4fbe3..4a59cea 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 aeb0fcc..9fc417f 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 3c4fbe3..4a59cea 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 b90b186..3a05ef9 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 358cc54..bd0dee1 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 bd16786..9460b20 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 56d7c25..5ea1094 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 63a1c92..5f766ed 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 = .;
}