First, sorry for the double post, but this is something which is fairly different. I changed my link script to this
Code: Select all
OUTPUT_FORMAT("elf32-i386")
ENTRY(start)
virt = 0xC0000000;
phys = 0x102000;
SECTIONS
{
.text phys : AT(phys)
{
code = .;
*(.text)
*(.rodata*)
. = ALIGN(4096);
}
.data : AT(phys + (data - code))
{
_CTOR_LIST__ = .; LONG((_CTOR_END__ - _CTOR_LIST__) / 4 - 2) * (.ctors) LONG(0) _CTOR_END__ = .;
_DTOR_LIST__ = .; LONG((_DTOR_END__ - _DTOR_LIST__) / 4 - 2) * (.dtors) LONG(0) _DTOR_END__ = .;
data = .;
*(.data)
. = ALIGN(4096);
}
.bss : AT(phys + (bss - code))
{
bss = .;
*(.bss)
*(COMMON)
. = ALIGN(4096);
}
end = .;
}
I then got these results from objdump
Code: Select all
kernelbin: file format elf32-i386
Sections:
Idx Name Size VMA LMA File off Algn
0 .text 00003000 00100000 00100000 00001000 2**4
CONTENTS, ALLOC, LOAD, READONLY, CODE
1 .gnu.linkonce.t._ZN6StreamC2Ev 0000000e 00103000 00103000 00004000 2**1
CONTENTS, ALLOC, LOAD, READONLY, CODE, LINK_ONCE_DISCARD
2 .data 00000fe0 00103020 00103020 00004020 2**5
CONTENTS, ALLOC, LOAD, DATA
3 .bss 00001000 00104000 00104000 00005000 2**5
ALLOC
4 .comment 000000f6 00000000 00000000 00005000 2**0
CONTENTS, READONLY
5 .gnu.linkonce.r._ZTV6Stream 00000028 00000100 00000100 00000100 2**5
CONTENTS, ALLOC, LOAD, READONLY, DATA, LINK_ONCE_DISCARD
6 .gnu.linkonce.r._ZTV7Console 00000028 00000140 00000140 00000140 2**5
CONTENTS, ALLOC, LOAD, READONLY, DATA, LINK_ONCE_DISCARD
I'm fairly certain that the .gnu.linkonce.* is what's causing the problem. If it is, how would I merge these into the relevant sections?