From 9b14d7aa417b709eb41369e33b6652a1961313c9 Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Wed, 11 Nov 2009 04:59:48 +0000 Subject: [PATCH] gdb/ * objfiles.c (objfile_relocate): Update also the field psymtabs_addrmap. gdb/testsuite/ * gdb.dwarf2/dw2-ranges.exp: Call runto_main. --- gdb/ChangeLog | 4 ++++ gdb/objfiles.c | 4 ++++ gdb/testsuite/ChangeLog | 4 ++++ gdb/testsuite/gdb.dwarf2/dw2-ranges.exp | 6 ++++++ 4 files changed, 18 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index af795fb0480..dbc39888bfb 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2009-11-11 Jan Kratochvil + + * objfiles.c (objfile_relocate): Update also the field psymtabs_addrmap. + 2009-11-11 Jan Kratochvil * configure.ac: Call ACX_LARGEFILE. diff --git a/gdb/objfiles.c b/gdb/objfiles.c index 48f26136224..472819061c3 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -680,6 +680,10 @@ objfile_relocate (struct objfile *objfile, struct section_offsets *new_offsets) } } + if (objfile->psymtabs_addrmap) + addrmap_relocate (objfile->psymtabs_addrmap, + ANOFFSET (delta, SECT_OFF_TEXT (objfile))); + { struct partial_symtab *p; diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index f17187d8c3c..b89a23e7020 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2009-11-11 Jan Kratochvil + + * gdb.dwarf2/dw2-ranges.exp: Call runto_main. + 2009-11-09 Keith Seitz * gdb.cp/overload.exp: Add tests for resolving overloaded diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ranges.exp b/gdb/testsuite/gdb.dwarf2/dw2-ranges.exp index 61e1fe431f0..9109030d3b7 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-ranges.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-ranges.exp @@ -55,6 +55,12 @@ gdb_start gdb_reinitialize_dir $srcdir/$subdir gdb_load ${binfile} +# Test also objfile->psymtabs_addrmap relocations for -fPIE -pie builds below. +# On some targets it may possibly fail but the program is being started only +# for the PIE build so try it anyway. + +runto_main + # Correct output: # Line 39 of "../.././gdb/testsuite/gdb.dwarf2/dw2-ranges.S" starts at address 0x4 and ends at 0x8. # Wrong output: -- 2.30.2