mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2025-01-13 11:34:20 +08:00
456ba0fa36
When running gdb.dwarf2/multidictionary.exp with target board cc-with-dwz and current dwz, we run into a dwz abort: ... gdb compile failed, gdb/contrib/cc-with-tweaks.sh: line 188: 11484 Aborted \ (core dumped) $DWZ "$output_file" > /dev/null 2>&1 UNTESTED: gdb.dwarf2/multidictionary.exp: multidictionary.exp ... The dwz abort (PR dwz/24169) is caused by an invalid DW_FORM_ref_addr in the multidictionary binary. The multidictionary binary is build from multidictionary.S which is generated using the dwarf assembler, and multidictionary.S contains dwarf for 3 compilation units. In multidictionary0.o (generated from multidictionary.S), we find a concrete formal parameter DIE: ... <2><dc>: Abbrev Number: 4 (DW_TAG_formal_parameter) <dd> DW_AT_abstract_origin: <0xa6> ... referring to an abstract formal parameter DIE at 0xa6: ... <2><a6>: Abbrev Number: 8 (DW_TAG_formal_parameter) <a7> DW_AT_name : msg <ab> DW_AT_type : <0x92> ... but in the multidictionary binary the concrete formal parameter DIE is still referring to 0xa6: ... <2><1a3>: Abbrev Number: 4 (DW_TAG_formal_parameter) <1a4> DW_AT_abstract_origin: <0xa6> ... while the abstract formal parameter DIE has moved to 0x16d: ... <2><16d>: Abbrev Number: 8 (DW_TAG_formal_parameter) <16e> DW_AT_name : msg <172> DW_AT_type : <0x159> ... The concrete formal parameter DIE is specified in multidictionary.S like this: ... .Llabel21: .uleb128 4 .4byte .Llabel17 - .Lcu1_begin ... The problem is that the .Lcu1_begin label is assumed to mark the start of the .debug_info section in the executable, but in fact it marks the start of the first compilation unit from multidictionary.S in the executable. Usually these two entities are the same, but they are not when linked in object files contain dwarf info and are placed in the .debug_info section before the compilation units generated from multidictionary.S. Fix this in the dwarf assembler by generating instead the label itself: ... .Llabel21: .uleb128 4 .4byte .Llabel17 ... resulting in a relocation in the object file: ... Offset Info Type Sym. Value Sym. Name + Addend 0000000000dd 00040000000a R_X86_64_32 0000000000000000 .debug_info + a6 ... and resulting in the correct offset in the executable: ... <2><1a3>: Abbrev Number: 4 (DW_TAG_formal_parameter) <1a4> DW_AT_abstract_origin: <0x16d> ... Tested on x86_64-linux with native and cc-with-dwz. gdb/testsuite/ChangeLog: 2019-05-07 Tom de Vries <tdevries@suse.de> PR testsuite/24159 * lib/dwarf.exp: Fix handling of DW_FORM_ref_addr. |
||
---|---|---|
.. | ||
ada.exp | ||
append_gdb_boards_dir.exp | ||
build-piece.exp | ||
cache.exp | ||
cell.exp | ||
cl_util.c | ||
cl_util.h | ||
compile-support.exp | ||
compiler.c | ||
compiler.cc | ||
completion-support.exp | ||
cp-support.exp | ||
d-support.exp | ||
data-structures.exp | ||
dtrace.exp | ||
dwarf.exp | ||
fortran.exp | ||
future.exp | ||
gdb-guile.exp | ||
gdb-python.exp | ||
gdb-utils.exp | ||
gdb.exp | ||
gdbserver-support.exp | ||
gen-perf-test.exp | ||
go.exp | ||
memory.exp | ||
mi-support.exp | ||
objc.exp | ||
opencl_hostapp.c | ||
opencl_kernel.cl | ||
opencl.exp | ||
pascal.exp | ||
pdtrace.in | ||
perftest.exp | ||
prelink-support.exp | ||
prompt.exp | ||
range-stepping-support.exp | ||
read1.c | ||
rust-support.exp | ||
selftest-support.exp | ||
set_unbuffered_mode.c | ||
trace-support.exp | ||
unbuffer_output.c | ||
valgrind.exp |