aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-m68k.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2000-04-27 00:31:17 +0000
committerAlan Modra <amodra@gmail.com>2000-04-27 00:31:17 +0000
commitdd5724d5231bacd3bdb04bb8572fb9201ee5538e (patch)
tree3f9d95abc006131f7abd82d3a4fdccb4dc52a184 /bfd/elf32-m68k.c
parentb2f4b24dd7649bc0ab581a400d0f84b866cb6c1c (diff)
downloadgdb-dd5724d5231bacd3bdb04bb8572fb9201ee5538e.zip
gdb-dd5724d5231bacd3bdb04bb8572fb9201ee5538e.tar.gz
gdb-dd5724d5231bacd3bdb04bb8572fb9201ee5538e.tar.bz2
Reference count .plt and .got on x86 for garbage collection code. Fix a
couple of m68k and ppc bugs discovered while testing x86 gc.
Diffstat (limited to 'bfd/elf32-m68k.c')
-rw-r--r--bfd/elf32-m68k.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/bfd/elf32-m68k.c b/bfd/elf32-m68k.c
index cc62230..38e6e9c 100644
--- a/bfd/elf32-m68k.c
+++ b/bfd/elf32-m68k.c
@@ -847,19 +847,19 @@ elf_m68k_gc_sweep_hook (abfd, info, sec, relocs)
unsigned long r_symndx;
struct elf_link_hash_entry *h;
bfd *dynobj;
- asection *sgot = NULL;
- asection *srelgot = NULL;
+ asection *sgot;
+ asection *srelgot;
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
sym_hashes = elf_sym_hashes (abfd);
local_got_refcounts = elf_local_got_refcounts (abfd);
dynobj = elf_hash_table (info)->dynobj;
- if (dynobj)
- {
- sgot = bfd_get_section_by_name (dynobj, ".got");
- srelgot = bfd_get_section_by_name (dynobj, ".rela.got");
- }
+ if (dynobj == NULL)
+ return true;
+
+ sgot = bfd_get_section_by_name (dynobj, ".got");
+ srelgot = bfd_get_section_by_name (dynobj, ".rela.got");
relend = relocs + sec->reloc_count;
for (rel = relocs; rel < relend; rel++)
@@ -887,7 +887,7 @@ elf_m68k_gc_sweep_hook (abfd, info, sec, relocs)
}
}
}
- else
+ else if (local_got_refcounts != NULL)
{
if (local_got_refcounts[r_symndx] > 0)
{