aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2read.c
diff options
context:
space:
mode:
authorKevin Buettner <kevinb@redhat.com>2000-11-03 22:38:38 +0000
committerKevin Buettner <kevinb@redhat.com>2000-11-03 22:38:38 +0000
commita275699e3adcd25657fb93e3075c3cda0c378541 (patch)
tree12ce162a40b04e5f66ded8836ce34ce414062f5e /gdb/dwarf2read.c
parent4930751aaeebf663e6ce45c683b1653b2c60a68b (diff)
downloadgdb-a275699e3adcd25657fb93e3075c3cda0c378541.zip
gdb-a275699e3adcd25657fb93e3075c3cda0c378541.tar.gz
gdb-a275699e3adcd25657fb93e3075c3cda0c378541.tar.bz2
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.
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r--gdb/dwarf2read.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index d3dba4e..c215c99 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;
}
}
}