SH: forced local symbols

Alan Modra
Thu Aug 22 20:00:00 GMT 2002

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
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.

Alan Modra
IBM OzLabs - Linux Technology Centre

More information about the Binutils mailing list