This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: vtable is in the wrong segment


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]