This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: vtable is in the wrong segment
- To: ischis2 at home dot com
- Subject: Re: vtable is in the wrong segment
- From: Nick Clifton <nickc at redhat dot com>
- Date: Tue, 13 Feb 2001 14:19:14 -0800
- CC: gcc at gcc dot gnu dot org
Hi Stephen,
: I am working on an embedded app (target=motorola-power-pc
: host=686-cygwin-pe) and under older gcc the the vtables were
: part of the text segment
:
: Now they have moved. Is there a way to have the linker combine
: segments?
You probably mean 'sections' not 'segments'. Segments are collections
of sections with the same attributes.
Anyway, the answer to your problem is probably to use a custom linker
script. In the script you can assign input sections to output
sections, so you can arrange for all of the incoming .text sections,
plus all of the incoming .vtable sections (or whatever section the
tables are now in) to be mapped into the single output .text section.
Have a read of the linker documentation. You are probably going to
want a linker script that looks a bit like this:
SECTIONS
{
.text { *(.text) *(.vtable) }
.data { *(.data) }
.bss { *(.bss) }
}
Cheers
Nick