Here below is the linker descriptor file which is an input to GNU LD
to build an u-boot ELF for an embedded system
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
OUTPUT_ARCH(arm)
ENTRY(_start)
SECTIONS
{
. = 0x00000000;
. = ALIGN(4);
.text :
{
arch/arm/cpu/armv7/start.o (.text)
*(.text)
}
. = ALIGN(4);
.rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }
. = ALIGN(4);
.data : {
*(.data)
}
. = ALIGN(4);
. = .;
__u_boot_cmd_start = .;
.u_boot_cmd : { *(.u_boot_cmd) }
__u_boot_cmd_end = .;
. = CONFIG_SYS_NAND_U_BOOT_SIZE + CONFIG_SYS_TEXT_BASE;
. = ALIGN(4);
.rel.dyn : {
__rel_dyn_start = .;
*(.rel*)
__rel_dyn_end = .;
}
.dynsym : {
__dynsym_start = .;
*(.dynsym)
}
.bss : {
__bss_start = .;
*(.bss)
. = ALIGN(4);
_end = .;
}
/DISCARD/ : { *(.dynstr*) }
/DISCARD/ : { *(.dynamic*) }
/DISCARD/ : { *(.plt*) }
/DISCARD/ : { *(.interp*) }
/DISCARD/ : { *(.gnu*) }
}
and the macro CONFIG_SYS_NAND_U_BOOT_SIZE
is a option of final size of u-boot, and the CONFIG_SYS_TEXT_BASE
holds the base address of the text, now my doubt is why is the .bss
is been placed outside the ELF allowed size ??
was it been put out of ELF , no ! when i have done the objdump of the ELF it was present in it, see the pic below