This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: add vtable relocs for Alpha
- To: Ian Lance Taylor <ian at zembu dot com>
- Subject: Re: add vtable relocs for Alpha
- From: Bo Thorsen <bo at sonofthor dot dk>
- Date: Mon, 19 Feb 2001 20:59:29 +0100 (CET)
- Cc: Richard Henderson <rth at redhat dot com>, <pb at futuretv dot com>,<binutils at sources dot redhat dot com>, <aj at suse dot de>
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