aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2loc.c
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>2016-05-12 09:20:57 -0700
committerDoug Evans <dje@google.com>2016-05-12 09:24:24 -0700
commit8ddd5a6cd692ca8c4041d9fb64cbb4e0585d4aa1 (patch)
treea6d62b40f39d4f951aa6031ca27b51f720b859ce /gdb/dwarf2loc.c
parent58c7f094c0093a7773e939938f22a9a063c4b9a8 (diff)
downloadfsf-binutils-gdb-8ddd5a6cd692ca8c4041d9fb64cbb4e0585d4aa1.zip
fsf-binutils-gdb-8ddd5a6cd692ca8c4041d9fb64cbb4e0585d4aa1.tar.gz
fsf-binutils-gdb-8ddd5a6cd692ca8c4041d9fb64cbb4e0585d4aa1.tar.bz2
PR symtab/19999 gdb unable to resolve vars with fission+PIE
gdb/ChangeLog: * dwarf2loc.c (dwarf2_find_location_expression): For DWO files still add base_offset. gdb/testsuite/ChangeLog: * lib/dwarf.exp (build_executable_from_fission_assembler): Pass $options when building executable. * gdb.dwarf2/fission-loclists-pie.c: New file. * gdb.dwarf2/fission-loclists-pie.exp: New file.
Diffstat (limited to 'gdb/dwarf2loc.c')
-rw-r--r--gdb/dwarf2loc.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
index ba6ed42..bfe1173 100644
--- a/gdb/dwarf2loc.c
+++ b/gdb/dwarf2loc.c
@@ -255,9 +255,15 @@ dwarf2_find_location_expression (struct dwarf2_loclist_baton *baton,
}
/* Otherwise, a location expression entry.
- If the entry is from a DWO, don't add base address: the entry is
- from .debug_addr which has absolute addresses. */
- if (! baton->from_dwo)
+ If the entry is from a DWO, don't add base address: the entry is from
+ .debug_addr which already has the DWARF "base address". We still add
+ base_offset in case we're debugging a PIE executable. */
+ if (baton->from_dwo)
+ {
+ low += base_offset;
+ high += base_offset;
+ }
+ else
{
low += base_address;
high += base_address;