This is the mail archive of the binutils@sourceware.org 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: Relocations against STN_UNDEF


On Fri, Sep 24, 2010 at 09:54:25AM +0200, Thomas Schwinge wrote:
> On 2010-09-24 00:12, Alan Modra wrote:
> > ARM fails because the arm backend specifically checks for undefined
> > local symbols.  I'd say the arm backend check needs fixing (or
> > removing) rather than changing the common elflink code.
> 
> Surely enough we could just change the ARM backend, but I'm not yet
> really convinced that this is the most appropriate approach: if we agree
> that BFD internally shall register STN_UNDEF with bfd_abs_section
> instead of bfd_und_section (as demonstrated in other parts of the code
> that I quoted),

What is done elsewhere to make ELF relocs fit into the BFD framework
isn't particularly relevant to the ELF linker.

> then why not make it like this during relocations
> processing, too?

Why do extra work just for ARM?

>  Or is it that you think this change may be disruptive
> for other backends?

The thought had crossed my mind.

> >> I wonder why we need this code duplicated in (at least) two places; why
> >> do objdump and ld use different code paths for reading in relocations?
> >
> > Efficiency.
> 
> Uhm, okay...

To expand a little, the general BFD code for reading relocs wants to
return them as an arelent array, using symbols from an asymbol *
array.  By processing the relocs directly the ELF linker saves time
and memory;  No need to convert ELF symbols to BFD asymbols, and no
need to set up an arelent array.

-- 
Alan Modra
Australia Development Lab, IBM


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