aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2003-04-01 23:44:45 +0000
committerAlan Modra <amodra@gmail.com>2003-04-01 23:44:45 +0000
commitc45a316a0b3db99f6013dc771279d543652b088d (patch)
tree005e1ed4b8a37fe9458b634f794f1206e3d53ab5
parent3126d709ed5e83594442a550b66e1488e7657b0e (diff)
downloadgdb-c45a316a0b3db99f6013dc771279d543652b088d.zip
gdb-c45a316a0b3db99f6013dc771279d543652b088d.tar.gz
gdb-c45a316a0b3db99f6013dc771279d543652b088d.tar.bz2
* elfxx-mips.c (_bfd_mips_elf_hide_symbol): Test for NULL dynobj.
-rw-r--r--bfd/ChangeLog4
-rw-r--r--bfd/elfxx-mips.c87
2 files changed, 49 insertions, 42 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 0ce8c01..fe284d2 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,7 @@
+2003-04-02 Alan Modra <amodra@bigpond.net.au>
+
+ * elfxx-mips.c (_bfd_mips_elf_hide_symbol): Test for NULL dynobj.
+
2003-04-01 Bob Wilson <bob.wilson@acm.org>
* Makefile.am (ALL_MACHINES): Add cpu-xtensa.lo.
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
index c8c9870..fa165d9 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);
}