From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 2imWLkmwl2EofQAAWB0awg (envelope-from ) for ; Fri, 19 Nov 2021 09:10:17 -0500 Received: by simark.ca (Postfix, from userid 112) id ADBED1F0CE; Fri, 19 Nov 2021 09:10:17 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 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 2F3E01EE18 for ; Fri, 19 Nov 2021 09:10:17 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 656203857C6F for ; Fri, 19 Nov 2021 14:10:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 656203857C6F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1637331016; bh=yjdf3SOerMuzrrocJR5+cIQA5TuTIiM7hJ+cLGyAZBM=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=kVvJ/UGypI24JjIpP72cT/e55PRoX6kRgh0dSJP2vVxnj0OL6UNu1SdnVfwXG1z6p lt2oHrpMshh1uRwHUngZK0sAqvG5xn7S+O+Kub9G3kF9+f3Fc4Ox6YnC7GXs47++8x C2vfpzePOvnJw/vGinXh/zf/wr6N3eG1udD4l4bM= Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id A6664385780F for ; Fri, 19 Nov 2021 14:08:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A6664385780F 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 D768F2113D; Fri, 19 Nov 2021 14:08:12 +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 C0D8D13B46; Fri, 19 Nov 2021 14:08:12 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id hlXYLcyvl2FTeAAAMHmgww (envelope-from ); Fri, 19 Nov 2021 14:08:12 +0000 Subject: Re: [PATCH] [gdb/testsuite] Fix 64-bit dwarf test-cases with -m32 To: Andreas Schwab References: <20211101175611.32103-1-tdevries@suse.de> <874k8vfvg4.fsf@igel.home> <32e918ff-583b-cc04-4f67-09b160b6d3cb@suse.de> <87a6il0yp7.fsf@igel.home> Message-ID: <5b27d378-9468-e299-8e80-96659c24aa17@suse.de> Date: Fri, 19 Nov 2021 15:08:12 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <87a6il0yp7.fsf@igel.home> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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 Cc: Tom de Vries via Gdb-patches Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 11/3/21 9:30 PM, Andreas Schwab wrote: > On Nov 03 2021, Tom de Vries wrote: > >> On 11/1/21 9:54 PM, Andreas Schwab wrote: >>> On Nov 01 2021, Tom de Vries via Gdb-patches wrote: >>> >>>> When running test-case gdb.dwarf2/loc-sec-offset.exp with target board -m32, >>>> I run into: >>>> ... >>>> builtin_spawn -ignore SIGHUP gcc -fno-stack-protector -m32 \ >>>> -fdiagnostics-color=never -c -o loc-sec-offset-dw641.o \ >>>> loc-sec-offset-dw64.S^M >>>> as: loc-sec-offset-dw641.o: unsupported relocation type: 0x1^M >>>> loc-sec-offset-dw64.S: Assembler messages:^M >>>> loc-sec-offset-dw64.S:29: Error: cannot represent relocation type \ >>>> BFD_RELOC_64^M >>>> ... >>>> >>>> Looking at line 29, we have: >>>> ... >>>> .8byte .Labbrev1_begin /* Abbrevs */ >>>> ... >>>> >>>> It would be nice if the assembler could handle this somehow. But I guess >>>> it's not unreasonable that an assembler for a 32-bit architecture will object >>>> to handling 64-bit labels. >>> >>> Shouldn't the 64-bit dwarf tests just be skipped on 32-bit targets? >> >> Because ? > > Because 32-bit targets have no way to represent 8-byte relocations. > > Andreas. > I tried a hello world with gcc-11, -m32 and -gdwarf64: ... $ gcc-11 ~/hello.c -g -gdwarf64 -m32 -save-temps -dA ... and looked at a section offset: ... .long .Ldebug_line0, 0 # DW_AT_stmt_list ... This comes from dw2_assemble_integer, where we have: ... void dw2_assemble_integer (int size, rtx x) { if (size == 2 * (int) DWARF2_ADDR_SIZE && !CONST_SCALAR_INT_P (x)) { /* On 32-bit targets with -gdwarf64, DImode values with relocations usually result in assembler errors. Assume all such values are positive and emit the relocation only in the least significant half. */ ... So, it seems I chose the same solution as gcc. I'll commit this shortly. Thanks, - Tom