0

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

enter image description here

kakeh
  • 403
  • 3
  • 17
  • Why are you concerned with the ELF? How are you going to use U-Boot? Typically it is the .bin image file that is executed. – sawdust May 12 '15 at 20:01
  • yes you are right, but what concerns me is in the `LDS` file, an `LDS` file describes the output ELF file which section goes where in file, but why does the LDS describes the .bss to be out of the ELF size ? – kakeh May 13 '15 at 04:13

0 Answers0