[SOLVED] G++ linker going crazy ?
Posted: Sun Jan 26, 2014 1:35 pm
Hi everybody,
I'm encountering a strange problem with g++ linking phase.
When I use this linker script:
g++ creates a 2.1M executable. If I change 0x8000601000 to 0x8000602000, the executable size is 12K. When I look at the ELF headers, I see that the second program header is put at an offset of 0x201000. I don't understand this behavior.
I've searched for it and I found https://groups.google.com/forum/#!topic ... 5fzlMbjdy0. However, there are no real solution in this post, neither real explanation. I tried adding rodata and bss section (even with rodata* and bss*) and it does not change anything.
Does someone ever encountered such issues ? Is there an option I can use to prevent that to happen ?
Thank you for any idea
I'm encountering a strange problem with g++ linking phase.
When I use this linker script:
Code: Select all
ENTRY(main)
SECTIONS {
. = 0x8000401000;
.text BLOCK(4096) : ALIGN(4096)
{
*(.text)
}
. = 0x8000601000;
.data BLOCK(4096) : ALIGN(4096)
{
*(.data)
}
}
I've searched for it and I found https://groups.google.com/forum/#!topic ... 5fzlMbjdy0. However, there are no real solution in this post, neither real explanation. I tried adding rodata and bss section (even with rodata* and bss*) and it does not change anything.
Does someone ever encountered such issues ? Is there an option I can use to prevent that to happen ?
Thank you for any idea