Code: Select all
SECTIONS
{
/* The kernel will live at 3GB + 4MB in the virtual address space, which will be mapped
* to 4MB in the physical address space.
*/
. = 0xC0400000;
_kernel_head_address = .;
.text ALIGN ( 0x1000 ) : AT ( ADDR ( .text ) - 0xC0000000 )
{
*(.text) *(.rdata*) *(.rodata)
}
.data ALIGN ( 0x1000 ) : AT ( ADDR ( .data ) - 0xC0000000 )
{
*(.data)
}
.bss ALIGN ( 0x1000 ) : AT ( ADDR ( .bss ) - 0xC0000000 )
{
*(.bss)
}
_kernel_tail_address = .;
_kernel_size = _kernel_tail_address - _kernel_head_address;
}
What is going on here?
The second issue is that I expected the linker to create a series of sections with VMA differing from the LMA by 0xC0000000 however when I use objdump I get this result.
Code: Select all
Sections:
Idx Name Size VMA LMA File off Algn
0 .text 000012d4 c0400000 c0400000 00000400 2**9
CONTENTS, ALLOC, LOAD, READONLY, CODE, DATA
1 .text.st 00000014 c0402000 c0402000 00001800 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
2 .init 00000024 c0403000 c0403000 00001a00 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
3 .fini 00000024 c0404000 c0404000 00001c00 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
4 .ctors 00000004 c0405000 c0405000 00001e00 2**2
CONTENTS, ALLOC, LOAD, DATA
5 .data 00000004 c0406000 c0406000 00002000 2**2
CONTENTS, ALLOC, LOAD, DATA
6 .bss 0000001c c0407000 c0407000 00000000 2**2
ALLOC
Anyone able to point out my misunderstanding?