aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elf32-cris.c13
-rw-r--r--bfd/elfxx-mips.c7
3 files changed, 16 insertions, 10 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 7d0d5f3..52e65fb 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2005-08-17 Alan Modra <amodra@bigpond.net.au>
+
+ * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Move assert later.
+ * elfxx-mips.c (_bfd_mips_elf_hide_symbol): Cope with being called
+ without any got section.
+
2005-08-17 Danny Smith <dannysmith@users.sourceforge.net>
* cofflink.c (_bfd_coff_generic_relocate_section): Correct
diff --git a/bfd/elf32-cris.c b/bfd/elf32-cris.c
index ced86c3..618210a 100644
--- a/bfd/elf32-cris.c
+++ b/bfd/elf32-cris.c
@@ -2078,9 +2078,6 @@ elf_cris_adjust_gotplt_to_got (h, p)
PTR p;
{
struct bfd_link_info *info = (struct bfd_link_info *) p;
- bfd *dynobj = elf_hash_table (info)->dynobj;
-
- BFD_ASSERT (dynobj != NULL);
if (h->root.root.type == bfd_link_hash_warning)
h = (struct elf_cris_link_hash_entry *) h->root.root.u.i.link;
@@ -2100,9 +2097,13 @@ elf_cris_adjust_gotplt_to_got (h, p)
else
{
/* No GOT entry for this symbol. We need to create one. */
- asection *sgot = bfd_get_section_by_name (dynobj, ".got");
- asection *srelgot
- = bfd_get_section_by_name (dynobj, ".rela.got");
+ bfd *dynobj = elf_hash_table (info)->dynobj;
+ asection *sgot;
+ asection *srelgot;
+
+ BFD_ASSERT (dynobj != NULL);
+ sgot = bfd_get_section_by_name (dynobj, ".got");
+ srelgot = bfd_get_section_by_name (dynobj, ".rela.got");
/* Put an accurate refcount there. */
h->root.got.refcount = h->gotplt_refcount;
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
index 53b5c9e..389c2af 100644
--- a/bfd/elfxx-mips.c
+++ b/bfd/elfxx-mips.c
@@ -8424,11 +8424,10 @@ _bfd_mips_elf_hide_symbol (struct bfd_link_info *info,
h->forced_local = force_local;
dynobj = elf_hash_table (info)->dynobj;
- if (dynobj != NULL && force_local && h->root.type != STT_TLS)
+ if (dynobj != NULL && force_local && h->root.type != STT_TLS
+ && (got = mips_elf_got_section (dynobj, FALSE)) != NULL
+ && (g = mips_elf_section_data (got)->u.got_info) != NULL)
{
- got = mips_elf_got_section (dynobj, FALSE);
- g = mips_elf_section_data (got)->u.got_info;
-
if (g->next)
{
struct mips_got_entry e;