Question

I'm looking at arch/arm/boot/compressed/head.S in linux kerenl.

My board is odroid-S and when I see my symbol table which I got from readelf -S arch/arm/boot/compressed/vmlinux and I see these codes.

    LC0:  .word LC0         @ r1 
    .word   __bss_start     @ r2 
    .word   _end            @ r3 
    .word   zreladdr        @ r4 
    .word   _start          @ r5 
    .word   _got_start      @ r6 
    .word   _got_end        @ ip 
    .word   user_stack+4096     @ sp `

But the address each they have is not sequenced. As an example, LC0 value is 0000013c but __bss_start is 0031a734.

Can anybody tell me what confirms the values of these symbols???

Was it helpful?

Solution

When compiling a baremetal implementation of software like an OS or bootloader, one will have a platform specific linker script will specify what addresses each section will go into. The linker script will be written according to the platform's memory map.

When the operating system loads an executable, the operating system loaded will read the various sections in your elf file and ensure that each gets placed into the correct section of the process's memory map. The OS loader will then fix any unlinked addresses as required.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top