diff options
author | Ian Lance Taylor <ian@airs.com> | 1993-09-21 21:21:35 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1993-09-21 21:21:35 +0000 |
commit | 610a7e7458b46449c5cdedd48079ed974dd5683a (patch) | |
tree | 27cef6a12bdbeca44d24cf8d87b5360ae3ebd4ab /gdb/elfread.c | |
parent | 89709d42cb37bb82209954709939fdf2c2afc519 (diff) | |
download | gdb-610a7e7458b46449c5cdedd48079ed974dd5683a.zip gdb-610a7e7458b46449c5cdedd48079ed974dd5683a.tar.gz gdb-610a7e7458b46449c5cdedd48079ed974dd5683a.tar.bz2 |
* elfread.c (record_minimal_symbol_and_info): Guess the section to
use from the type.
* objfiles.c: Include gdb-stabs.h for SECT_* macros.
(objfile_relocate): Relocate textlow and texthigh in psymtabs.
Relocate partial symbols. Check that minimal SYMBOL_SECTION is
nonnegative before using it.
* symtab.h: Adjust section field comment.
Diffstat (limited to 'gdb/elfread.c')
-rw-r--r-- | gdb/elfread.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/gdb/elfread.c b/gdb/elfread.c index fc74813..5112e51 100644 --- a/gdb/elfread.c +++ b/gdb/elfread.c @@ -173,8 +173,31 @@ record_minimal_symbol_and_info (name, address, ms_type, info, objfile) char *info; /* FIXME, is this really char *? */ struct objfile *objfile; { + int section; + + /* Guess the section from the type. This is likely to be wrong in + some cases. */ + switch (ms_type) + { + case mst_text: + case mst_file_text: + section = SECT_OFF_TEXT; + break; + case mst_data: + case mst_file_data: + section = SECT_OFF_DATA; + break; + case mst_bss: + case mst_file_bss: + section = SECT_OFF_BSS; + break; + default: + section = -1; + break; + } + name = obsavestring (name, strlen (name), &objfile -> symbol_obstack); - prim_record_minimal_symbol_and_info (name, address, ms_type, info, -1); + prim_record_minimal_symbol_and_info (name, address, ms_type, info, section); } /* |