aboutsummaryrefslogtreecommitdiff
path: root/gdb/symfile.c
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2002-04-22 10:19:35 +0000
committerJoel Brobecker <brobecker@gnat.com>2002-04-22 10:19:35 +0000
commit0e931cf0eed83e9af7fe3eaf10de174d98c93bc0 (patch)
tree08a679766ad2cab9e3177d783c53858dda89d06f /gdb/symfile.c
parente2f6d8e5e4989f5b1d93ec36896878d070baacff (diff)
downloadgdb-0e931cf0eed83e9af7fe3eaf10de174d98c93bc0.zip
gdb-0e931cf0eed83e9af7fe3eaf10de174d98c93bc0.tar.gz
gdb-0e931cf0eed83e9af7fe3eaf10de174d98c93bc0.tar.bz2
* symfile.h (get_section_index): Define.
* symfile.c (get_section_index): New function. * mdebugread.c (SC_IS_SBSS): New macro. (SC_IS_BSS): Return true for the scBss storage class only, as the scSBss storage class refers to the .sbss section. (parse_partial_symbols): Discard the symbols which associated section does not exist. Make sure to use the .sbss section index for symbols which storage class is scBss, rather than using the .bss section index.
Diffstat (limited to 'gdb/symfile.c')
-rw-r--r--gdb/symfile.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gdb/symfile.c b/gdb/symfile.c
index d2d4e62..2671770 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -120,6 +120,8 @@ static void cashier_psymtab (struct partial_symtab *);
bfd *symfile_bfd_open (char *);
+int get_section_index (struct objfile *, char *);
+
static void find_sym_fns (struct objfile *);
static void decrement_reading_symtab (void *);
@@ -1115,6 +1117,18 @@ symfile_bfd_open (char *name)
return (sym_bfd);
}
+/* Return the section index for the given section name. Return -1 if
+ the section was not found. */
+int
+get_section_index (struct objfile *objfile, char *section_name)
+{
+ asection *sect = bfd_get_section_by_name (objfile->obfd, section_name);
+ if (sect)
+ return sect->index;
+ else
+ return -1;
+}
+
/* Link a new symtab_fns into the global symtab_fns list. Called on gdb
startup by the _initialize routine in each object file format reader,
to register information about each format the the reader is prepared