Use --gc-sections during link
All common functions are being built into all binary images,
whether or not they are actually used. This change enables the
use of -ffunction-sections, -fdata-sections and --gc-sections
in the compiler and linker to remove unused code and data from
the images.
Change-Id: Ia9f78c01054ac4fa15d145af38b88a0d6fb7d409
diff --git a/bl2/bl2.ld.S b/bl2/bl2.ld.S
index 09dec75..edb676a 100644
--- a/bl2/bl2.ld.S
+++ b/bl2/bl2.ld.S
@@ -47,8 +47,8 @@
ro . : {
__RO_START__ = .;
- *bl2_entrypoint.o(.text)
- *(.text)
+ *bl2_entrypoint.o(.text*)
+ *(.text*)
*(.rodata*)
*(.vectors)
__RO_END_UNALIGNED__ = .;
@@ -63,7 +63,7 @@
.data . : {
__DATA_START__ = .;
- *(.data)
+ *(.data*)
__DATA_END__ = .;
} >RAM
@@ -79,7 +79,7 @@
*/
.bss : ALIGN(16) {
__BSS_START__ = .;
- *(SORT_BY_ALIGNMENT(.bss))
+ *(SORT_BY_ALIGNMENT(.bss*))
*(COMMON)
__BSS_END__ = .;
} >RAM