From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id rwxwOjDmR2NEmAsAWB0awg (envelope-from ) for ; Thu, 13 Oct 2022 06:19:28 -0400 Received: by simark.ca (Postfix, from userid 112) id E2BD41E112; Thu, 13 Oct 2022 06:19:28 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=NJzmPBE9; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 5B6191E0CB for ; Thu, 13 Oct 2022 06:19:28 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3179E385084C for ; Thu, 13 Oct 2022 10:19:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3179E385084C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1665656367; bh=D9ypb54QRU7U10HDoUULdKF7pHc6KrLcqkwC4LWDOZQ=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=NJzmPBE97DOlMd0GWGpxCmWmepDGoWB8sPzx3v+i5DCmonX02Tk4uRwM/dl2Rk/Ak dc3iiQgHJfG0jJBN34obsMjmlo4zPtyncAGdlcTZ45hwJGgOb5PVGWQpVUjwtI6KZ4 ydjaCkDU9dSlsrv/U7+F1WWZf6iX/ijaFlk1T+pM= Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by sourceware.org (Postfix) with ESMTPS id 0F83E3860775 for ; Thu, 13 Oct 2022 10:19:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0F83E3860775 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 4CD4E21BE6 for ; Thu, 13 Oct 2022 10:19:05 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 2EE6E139F3 for ; Thu, 13 Oct 2022 10:19:05 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id VjDuCRnmR2NNMQAAMHmgww (envelope-from ) for ; Thu, 13 Oct 2022 10:19:05 +0000 Date: Thu, 13 Oct 2022 12:19:03 +0200 To: gdb-patches@sourceware.org Subject: [committed][gdb/testsuite] Fix gdb.dwarf2/macro-source-path.exp with -m32 Message-ID: <20221013101900.GA25490@delia.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Tom de Vries via Gdb-patches Reply-To: Tom de Vries Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Hi, With test-case gdb.dwarf2/macro-source-path.exp and target board unix/-m32, I run into: ... as: macro-source-path-gcc11-ld238-dw5-filename-641.o: \ unsupported relocation type: 0x1^M ... The problem is that we have 64-bit dwarf so the debug_line offset in the .debug_macro section is an 8-byte entity, emitted using ".8byte": ... .section .debug_macro .Lcu_macros4: .2byte 5 /* version */ .byte 3 /* flags */ .8byte .LLlines3 /* debug_line offset */ ... but the linker doesn't support 8-byte relocation types on a 32-bit architecture. This is similar to what was fixed in commit a5ac8e7fa3b ("[gdb/testsuite] Fix 64-bit dwarf test-cases with -m32") for for instance .debug_abbrev. Fix this in the same way, by using _op_offset to emit the debug_line offset. Tested on x86_64-linux with native and target board unix/-m32. Committed to trunk. Thanks, - Tom [gdb/testsuite] Fix gdb.dwarf2/macro-source-path.exp with -m32 --- gdb/testsuite/lib/dwarf.exp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/gdb/testsuite/lib/dwarf.exp b/gdb/testsuite/lib/dwarf.exp index b85ec290299..586c98ececc 100644 --- a/gdb/testsuite/lib/dwarf.exp +++ b/gdb/testsuite/lib/dwarf.exp @@ -2224,11 +2224,8 @@ namespace eval Dwarf { _op .byte $flags "flags" if { ${debug-line-offset-label} != "" } { - if { ${is-64} } { - _op .8byte ${debug-line-offset-label} "debug_line offset" - } else { - _op .4byte ${debug-line-offset-label} "debug_line offset" - } + _op_offset [expr ${is-64} ? 8 : 4] ${debug-line-offset-label} \ + "debug_line offset" } with_override Dwarf::define Dwarf::_macro_unit_define {