mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-23 19:50:13 +08:00
* elfxx-mips.c (_bfd_mips_elf_hide_symbol): Test for NULL dynobj.
This commit is contained in:
@ -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>
|
2003-04-01 Bob Wilson <bob.wilson@acm.org>
|
||||||
|
|
||||||
* Makefile.am (ALL_MACHINES): Add cpu-xtensa.lo.
|
* Makefile.am (ALL_MACHINES): Add cpu-xtensa.lo.
|
||||||
|
@ -7716,54 +7716,57 @@ _bfd_mips_elf_hide_symbol (info, entry, force_local)
|
|||||||
h->forced_local = TRUE;
|
h->forced_local = TRUE;
|
||||||
|
|
||||||
dynobj = elf_hash_table (info)->dynobj;
|
dynobj = elf_hash_table (info)->dynobj;
|
||||||
got = mips_elf_got_section (dynobj, FALSE);
|
if (dynobj != NULL)
|
||||||
g = mips_elf_section_data (got)->u.got_info;
|
|
||||||
|
|
||||||
if (g->next)
|
|
||||||
{
|
{
|
||||||
struct mips_got_entry e;
|
got = mips_elf_got_section (dynobj, FALSE);
|
||||||
struct mips_got_info *gg = g;
|
g = mips_elf_section_data (got)->u.got_info;
|
||||||
|
|
||||||
/* Since we're turning what used to be a global symbol into a
|
if (g->next)
|
||||||
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--;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 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);
|
struct mips_got_entry e;
|
||||||
gg->assigned_gotno--;
|
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--;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 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)
|
||||||
|
{
|
||||||
|
/* 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);
|
_bfd_elf_link_hash_hide_symbol (info, &h->root, force_local);
|
||||||
|
Reference in New Issue
Block a user