CFLAGS := -nostdinc -pedantic -ffreestanding -Wall \
-Werror -mgeneral-regs-only -std=c99 -c -Os \
-DDEBUG=${DEBUG} ${INCLUDES} ${CFLAGS}
+CFLAGS += -ffunction-sections -fdata-sections
LDFLAGS += --fatal-warnings -O1
+LDFLAGS += --gc-sections
vpath %.ld.S bl1:bl2:bl31
{
ro : {
__RO_START__ = .;
- *bl1_entrypoint.o(.text)
- *(.text)
+ *bl1_entrypoint.o(.text*)
+ *(.text*)
*(.rodata*)
*(.vectors)
__RO_END__ = .;
. = NEXT(16); /* Align LMA */
.data : ALIGN(16) { /* Align VMA */
__DATA_RAM_START__ = .;
- *(.data)
+ *(.data*)
__DATA_RAM_END__ = .;
} >RAM AT>ROM
*/
.bss : ALIGN(16) {
__BSS_START__ = .;
- *(.bss)
+ *(.bss*)
*(COMMON)
__BSS_END__ = .;
} >RAM
ro . : {
__RO_START__ = .;
- *bl2_entrypoint.o(.text)
- *(.text)
+ *bl2_entrypoint.o(.text*)
+ *(.text*)
*(.rodata*)
*(.vectors)
__RO_END_UNALIGNED__ = .;
.data . : {
__DATA_START__ = .;
- *(.data)
+ *(.data*)
__DATA_END__ = .;
} >RAM
*/
.bss : ALIGN(16) {
__BSS_START__ = .;
- *(SORT_BY_ALIGNMENT(.bss))
+ *(SORT_BY_ALIGNMENT(.bss*))
*(COMMON)
__BSS_END__ = .;
} >RAM
ro . : {
__RO_START__ = .;
- *bl31_entrypoint.o(.text)
- *(.text)
+ *bl31_entrypoint.o(.text*)
+ *(.text*)
*(.rodata*)
- /* Ensure 8-byte alignment for descriptors */
+ /* Ensure 8-byte alignment for descriptors and ensure inclusion */
. = ALIGN(8);
__RT_SVC_DESCS_START__ = .;
- *(rt_svc_descs)
+ KEEP(*(rt_svc_descs))
__RT_SVC_DESCS_END__ = .;
*(.vectors)
.data . : {
__DATA_START__ = .;
- *(.data)
+ *(.data*)
__DATA_END__ = .;
} >RAM
*/
.bss : ALIGN(16) {
__BSS_START__ = .;
- *(.bss)
+ *(.bss*)
*(COMMON)
__BSS_END__ = .;
} >RAM
ro . : {
__RO_START__ = .;
- *tsp_entrypoint.o(.text)
- *(.text)
+ *tsp_entrypoint.o(.text*)
+ *(.text*)
*(.rodata*)
*(.vectors)
__RO_END_UNALIGNED__ = .;
.data . : {
__DATA_START__ = .;
- *(.data)
+ *(.data*)
__DATA_END__ = .;
} >RAM
*/
.bss : ALIGN(16) {
__BSS_START__ = .;
- *(SORT_BY_ALIGNMENT(.bss))
+ *(SORT_BY_ALIGNMENT(.bss*))
*(COMMON)
__BSS_END__ = .;
} >RAM