This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: SH: forced local symbols
On Fri, Aug 23, 2002 at 12:29:38PM +0930, Alan Modra wrote:
> On Thu, Aug 22, 2002 at 10:39:47PM -0400, Daniel Jacobowitz wrote:
> > On Fri, Aug 23, 2002 at 12:03:11PM +0930, Alan Modra wrote:
> > > Shouldn't you just be using "if (info->shared)" here?
> >
> > No... if we aren't going to call _finish_dynamic_symbol, we won't be
> > needing the GOT entry (I think) and we certainly do need to do the
> > allocation at this stage in applications with a GOT.
>
> Look again. You call bfd_elf32_link_record_dynamic_symbol just
> before this code, which guarantees either dynindx != -1 or
> elf_link_hash_flags & ELF_LINK_FORCED_LOCAL. That means your
> WILL_CALL_FINISH_DYNAMIC_SYMBOL boils down to (info->shared
> || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0). So
With you so far...
> info->shared implies finish_dynamic_symbol will be called. I
> reckon allocating the reloc in the !shared case is wrong: You
> don't need a reloc here on code that's never going to move.
! ELF_LINK_FORCED_LOCAL also implies that finish_dynamic_symbol will be
called. Right now, finish_dynamic_symbol will always emit a relocation
if h->got.offset != (bfd_vma) -1. I don't think we can skip that based
just on !info->shared... maybe I'm not understanding something.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer