From 97b3f4e86f7a25e0767487d72cb3977fd653b5bc Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Mon, 29 Nov 2021 09:51:10 +0100 Subject: [PATCH] [gdb/testsuite] Fix gdb.dwarf2/dw2-lines.exp with -m32 When running test-case gdb.dwarf2/dw2-lines.exp with target board -unix/-m32, we run into another instance of PR28383, where the dwarf assembler generates 64-bit relocations which are not supported by the 32-bit assembler: ... dw2-lines-dw.S: Assembler messages:^M outputs/gdb.dwarf2/dw2-lines/dw2-lines-dw.S:76: Error: \ cannot represent relocation type BFD_RELOC_64^M ... Fix this by using _op_offset in _line_finalize_header. Tested on x86_64-linux. --- gdb/testsuite/lib/dwarf.exp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/gdb/testsuite/lib/dwarf.exp b/gdb/testsuite/lib/dwarf.exp index cbb1bf6985a..94f67652e19 100644 --- a/gdb/testsuite/lib/dwarf.exp +++ b/gdb/testsuite/lib/dwarf.exp @@ -2349,11 +2349,7 @@ namespace eval Dwarf { string_ptr: _op .ascii [_quote $dirname] } - if { $_line_is_64 } { - _op .8byte $string_ptr - } else { - _op .4byte $string_ptr - } + _op_offset [expr $_line_is_64 ? 8 : 4] $string_ptr } } } @@ -2398,11 +2394,7 @@ namespace eval Dwarf { string_ptr: _op .ascii [_quote $filename] } - if { $_line_is_64 } { - _op .8byte $string_ptr - } else { - _op .4byte $string_ptr - } + _op_offset [expr $_line_is_64 ? 8 : 4] $string_ptr } } _op .uleb128 $diridx -- 2.30.2