public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [questions] elflink.c, back-end-data
@ 2007-07-26  1:23 msnyder
  2007-07-26 13:47 ` Alan Modra
  0 siblings, 1 reply; 2+ messages in thread
From: msnyder @ 2007-07-26  1:23 UTC (permalink / raw)
  To: binutils

Don't feel like I understand the issues well enough to submit a patch...
can somebody help me out here?

In _bfd_elf_fix_symbol_flags, we start with bed == NULL.
We only conditionally initialize it...
  /* Backend specific symbol fixup.  */
  if (elf_hash_table (eif->info)->dynobj)
    {
      bed = get_elf_backend_data (elf_hash_table (eif->info)->dynobj);

But before long we use it as if confident it's been initialized:
      (*bed->elf_backend_hide_symbol) (eif->info, h, force_local);

Then later, we eclipse it with a block-local version, which seems
to get initialized exactly the same as before (unles eif->info
or eif->info->dynobj can change...):

    if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
        && h->root.type == bfd_link_hash_undefweak)
      {
        const struct elf_backend_data *bed;
        bed = get_elf_backend_data (elf_hash_table (eif->info)->dynobj);
        (*bed->elf_backend_hide_symbol) (eif->info, h, TRUE);
      }

And then a short time later, we use it again as if it had certainly
been initialized (seems to me this last use would have benefited
from the preceeding initialization, had there not been an eclipsing
block local):

          (*bed->elf_backend_copy_indirect_symbol) (eif->info, weakdef, h);

Am I missing something?

Michael


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-07-26 13:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-26  1:23 [questions] elflink.c, back-end-data msnyder
2007-07-26 13:47 ` Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).