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/objfiles.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/objfiles.c')
-rw-r--r-- | gdb/objfiles.c | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/gdb/objfiles.c b/gdb/objfiles.c index 060409d..30a0aad 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -26,6 +26,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "symtab.h" #include "symfile.h" #include "objfiles.h" +#include "gdb-stabs.h" #include <sys/types.h> #include <sys/stat.h> @@ -474,9 +475,35 @@ objfile_relocate (objfile, new_offsets) } { + struct partial_symtab *p; + + ALL_OBJFILE_PSYMTABS (objfile, p) + { + p->textlow += ANOFFSET (delta, SECT_OFF_TEXT); + p->texthigh += ANOFFSET (delta, SECT_OFF_TEXT); + } + } + + { + struct partial_symbol *psym; + + for (psym = objfile->global_psymbols.list; + psym < objfile->global_psymbols.next; + psym++) + if (SYMBOL_SECTION (psym) >= 0) + SYMBOL_VALUE_ADDRESS (psym) += ANOFFSET (delta, SYMBOL_SECTION (psym)); + for (psym = objfile->static_psymbols.list; + psym < objfile->static_psymbols.next; + psym++) + if (SYMBOL_SECTION (psym) >= 0) + SYMBOL_VALUE_ADDRESS (psym) += ANOFFSET (delta, SYMBOL_SECTION (psym)); + } + + { struct minimal_symbol *msym; ALL_OBJFILE_MSYMBOLS (objfile, msym) - SYMBOL_VALUE_ADDRESS (msym) += ANOFFSET (delta, SYMBOL_SECTION (msym)); + if (SYMBOL_SECTION (msym) >= 0) + SYMBOL_VALUE_ADDRESS (msym) += ANOFFSET (delta, SYMBOL_SECTION (msym)); } { |