* dbxread.c: Don't include libbfd.h.
authorStan Shebs <shebs@codesourcery.com>
Thu, 14 Jul 1994 21:34:09 +0000 (21:34 +0000)
committerStan Shebs <shebs@codesourcery.com>
Thu, 14 Jul 1994 21:34:09 +0000 (21:34 +0000)
* dwarfread.c, elfread.c somread.c: Don't include libbfd.h,
<time.h>, or <sys/types.h>.
* elfread.c (elf_symfile_read): Use only standard BFD functions to
collect information about the stab and stab string sections.

gdb/ChangeLog
gdb/dwarfread.c
gdb/elfread.c
gdb/somread.c

index c3081fb0104f138c0333d4c341773998ec3711ea..88fde5e9da1d82f81dde49208247526487c2dc88 100644 (file)
@@ -1,3 +1,11 @@
+Thu Jul 14 14:22:12 1994  Stan Shebs  (shebs@andros.cygnus.com)
+
+       * dbxread.c: Don't include libbfd.h.
+       * dwarfread.c, elfread.c somread.c: Don't include libbfd.h,
+       <time.h>, or <sys/types.h>.
+       * elfread.c (elf_symfile_read): Use only standard BFD functions to
+       collect information about the stab and stab string sections.
+
 Thu Jul 14 13:17:39 1994  Kung Hsu  (kung@x1.cygnus.com)
 
        * stabsread.c (read_huge_number): handle large unsigned number
index 15d2988f2969749bdea8232d7dbd37ecc8ebc2f4..96196f536e557c30d33c161ed049c63212385d3c 100644 (file)
@@ -44,9 +44,6 @@ other things to work on, if you get bored. :-)
 #include "gdbtypes.h"
 #include "symfile.h"
 #include "objfiles.h"
-#include <time.h> /* For time_t in libbfd.h.  */
-#include <sys/types.h> /* For time_t, if not in time.h.  */
-#include "libbfd.h"    /* FIXME Secret Internal BFD stuff (bfd_read) */
 #include "elf/dwarf.h"
 #include "buildsym.h"
 #include "demangle.h"
index 7b87cb22370bb4416f880856d2f09849624131b9..214197cbfb23db4ada9dffa309724ee3cd03cef9 100644 (file)
@@ -20,9 +20,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
 #include "defs.h"
 #include "bfd.h"
-#include <time.h> /* For time_t in libbfd.h.  */
-#include <sys/types.h> /* For time_t, if not in time.h.  */
-#include "libbfd.h"            /* For bfd_elf_find_section */
+#include <string.h>
 #include "libelf.h"
 #include "elf/mips.h"
 #include "symtab.h"
@@ -32,7 +30,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include "stabsread.h"
 #include "gdb-stabs.h"
 #include "complaints.h"
-#include <string.h>
 #include "demangle.h"
 
 /* The struct elfinfo is available only during ELF symbol table and
@@ -579,25 +576,21 @@ elf_symfile_read (objfile, section_offsets, mainline)
     }
   if (ei.stabsect)
     {
-      /* STABS sections */
-
-      /* FIXME:  Sun didn't really know how to implement this well.
-        They made .stab sections that don't point to the .stabstr
-        section with the sh_link field.  BFD doesn't make string table
-        sections visible to the caller.  So we have to search the
-        ELF section table, not the BFD section table, for the string
-        table.  */
-      struct elf32_internal_shdr *elf_sect;
-
-      elf_sect = bfd_elf_find_section (abfd, ".stabstr");
-      if (elf_sect)
+      asection *str_sect;
+
+      /* Stab sections have an associated string table that looks like
+        a separate section.  */
+      str_sect = bfd_get_section_by_name (abfd, ".stabstr");
+
+      /* FIXME should probably warn about a stab section without a stabstr.  */
+      if (str_sect)
        elfstab_build_psymtabs (objfile,
-         section_offsets,
-         mainline,
-         ei.stabsect->filepos,                         /* .stab offset */
-         bfd_get_section_size_before_reloc (ei.stabsect),/* .stab size */
-         (file_ptr) elf_sect->sh_offset,               /* .stabstr offset */
-         elf_sect->sh_size);                           /* .stabstr size */
+                               section_offsets,
+                               mainline,
+                               ei.stabsect->filepos,
+                               bfd_section_size (abfd, ei.stabsect),
+                               str_sect->filepos,
+                               bfd_section_size (abfd, str_sect));
     }
   if (ei.mdebugsect)
     {
index 0a2dc8b2d7a8ca9ad512f53678386875689993ef..d99101910dd94944e7734481b546fb24a60392ba 100644 (file)
@@ -20,9 +20,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
 #include "defs.h"
 #include "bfd.h"
-#include <time.h> /* For time_t in libbfd.h.  */
-#include <sys/types.h> /* For time_t, if not in time.h.  */
-#include "libbfd.h"
 #include "som.h"
 #include "libhppa.h"
 #include <syms.h>