This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: mn10300: relaxing vs section merging


On Tue, May 11, 2004 at 07:35:59PM -0300, Alexandre Oliva wrote:
> On May  6, 2004, DJ Delorie <dj@redhat.com> wrote:
> >> > You have to use section-relative relocs with section merging
> 
> >> Why?
> 
> > Because _bfd_elf_rela_local_sym() only adjusts STT_SECTION symbols.
> > If you have other types of symbols, it doesn't seem to adjust the
> > values properly.
> 
> Hmm...  Maybe it should be improved/fixed, then?  I suppose whenever
> we get called with a symbol, we should figure out in which section it
> is, find the relocation for the section, and then apply the symbol
> offset into the section again.

Local symbols in SEC_MERGE sections are adjusted, but too late for
you when doing relaxing.  See elf_link_input_bfd.  You can't do the
adjustment until you know final section layout, because some symbols
might end up pointing outside their section, or even outside their
bfd.  Of course, you can't make the final section layout until
relaxing is complete..

I suppose it would be possible to move all the local sym adjustments
into _bfd_elf_rel{,a}_local_sym.  Note that _bfd_elf_rel_local_sym
looks like it handles any local sym.  Beware!  _bfd_elf_rel_local_sym
should be (and is currently) only called on section syms.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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