Section LMA overlap
Posted: Sun May 27, 2018 1:11 pm
Hey everybody!
I am trying to develop a kernel. I use advanced linker scripting, because I want it to be debuggable both before and after higher half switch. Thus, I use the AT() parameter extensibly. However, I am getting a strange linker error:
The full linker script is:
Am I missing something or is this a bug?
Thanks in advance!
I am trying to develop a kernel. I use advanced linker scripting, because I want it to be debuggable both before and after higher half switch. Thus, I use the AT() parameter extensibly. However, I am getting a strange linker error:
Code: Select all
/home/jakub/.local/stow/i686-elf-toolchain/lib/gcc/i686-elf/9.0.0/../../../../i686-elf/bin/ld: section .rodata LMA [ffffffff40000000,ffffffff40000017] overlaps section .text LMA [ffffffff40000000,ffffffff4000004d]
Code: Select all
ENTRY (_start);
SECTIONS
{
. = 0x00100000;
PROVIDE (_begin = .);
.text.early BLOCK (4K) : ALIGN (4K)
{
*(.text.early);
}
. += 0xC0000000;
.text BLOCK (4K) : AT (. - 0xC0000000) ALIGN (4K)
{
*(.text);
}
.rodata BLOCK (4K) : AT (. - 0xC0000000) ALIGN (4K)
{
*(.rodata);
}
.data BLOCK (4K) : AT (. - 0xC0000000) ALIGN (4K)
{
*(.data);
. = ALIGN (4K);
}
PROVIDE (_edata = .);
.bss BLOCK (4K) : AT (. - 0xC0000000) ALIGN (4K)
{
*(COMMON);
*(.bss);
/*
* PABSS is Page Aligned BSS.
*
* Everything in PABSS has to be aligned to 4K.
*/
. = ALIGN (4K);
*(.pabss);
. = ALIGN (4K);
}
PROVIDE (_end = .);
}
Thanks in advance!