From: Alan Modra Date: Tue, 1 Apr 2003 23:44:45 +0000 (+0000) Subject: * elfxx-mips.c (_bfd_mips_elf_hide_symbol): Test for NULL dynobj. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c45a316a0b3db99f6013dc771279d543652b088d;p=binutils-gdb.git * elfxx-mips.c (_bfd_mips_elf_hide_symbol): Test for NULL dynobj. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 0ce8c01b1cc..fe284d2f2c5 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,7 @@ +2003-04-02 Alan Modra + + * elfxx-mips.c (_bfd_mips_elf_hide_symbol): Test for NULL dynobj. + 2003-04-01 Bob Wilson * Makefile.am (ALL_MACHINES): Add cpu-xtensa.lo. diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c index c8c9870fdd1..fa165d926ef 100644 --- a/bfd/elfxx-mips.c +++ b/bfd/elfxx-mips.c @@ -7716,55 +7716,58 @@ _bfd_mips_elf_hide_symbol (info, entry, force_local) h->forced_local = TRUE; dynobj = elf_hash_table (info)->dynobj; - got = mips_elf_got_section (dynobj, FALSE); - g = mips_elf_section_data (got)->u.got_info; - - if (g->next) + if (dynobj != NULL) { - struct mips_got_entry e; - struct mips_got_info *gg = g; + got = mips_elf_got_section (dynobj, FALSE); + g = mips_elf_section_data (got)->u.got_info; - /* Since we're turning what used to be a global symbol into a - local one, bump up the number of local entries of each GOT - that had an entry for it. This will automatically decrease - the number of global entries, since global_gotno is actually - the upper limit of global entries. */ - e.abfd = dynobj; - e.symndx = -1; - e.d.h = h; + if (g->next) + { + struct mips_got_entry e; + struct mips_got_info *gg = g; + + /* Since we're turning what used to be a global symbol into a + local one, bump up the number of local entries of each GOT + that had an entry for it. This will automatically decrease + the number of global entries, since global_gotno is actually + the upper limit of global entries. */ + e.abfd = dynobj; + e.symndx = -1; + e.d.h = h; - for (g = g->next; g != gg; g = g->next) - if (htab_find (g->got_entries, &e)) - { - BFD_ASSERT (g->global_gotno > 0); - g->local_gotno++; - g->global_gotno--; - } + for (g = g->next; g != gg; g = g->next) + if (htab_find (g->got_entries, &e)) + { + BFD_ASSERT (g->global_gotno > 0); + g->local_gotno++; + g->global_gotno--; + } - /* If this was a global symbol forced into the primary GOT, we - no longer need an entry for it. We can't release the entry - at this point, but we must at least stop counting it as one - of the symbols that required a forced got entry. */ - if (h->root.got.offset == 2) + /* If this was a global symbol forced into the primary GOT, we + no longer need an entry for it. We can't release the entry + at this point, but we must at least stop counting it as one + of the symbols that required a forced got entry. */ + if (h->root.got.offset == 2) + { + BFD_ASSERT (gg->assigned_gotno > 0); + gg->assigned_gotno--; + } + } + else if (g->global_gotno == 0 && g->global_gotsym == NULL) + /* If we haven't got through GOT allocation yet, just bump up the + number of local entries, as this symbol won't be counted as + global. */ + g->local_gotno++; + else if (h->root.got.offset == 1) { - BFD_ASSERT (gg->assigned_gotno > 0); - gg->assigned_gotno--; + /* If we're past non-multi-GOT allocation and this symbol had + been marked for a global got entry, give it a local entry + instead. */ + BFD_ASSERT (g->global_gotno > 0); + g->local_gotno++; + g->global_gotno--; } } - else if (g->global_gotno == 0 && g->global_gotsym == NULL) - /* If we haven't got through GOT allocation yet, just bump up the - number of local entries, as this symbol won't be counted as - global. */ - g->local_gotno++; - else if (h->root.got.offset == 1) - { - /* If we're past non-multi-GOT allocation and this symbol had - been marked for a global got entry, give it a local entry - instead. */ - BFD_ASSERT (g->global_gotno > 0); - g->local_gotno++; - g->global_gotno--; - } _bfd_elf_link_hash_hide_symbol (info, &h->root, force_local); }