2001-08-20 H.J. Lu <hjl@gnu.org>
[deliverable/binutils-gdb.git] / bfd / elf.c
index a6332e2419648542f66e8faad2766a25d332bf2d..79998036d61ed1c2a45655e6dea658ffdfe87b45 100644 (file)
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -2091,6 +2091,7 @@ elf_map_symbols (abfd)
   if (sect_syms == NULL)
     return false;
   elf_section_syms (abfd) = sect_syms;
+  elf_num_section_syms (abfd) = max_index;
 
   for (idx = 0; idx < symcount; idx++)
     {
@@ -3651,7 +3652,8 @@ _bfd_elf_symbol_from_bfd_symbol (abfd, asym_ptr_ptr)
        indx = asym_ptr->section->output_section->index;
       else
        indx = asym_ptr->section->index;
-      if (elf_section_syms (abfd)[indx])
+      if (indx < elf_num_section_syms (abfd)
+         && elf_section_syms (abfd)[indx] != NULL)
        asym_ptr->udata.i = elf_section_syms (abfd)[indx]->udata.i;
     }
 
@@ -5343,12 +5345,6 @@ _bfd_elf_rel_vtable_reloc_fn (abfd, re, symbol, data, is, obfd, errmsg)
 # include <sys/procfs.h>
 #endif
 
-/* Define offsetof for those systems which lack it.  */
-
-#ifndef offsetof
-# define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER)
-#endif
-
 /* FIXME: this is kinda wrong, but it's what gdb wants.  */
 
 static int
@@ -5996,7 +5992,7 @@ bfd_get_elf_phdrs (abfd, phdrs)
 }
 
 void
-bfd_elf_sprintf_vma (abfd, buf, value)
+_bfd_elf_sprintf_vma (abfd, buf, value)
      bfd *abfd ATTRIBUTE_UNUSED;
      char *buf;
      bfd_vma value;
@@ -6027,7 +6023,7 @@ bfd_elf_sprintf_vma (abfd, buf, value)
 }
 
 void
-bfd_elf_fprintf_vma (abfd, stream, value)
+_bfd_elf_fprintf_vma (abfd, stream, value)
      bfd *abfd ATTRIBUTE_UNUSED;
      PTR stream;
      bfd_vma value;
This page took 0.028312 seconds and 4 git commands to generate.