add vtable relocs for Alpha

Bo Thorsen bo@sonofthor.dk
Mon Feb 19 11:59:00 GMT 2001


On 19 Feb 2001, Ian Lance Taylor wrote:

> Bo Thorsen <bo@sonofthor.dk> writes:
>
> > On Mon, 19 Feb 2001, Richard Henderson wrote:
> >
> > > On Mon, Feb 19, 2001 at 10:41:14AM -0800, Ian Lance Taylor wrote:
> > > > > Richard, in which way should it be rewritten?  What should be done in
> > > > > general with new targets?
> > > >
> > > > It should be rewritten to not use relocation entries.  Using
> > > > relocation entries requires changes to every single ELF target file.
> > > >
> > > > Instead, the vtable information should be stored in special sections.
> > > > The linker should read the information out of those sections.  This
> > > > can be done in generic code in elflink.[ch].
> > >
> > > Exactly.
> >
> > Can you be more specific on what should be done? I'm currently enabling
> > C++ support on x86-64 and I would be interested in doing this in a generic
> > way, if it's possible. So, if you can explain to me what should be done, I
> > can spend some time on it.
>
> I'm not really sure how to be much more specific.
>
> Right now the vtable information is stored in relocation entries.
> There are two types: VTINHERIT and VTENTRY.  The entries are created
> by the .vtable_inherit and .vtable_entry pseudo-ops in gas.  They are
> defined in config/obj-elf.c.  They call fix_new to create the
> information.
>
> gas should be changed to instead create a special section or two and
> write the information there.
>
> In the linker these relocs are handled by calling
> _bfd_elf32_gc_record_vtinherit and _bfd_elf32_gc_record_vtentry.
>
> The linker should be changed to read the special sections and call the
> above functions.

This is exactly how you needed to be more specific :-) I'll start taking
a good look at this on monday.

Bo.

-- 

     Bo Thorsen                 |   Lahnsgade 31, st.
     Free software developer    |   5000 Odense C
     SuSE Labs                  |   Denmark



More information about the Binutils mailing list