aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorBryce McKinlay <mckinlay@redhat.com>2004-05-13 17:30:41 +0000
committerBryce McKinlay <mckinlay@redhat.com>2004-05-13 17:30:41 +0000
commit8edfa9268a4edf0a22389140be2007ce48167352 (patch)
tree6867825479d238a9c437412a4e908559f94f42c6 /gdb
parent723e0e3ddf829646a8309819b947d431dc61d763 (diff)
downloadfsf-binutils-gdb-8edfa9268a4edf0a22389140be2007ce48167352.zip
fsf-binutils-gdb-8edfa9268a4edf0a22389140be2007ce48167352.tar.gz
fsf-binutils-gdb-8edfa9268a4edf0a22389140be2007ce48167352.tar.bz2
2004-05-13 Bryce McKinlay <mckinlay@redhat.com>
* dwarf2loc.c (find_location_expression): Use ANOFFSET to adjust base_address for shared libraries.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/dwarf2loc.c5
2 files changed, 9 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index d3dbedb..d035f95 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2004-05-13 Bryce McKinlay <mckinlay@redhat.com>
+ * dwarf2loc.c (find_location_expression): Use ANOFFSET to adjust
+ base_address for shared libraries.
+
+2004-05-13 Bryce McKinlay <mckinlay@redhat.com>
+
* MAINTAINERS (write after approval): Add myself.
2004-05-13 Ulrich Weigand <uweigand@de.ibm.com>
diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
index ef333f7..cdbeb10 100644
--- a/gdb/dwarf2loc.c
+++ b/gdb/dwarf2loc.c
@@ -53,11 +53,14 @@ static char *
find_location_expression (struct dwarf2_loclist_baton *baton,
size_t *locexpr_length, CORE_ADDR pc)
{
- CORE_ADDR base_address = baton->base_address;
CORE_ADDR low, high;
char *loc_ptr, *buf_end;
unsigned int addr_size = TARGET_ADDR_BIT / TARGET_CHAR_BIT, length;
CORE_ADDR base_mask = ~(~(CORE_ADDR)1 << (addr_size * 8 - 1));
+ /* Adjust base_address for relocatable objects. */
+ CORE_ADDR base_offset = ANOFFSET (baton->objfile->section_offsets,
+ SECT_OFF_TEXT (baton->objfile));
+ CORE_ADDR base_address = baton->base_address + base_offset;
loc_ptr = baton->data;
buf_end = baton->data + baton->size;