This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: SH: forced local symbols
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