Linker Script Symbols

78 views Asked by At

I have read and looked at a lot of examples and I am still having problems. so what I have is

SECTIONS
{
    _kernel_head_address  =  12;

    .text   0x00400400 :
    {
        code = .; _code = .; __code = .;
        *(.text)
        . = ALIGN(1024);
    }

    ...

    _kernel_tail_address =    .;

    _kernel_size         =    _kernel_tail_address - _kernel_head_address;

}

The symbols are defined and I am able to retrieve the addresses of the symbols in my C++ code. However all three symbols are defined with contiguous addresses x0000, x0004, x0008, for example and when i look at the objdump of the file I can see they are all being defined within the .bss section of the output file. So it appears as though the linker ignores where the symbols are defined in the script and simply allocates them all within the .bss section which is counter to all of the examples I have seen. So am I doing something obviously wrong? Is there something in my development environment that could cause this? Any pointers greatly appreciated, I've spent the last 4 days on this and I am stumped.

0

There are 0 answers