]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Catch GOT offsets for a symbol which have no associated GOT subsection.
authorNick Clifton <nickc@redhat.com>
Mon, 9 Feb 2004 10:30:13 +0000 (10:30 +0000)
committerNick Clifton <nickc@redhat.com>
Mon, 9 Feb 2004 10:30:13 +0000 (10:30 +0000)
bfd/ChangeLog
bfd/elf64-alpha.c

index 19b521c742ac5bb780d4252b4c1e6d43f1587c91..cbd41d03c1cd8df43e6e8d8fbbcdb3c3b501914a 100644 (file)
@@ -1,3 +1,9 @@
+2004-02-09  Christian Vogel <vogelchr@vogel.cx>
+           Nick Clifton  <nickc@redhat.com>
+
+       * elf64-alpha.c (elf64_alpha_calc_got_offsets_for_symbol): Catch
+       GOT entries with no associated GOT subsection.
+
 2004-02-09  Richard Sandiford  <rsandifo@redhat.com>
 
        * bfd-elf.h (elf_backend_name_local_section_symbols): New hook.
index 6025277a6bf2db5c8d423e5b0fce481caf78fbea..8bd03c20fc3980f4e17b0f2b983aa0c906e8143f 100644 (file)
@@ -3547,6 +3547,7 @@ elf64_alpha_calc_got_offsets_for_symbol (h, arg)
      struct alpha_elf_link_hash_entry *h;
      PTR arg ATTRIBUTE_UNUSED;
 {
+  bfd_boolean result = TRUE;
   struct alpha_elf_got_entry *gotent;
 
   if (h->root.root.type == bfd_link_hash_warning)
@@ -3555,14 +3556,23 @@ elf64_alpha_calc_got_offsets_for_symbol (h, arg)
   for (gotent = h->got_entries; gotent; gotent = gotent->next)
     if (gotent->use_count > 0)
       {
-       bfd_size_type *plge
-         = &alpha_elf_tdata (gotent->gotobj)->got->_raw_size;
+       struct alpha_elf_obj_tdata *td;
+       bfd_size_type *plge;
 
+       td = alpha_elf_tdata (gotent->gotobj);
+       if (td == NULL)
+         {
+           _bfd_error_handler (_("Symbol %s has no GOT subsection for offset 0x%x"),
+                               h->root.root.root.string, gotent->got_offset);
+           result = FALSE;
+           continue;
+         }
+       plge = &td->got->_raw_size;
        gotent->got_offset = *plge;
        *plge += alpha_got_entry_size (gotent->reloc_type);
       }
 
-  return TRUE;
+  return result;
 }
 
 static void