From ddb1ed562a784e7dbc93ea587bbb7fe442df64cd Mon Sep 17 00:00:00 2001 From: kevinb Date: Fri, 3 Nov 2000 22:38:38 +0000 Subject: [PATCH] In new_symbol(), relocate symbol address by base address of the section it is in instead of using the base address of the .text section. --- gdb/ChangeLog | 6 ++++++ gdb/dwarf2read.c | 10 ++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index a3d1933b0f..db8a843592 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2000-11-03 Kevin Buettner + + * dwarf2read.c (new_symbol): Relocate address of symbol by the + base address of the section it is in rather than always using + the base address of the .text section. + 2000-11-01 J.T. Conklin * TODO: Note abstraction layer violation where "ocd reset" command diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index d3dba4e74c..c215c9941d 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -4185,7 +4185,10 @@ new_symbol (struct die_info *die, struct type *type, struct objfile *objfile, the variable is referenced. */ if (SYMBOL_VALUE_ADDRESS (sym)) { - SYMBOL_VALUE_ADDRESS (sym) += baseaddr; + fixup_symbol_section (sym, objfile); + SYMBOL_VALUE_ADDRESS (sym) += + ANOFFSET (objfile->section_offsets, + SYMBOL_SECTION (sym)); SYMBOL_CLASS (sym) = LOC_STATIC; } else @@ -4215,8 +4218,11 @@ new_symbol (struct die_info *die, struct type *type, struct objfile *objfile, } else { + fixup_symbol_section (sym, objfile); + SYMBOL_VALUE_ADDRESS (sym) = + addr + ANOFFSET (objfile->section_offsets, + SYMBOL_SECTION (sym)); SYMBOL_CLASS (sym) = LOC_STATIC; - SYMBOL_VALUE_ADDRESS (sym) = addr + baseaddr; } } } -- 2.11.0