From patchwork Mon Mar 27 11:28:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Modra X-Patchwork-Id: 75351 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1434461vqo; Mon, 27 Mar 2023 04:28:31 -0700 (PDT) X-Google-Smtp-Source: AKy350ZExgWAJ7FdloOA3jUBjSJ0EgL0nZkTzVa2IVnanpfXAE/arntNv4gdEfzb89ENu7u1/hPX X-Received: by 2002:a17:907:1628:b0:88f:8a5:b4cd with SMTP id hb40-20020a170907162800b0088f08a5b4cdmr15611057ejc.1.1679916511426; Mon, 27 Mar 2023 04:28:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679916511; cv=none; d=google.com; s=arc-20160816; b=C9YQ/ZVtq3EHsfs8rms+P1junHflIZiVw1XdPhTZL4KOxFtn+Vf5C1iYrj6XRHh+7A R6q9ijmcYr8gV4KLe/VFaO5qzw92OpKPnUQ+d0m43Rao2YMlhLFixczwQCMFwOTbyViX 2U6Wz+sa5U1pB90v0/ruRhq2V7B1IfF8HDrY1bMAYNPZNFW/1FAiE3+7IPQ81g1Knorq DBQ7rxrtur+UH2RkH9KppXI3YItbZdD0ImqbrVuIHshlui/7FEjKr3H/fI6zoyinbgk2 JoRE2moMhY4UydKhKhKaLCzwCPeh0wPpaFHiThTLhC7xg3WKy5I5jjUs88rx4hlNBaLe dw/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-disposition:mime-version:message-id:subject:to:date :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=sytA6sRpPHIE6GK5P7qb6++E1rZDtp84xuuxMVIALAE=; b=1C6pebq1pWoiUtPniJjD0ExquuG6ulhxPWf7WPFKt4kUNbCyh2sYrmh6G7amwPsr7q HId6iDF4e+b2x1K+q0/q06R+WpiK0AGQoujJHZneIxnGEHyv+Kzu5x2qtFITRP7iZSma KDx77ujI7gbEAbemdlF1Kt9Inb80vSZIcIuTw5/Pc0qg+XPVl0BLvHIM8h/YQXro+0vA 6WxJ0q2zDyTl1D3bq60uHGgrZ+Lv5K4cbKcx1vTZGCtDWvxoG+5HMBRbc6ww9zb7x8FN XaOndJ0JghpzmhHm6qESEI064v7cTeDbtMaa9NJVYQq3jhN9nWGJV9vyInkA0uLQX5m8 IsDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=qI5F49Ag; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id tl3-20020a170907c30300b00939ad72ecacsi16321327ejc.225.2023.03.27.04.28.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Mar 2023 04:28:31 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=qI5F49Ag; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 01C703858025 for ; Mon, 27 Mar 2023 11:28:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 01C703858025 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1679916509; bh=sytA6sRpPHIE6GK5P7qb6++E1rZDtp84xuuxMVIALAE=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=qI5F49AgZNytKIopiIW82hftV6Kk86RzikGDSjRnGLkMSHgXanY8NMj6fzcXRxjAz YJBg3rFDRrhLnRZ8SFb/abQOJYF+IUu5Y24+vFogqDe/cUH5K+kvUjlZ1eIbIgXtZ5 v4CvVHzlnumC1qXX4JyHSFwJAAhOOFEHmQIVwyCg= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by sourceware.org (Postfix) with ESMTPS id 0A6893858417 for ; Mon, 27 Mar 2023 11:28:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0A6893858417 Received: by mail-pj1-x102b.google.com with SMTP id f6-20020a17090ac28600b0023b9bf9eb63so8429193pjt.5 for ; Mon, 27 Mar 2023 04:28:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679916500; h=content-disposition:mime-version:message-id:subject:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=sytA6sRpPHIE6GK5P7qb6++E1rZDtp84xuuxMVIALAE=; b=KyE4VNHj2i7ciiMWqTauO2EnqjuG5rdn3uj2NYDjZ0HaokSKZNDhpoDvllXsJQNyzM lFrv+PfSMgLxT50Sm2r5am7Edl2pUG7YFlN5AkaBv//GGuoDhsuP3mjtb4nko12Jmlji GHP1FIxMYR8mzc4eI81UbdOBgPmKUxnS4PM24K25XMC6Vdbb+HIUwU5irrI0J5rTWkrg XRLbQgkx9SP37f8q7fXeyuFXNS6vBAvVlgFT3Qg9VEUD8Uv8QyzL2tMpglnuJtHQ5L1Z +SyrgXAhz2IU4XHdXOCRZEwUmX0oAsOnEEmTCXO9+Gu8qXIdKtCDMZs5GB4OOKOPv3os AXdA== X-Gm-Message-State: AAQBX9fus+kE2/tnjy2hcLkiCl6rS+XZ+P5yxMr7NLbtqcKoNurhibgV XGEqc0rdItQMU8Q4uwBH/cELviOUykY= X-Received: by 2002:a17:902:f203:b0:1a0:67fb:445c with SMTP id m3-20020a170902f20300b001a067fb445cmr7913540plc.28.1679916499947; Mon, 27 Mar 2023 04:28:19 -0700 (PDT) Received: from squeak.grove.modra.org ([2406:3400:51d:8cc0:1b0:13cb:4f4d:735]) by smtp.gmail.com with ESMTPSA id l6-20020a170902d34600b00198d7b52eefsm18883952plk.257.2023.03.27.04.28.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Mar 2023 04:28:19 -0700 (PDT) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id 4B1BC114276F; Mon, 27 Mar 2023 21:58:17 +1030 (ACDT) Date: Mon, 27 Mar 2023 21:58:17 +1030 To: binutils@sourceware.org Subject: Set proper union selector tag Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-3034.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Alan Modra via Binutils From: Alan Modra Reply-To: Alan Modra Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761520136094805974?= X-GMAIL-MSGID: =?utf-8?q?1761520136094805974?= * coff-bfd.c (bfd_coff_get_auxent): After converting sym pointer to an index, reset the union tag. diff --git a/bfd/coff-bfd.c b/bfd/coff-bfd.c index 068ecebc8df..9660b6b14e5 100644 --- a/bfd/coff-bfd.c +++ b/bfd/coff-bfd.c @@ -82,19 +82,28 @@ bfd_coff_get_auxent (bfd *abfd, *pauxent = ent->u.auxent; if (ent->fix_tag) - pauxent->x_sym.x_tagndx.l = - ((combined_entry_type *) pauxent->x_sym.x_tagndx.p - - obj_raw_syments (abfd)); + { + pauxent->x_sym.x_tagndx.l = + ((combined_entry_type *) pauxent->x_sym.x_tagndx.p + - obj_raw_syments (abfd)); + ent->fix_tag = 0; + } if (ent->fix_end) - pauxent->x_sym.x_fcnary.x_fcn.x_endndx.l = - ((combined_entry_type *) pauxent->x_sym.x_fcnary.x_fcn.x_endndx.p - - obj_raw_syments (abfd)); + { + pauxent->x_sym.x_fcnary.x_fcn.x_endndx.l = + ((combined_entry_type *) pauxent->x_sym.x_fcnary.x_fcn.x_endndx.p + - obj_raw_syments (abfd)); + ent->fix_end = 0; + } if (ent->fix_scnlen) - pauxent->x_csect.x_scnlen.l = - ((combined_entry_type *) pauxent->x_csect.x_scnlen.p - - obj_raw_syments (abfd)); + { + pauxent->x_csect.x_scnlen.l = + ((combined_entry_type *) pauxent->x_csect.x_scnlen.p + - obj_raw_syments (abfd)); + ent->fix_scnlen = 0; + } return true; }