From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id YeGxJo3+2Go+SwcAWB0awg (envelope-from ) for ; Wed, 21 Oct 2026 14:03:57 -0400 Authentication-Results: simark.ca; dkim=fail reason="signature verification failed" (768-bit key; unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=IzxY7qkT; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 87A911E051; Wed, 21 Oct 2026 14:03:57 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_BL_SPAMCOP_NET, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=no autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id D26FD1E04D for ; Wed, 21 Oct 2026 14:03:55 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 410924BA23E3 for ; Wed, 21 Oct 2026 18:03:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 410924BA23E3 Authentication-Results: sourceware.org; dkim=fail reason="signature verification failed" (768-bit key, unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=IzxY7qkT Received: from omta38.uswest2.a.cloudfilter.net (omta38.uswest2.a.cloudfilter.net [35.89.44.37]) by sourceware.org (Postfix) with ESMTPS id 2EEBC4BA23C2 for ; Wed, 21 Oct 2026 18:03:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2EEBC4BA23C2 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 2EEBC4BA23C2 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=35.89.44.37 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1792605808; cv=none; b=VT1qec7maIJ65ptUSWh0SKkolnJbVA820u0+sO+FkqWxIdGXdGqBOMgaVAzMeudliIu44ynTFlA7rXQOcKaF8ixqQVqXAZn5/Kb5ZoS+HpDagBg/Jpq2H99W2RPkGVp8AYSL0Bux3AMBkAdFy1NUHO+e7caUD48PSP1oYflrPNg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1792605808; c=relaxed/simple; bh=3RwTBS6OBoRKOzHpyfCwZdAmN6grZC/o+3FqKFX9b9c=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=dFekKRBI7YPboWm57WJd6Weu94mRZ4SJx6C3YFcMVtilhyOOYmOu3omNBc9M27NKld/Fr/13LwN6NpM/qW8mxSKXeQihZst/OZKZjfPJkhp7SpmwQa2CCzBdiZAPc+3UGsZruuWy6vvlUgiQKn11HwRp6QNXb0vhUzPo4UWsUpU= ARC-Authentication-Results: i=1; sourceware.org; dkim=policy (768-bit key, unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=IzxY7qkT reason="signing key too small" DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2EEBC4BA23C2 Received: from eig-obgw-6006b.ext.cloudfilter.net ([10.0.30.211]) by cmsmtp with ESMTPS id JZoUxYWffv0ndJaesxYwCI; Wed, 21 Oct 2026 18:03:26 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id Jaerx8dKobhSyJaerxETzg; Wed, 21 Oct 2026 18:03:26 +0000 X-Authority-Analysis: v=2.4 cv=IJECChvG c=1 sm=1 tr=0 ts=6ad8fe6e a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=660iZSQnnn4A:10 a=ItBw4LHWJt0A:10 a=T_Alst9gAAAA:8 a=zstS-IiYAAAA:8 a=aDu_2anLyMsFs5jmWjgA:9 a=DvZ5ixILWSEuw56YIEpp:22 a=4G6NA9xxw8l3yy4pmD5M:22 a=DCx65vhANUyCzuf5D8fC:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To :Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Unsubscribe-Post: List-Subscribe:List-Post:List-Owner:List-Archive; bh=X/8OJUxAxr22h4vYvEnqwFtSArOMHZYpWFvT1QpEtY8=; b=IzxY7qkT9Sehmi/qjQ4afngyz8 iSpIDeTgNlZ/WexqJHjf1DfB10fTDZGMsQAA2zh5lctoPSzg5AGA5qnR6bnPCRaSY9JStV+qqspeI 53Jz3M1x6tEstHos7Bk4pxeDM; Received: from 97-122-110-129.hlrn.qwest.net ([97.122.110.129]:43788 helo=bapiya) by box5379.bluehost.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.100.1) (envelope-from ) id 1xJaer-00000004N9A-1NZz; Wed, 21 Oct 2026 12:03:25 -0600 From: Tom Tromey To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 16/27] gdb/coffread: Don't relocate absolute symbols In-Reply-To: <20260723130118.206735-17-pedro@palves.net> (Pedro Alves's message of "Thu, 23 Jul 2026 14:01:07 +0100") References: <20260723130118.206735-1-pedro@palves.net> <20260723130118.206735-17-pedro@palves.net> X-Attribution: Tom Date: Wed, 21 Oct 2026 12:03:24 -0600 Message-ID: <87mrs7x76b.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 97.122.110.129 X-Source-L: No X-Exim-ID: 1xJaer-00000004N9A-1NZz X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-110-129.hlrn.qwest.net (bapiya) [97.122.110.129]:43788 X-Source-Auth: tom+tromey.com X-Email-Count: 2 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfO6J/c7WjOTlxK4+LTIn7myA2WjlUpa4h2yjqecgJjoOawe6ybeeE2q/DPqZkC1KbMiEAW/IfD5pSXzOc+KRoKG1kumXc5oi06b+hlVcb0fg0QrtCSxD T7EFl/6BYboKZE4vPZHlVjWiStQMW7g+/ArvOiuDywDbG/Ct3n8+r5Rh5sFFNLaghSeb466MGRR/9jeLgh+iJMYJLG5DyIlWhn8= X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org >>>>> "Pedro" == Pedro Alves writes: Pedro> gdb/coffread.c records absolute symbols as mst_abs, which is correct, Pedro> but it derives the symbol's section from cs_to_section, which in turn Pedro> asks cs_to_bfd_section for the BFD section. cs_to_bfd_section matches Pedro> by section number and finds nothing for an N_ABS symbol, returning Pedro> NULL, so cs_to_section falls back to the text section. The symbol Pedro> then inherits the text section's relocation offset (the DLL's load Pedro> bias) and its value is wrongly shifted by that amount. Pedro> Fix this in cs_to_bfd_section, by returning BFD's absolute section for Pedro> an N_ABS symbol rather than NULL. Its relocation offset is always Pedro> zero, so the symbol's value is left untouched, matching what Pedro> elf_symtab_read does for absolute ELF symbols. cs_to_section then Pedro> naturally returns the absolute section's index. I think this seems totally fine, but note there's also a different hack for this kind of thing, namely gdb_bfd_section_index. Though looking that up again I think it's not directly relevant here. I wonder sometimes if gdb could use BFD a bit more, like remove a lot of this per-format minsym processing in favor of just reusing BFD symbols somehow. Approved-By: Tom Tromey Tom