aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-m68k.c
diff options
context:
space:
mode:
authorKazu Hirata <kazu@codesourcery.com>2004-01-08 11:01:37 +0000
committerKazu Hirata <kazu@codesourcery.com>2004-01-08 11:01:37 +0000
commit4f075348c0645ee3f227281a140368256aa5c600 (patch)
tree74f7533ae350bd4b30de011fffd5e8a23bcd8856 /bfd/elf32-m68k.c
parent77c26ae3f453b4822124c65a0f4874e9af307dde (diff)
downloadgdb-4f075348c0645ee3f227281a140368256aa5c600.zip
gdb-4f075348c0645ee3f227281a140368256aa5c600.tar.gz
gdb-4f075348c0645ee3f227281a140368256aa5c600.tar.bz2
* elf32-m68k.c (elf_m68k_gc_sweep_hook): Terminate early
if no dynamic object is present. Declare r_symndx and h in an inner scope.
Diffstat (limited to 'bfd/elf32-m68k.c')
-rw-r--r--bfd/elf32-m68k.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/bfd/elf32-m68k.c b/bfd/elf32-m68k.c
index 90609c5..1c7fed9 100644
--- a/bfd/elf32-m68k.c
+++ b/bfd/elf32-m68k.c
@@ -817,26 +817,27 @@ elf_m68k_gc_sweep_hook (abfd, info, sec, relocs)
struct elf_link_hash_entry **sym_hashes;
bfd_signed_vma *local_got_refcounts;
const Elf_Internal_Rela *rel, *relend;
- unsigned long r_symndx;
- struct elf_link_hash_entry *h;
bfd *dynobj;
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 == NULL)
return TRUE;
+ symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+ sym_hashes = elf_sym_hashes (abfd);
+ local_got_refcounts = elf_local_got_refcounts (abfd);
+
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++)
{
+ unsigned long r_symndx;
+ struct elf_link_hash_entry *h;
+
switch (ELF32_R_TYPE (rel->r_info))
{
case R_68K_GOT8: