From patchwork Thu Oct 1 15:28:56 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Remus X-Patchwork-Id: 145111 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 34A2C4BB58A3 for ; Thu, 1 Oct 2026 15:29:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 34A2C4BB58A3 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=gHe7V//f X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 751464BAE7E9 for ; Thu, 1 Oct 2026 15:29:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 751464BAE7E9 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linux.ibm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 751464BAE7E9 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=148.163.156.1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1790868551; cv=none; b=WVPS62gFYtEaUQgjKq8i2on5IRSpiPA8x94b11V6/WWo30KOgIQa3me8neXZ4clruEO0EjwaKlAFjc6U9cWIfUU1ulizpupISbFlREhOopWfz8QVIed5+MMQ+dbWedAUNtPgGeZ0sZt0WphomvoXQk3KmEoKDNivK+L4BaGwTnI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1790868551; c=relaxed/simple; bh=aMfrtpJfBOiXKmBbBBiTd4B9RwqjV9I8XH/PnCjOsA0=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=ARO3jt+UVHAFrPHzSmOUCfxAyBlRuG14Hl4K5W3uQISzMrxdaL1fhplDnwk5ASZMSu3MXT/JpwSsJ6eJT/HtkRqAhxAhkHWWwu73UcDIcCqrL68ENFrkFUlxjg0a4QBNY00G4M3Uba98xKR7N92Y182mCsVYmbDHNyHhOUFORMU= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=gHe7V//f DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 751464BAE7E9 Received: from pps.filterd (m0356517.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 691Dar4L1887560; Thu, 1 Oct 2026 15:29:01 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=1ZFDGlvtUewgHiUof S4+iVR8+Neqn+kGS/blfJ0CSo8=; b=gHe7V//fhBQPn/gw3fqjJuBB+VK6pwB5o vcwouf9KgUgYXVhwPymLVCPkM2sjB8eNdGSM9emsUG41DNRBVVFYmA7RbxwMuBjp MO0rhz2QN/+4hD6GcTaMlSyD51kQUZCaIxI+zNU6Agz1l9jMAsZWPo9oJmnRFqeP 6YUIbwEdt1XeUeL5WJXVHOra6WKjSNa7QoC3bwb2e7V8S7E3fTrC84wJpmcEr8yk TjU0x8FCOpHiyatRKaNkmwUyaCKV/lt0cSPycPexD5YEMzsGB+Ug6mPF5xt8uMrj 7lWwZm8CazbqauG8j6TEYKvzQpQfNDcspN7OI78XM2L54/N06DmKQ== Received: from ppma22.wdc07v.mail.ibm.com (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4gx5s5m1eb-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 01 Oct 2026 15:29:01 +0000 (GMT) Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.18.1.11/8.18.1.11) with ESMTP id 691E2hO11000234; Thu, 1 Oct 2026 15:29:00 GMT Received: from smtprelay04.fra02v.mail.ibm.com ([9.218.2.228]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4h0xcsejrw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 01 Oct 2026 15:28:59 +0000 (GMT) Received: from smtpav05.fra02v.mail.ibm.com (smtpav05.fra02v.mail.ibm.com [10.20.54.104]) by smtprelay04.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 691FSwuM6947276 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 1 Oct 2026 15:28:58 GMT Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D1F382004F; Thu, 1 Oct 2026 15:28:57 +0000 (GMT) Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A62E92006A; Thu, 1 Oct 2026 15:28:57 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.87.85.9]) by smtpav05.fra02v.mail.ibm.com (Postfix) with ESMTP; Thu, 1 Oct 2026 15:28:57 +0000 (GMT) From: Jens Remus To: binutils@sourceware.org, Richard Earnshaw , Alice Carlotti , Chenghua Xu , Zhensong Liu , Palmer Dabbelt , Andrew Waterman , Jim Wilson , Nelson Chu , Kito Cheng Cc: Jens Remus Subject: [PATCH v2 1/3] aarch64: Fix h->got union phase confusion for DT_RELR Date: Thu, 1 Oct 2026 17:28:56 +0200 Message-ID: <20261001152854.3367296-6-jremus@linux.ibm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261001152854.3367296-5-jremus@linux.ibm.com> References: <20261001152854.3367296-5-jremus@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Reinject: loops=2 maxloops=12 X-Proofpoint-Spam-Info: AW1haW4tMjYxMDAxMDA2MCBTYWx0ZWRfX71wSG3msKHgV oJgT9j8hDRxbleQkaF0uxBt3Fqf+lgSFjENlSeeUd0Yic4G2T38mmpURJVA5biyUgd1ppLSD5bS Wm/3qVjW8XIhkrtMhogQ8iYUIxxKTP4= X-Authority-Analysis: v=2.4 cv=HJ5WhYtv c=1 sm=1 tr=0 ts=6abe7c3d cx=c_pps a=5BHTudwdYE3Te8bg5FgnPg==:117 a=5BHTudwdYE3Te8bg5FgnPg==:17 a=660iZSQnnn4A:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=U7nrCbtTmkRpXpFmAIza:22 a=VnNF1IyMAAAA:8 a=Zxp1udWUC5FwEj-EubUA:9 X-Proofpoint-GUID: ylE_0D5PJ3Z2qXA4udplGTE8BXvuba3C X-Proofpoint-ORIG-GUID: Oxjs3CvIdbMJFSZyR89IlevbhQvdEsiQ X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMDAxMDA2MCBTYWx0ZWRfX348Qa2z+veD9 7nyfcC/jBaJKLSbNfFTAbKGIwieJXlyiR6LG3UQ9U1XE3w+t/SsuFiItzRJ5I8J7Zp5b0Ez3Chu lwzHjIetvIcbmuV+6LZGY7ar2Wx5ZnoIEUpjXZwM6Cn18Iw2cQXmf9g1WaKS0d14qKXxlyJqK7a 5NH1qCPvVKPvduCdzJ0MmPIpaZata2vidbC4WPEeb5dyuTU4DU/mvcZT3uP9NaBYcSt0VHjk7aG hMiyLOQsznDibfUSIpcc9EVRwnQuW0N8zFwwoygXOk6r6Icyfk478dY+l4GUMdDTBbxTDEWtDxt 6+Nj4P8tpLZq64AWCZly4CDSCxBM+Q8jIQRrhZQ4xChuCguD51h23LhEN1OXXZBj7jhywyfI1c6 W5gLbY+RadHPXxjnlomfi/AqwFgU7Y/u9rR3QPrwA6VB3HgW5mFo8nb/q9sQEoC7OkP0XZfKdQG JfDb+Btvbd6Gpjd0l3A== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-10-01_04,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 suspectscore=0 bulkscore=0 clxscore=1015 lowpriorityscore=0 spamscore=0 impostorscore=0 phishscore=0 priorityscore=1501 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2610010060 X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: binutils-bounces~patchwork=sourceware.org@sourceware.org record_relr_dyn_got_relocs is called after allocate_dynrelocs has repurposed h->got from refcount to offset semantics. This goes along with a change in indication for no GOT entry allocated from h->got.refcount <= 0 to h->got.offset == (bfd_vma)-1. bfd/ * elfnn-aarch64.c (record_relr_dyn_got_relocs): Fix h->got union phase confusion. Signed-off-by: Jens Remus --- bfd/elfnn-aarch64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c index ce060dd755b9..c89390e69493 100644 --- a/bfd/elfnn-aarch64.c +++ b/bfd/elfnn-aarch64.c @@ -9246,7 +9246,7 @@ record_relr_dyn_got_relocs (struct elf_link_hash_entry *h, void *inf) h = (struct elf_link_hash_entry *) h->root.u.i.link; if (h->type == STT_GNU_IFUNC && h->def_regular) return true; - if (h->got.refcount <= 0) + if (h->got.offset == (bfd_vma) -1) return true; if (elf_aarch64_hash_entry (h)->got_type != GOT_NORMAL) return true; From patchwork Thu Oct 1 15:28:57 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Remus X-Patchwork-Id: 145113 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 88A3C4B920D4 for ; Thu, 1 Oct 2026 15:30:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 88A3C4B920D4 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=AqdgLOUl X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id AEF384BB588F for ; Thu, 1 Oct 2026 15:29:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AEF384BB588F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linux.ibm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org AEF384BB588F Authentication-Results: sourceware.org; arc=none smtp.remote-ip=148.163.156.1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1790868552; cv=none; b=Bn/HqsCveIOkHbOCCBp43GdCXoedeXI043DLH/gSSGXy60QLH4kH2GGytpEDQoAirmhHlwpmu98fUxFfLf6Zco7HGoTsDRDQaQKM11SpXrVRoJzZ4JscsnzxXe9APEohL5Hrt/X22kyLXpRslCC+yhv4l7Dapitt4FQZROG+s5A= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1790868552; c=relaxed/simple; bh=svyZaLob55esyklBLyiHmkq732bUfPIW2V9RDOaRsFM=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=XzWgW0BkMnY8cRbOVTIio/TCiUidVQHYAbxydMjo4EFNPZD/iVHKDE7k4FaAHYQsukuSdcPLyhO6Ejh8gmSYM1bqwaz02CsirJk2am2IQ991PeHUCZT/zG/MQSP5lUOzeogPoKGUfQ0l1v1dNF+OSYb152b+INKDYO9VEg59Xpg= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=AqdgLOUl DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AEF384BB588F Received: from pps.filterd (m0360083.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 691Db4Ml1924181; Thu, 1 Oct 2026 15:29:01 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=D7kWsWjhf6+zo/djX wWc2EQ7GtyYPbeouRYu3LZPobE=; b=AqdgLOUlZ8IZRkGJaDbgOC5KZBwCEIDma rQGYtQ7QxPyTf4BuDwfZN8LAwlkhAFIxw1O7i3P7ejOvuf2i3hxWyseDa3oHxTvG noUW8v3Pjr2SzxOnIeNiGNhEGJ1i2xAn5IEEK0lzieLeD9PlMKn+unFvy5UXJBzG unOlK0YENERZ0DR76fT0C5xwoXyowN7TYngB1NxEm64W7hn12sYUdyZyM//L+Qh6 k0W6vBy8JwmHfkalRC7TxCdSGkhmpyMhXBD55/YH8p224CixFWRzC7D2PXEOu1tP fVLeoPhTFoj4G8o/SoRYFP6rV6Qd/aUd+oEMtHPO3ajhJu5OtJtfA== Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4gx5j5m74v-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 01 Oct 2026 15:29:00 +0000 (GMT) Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.18.1.11/8.18.1.11) with ESMTP id 691DlSJ71014069; Thu, 1 Oct 2026 15:29:00 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 4h0j23s7by-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 01 Oct 2026 15:28:59 +0000 (GMT) Received: from smtpav05.fra02v.mail.ibm.com (smtpav05.fra02v.mail.ibm.com [10.20.54.104]) by smtprelay05.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 691FSw1s41353708 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 1 Oct 2026 15:28:58 GMT Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 20C9C2004D; Thu, 1 Oct 2026 15:28:58 +0000 (GMT) Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E067120043; Thu, 1 Oct 2026 15:28:57 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.87.85.9]) by smtpav05.fra02v.mail.ibm.com (Postfix) with ESMTP; Thu, 1 Oct 2026 15:28:57 +0000 (GMT) From: Jens Remus To: binutils@sourceware.org, Richard Earnshaw , Alice Carlotti , Chenghua Xu , Zhensong Liu , Palmer Dabbelt , Andrew Waterman , Jim Wilson , Nelson Chu , Kito Cheng Cc: Jens Remus Subject: [PATCH v2 2/3] LoongArch: Fix h->got union phase confusion for DT_RELR Date: Thu, 1 Oct 2026 17:28:57 +0200 Message-ID: <20261001152854.3367296-7-jremus@linux.ibm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261001152854.3367296-5-jremus@linux.ibm.com> References: <20261001152854.3367296-5-jremus@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Reinject: loops=2 maxloops=12 X-Proofpoint-Spam-Info: AW1haW4tMjYxMDAxMDA2MCBTYWx0ZWRfX3af4gr32nZ1L a51O4BWbTeQfG9ne3AqUPCv+PC4r4CUhs6AYJHEFNlH3O9Ui3f1dEVlGg5MQGxZ5kUAAfXyLx1e HRrCNJf0Di+CAwCtmGgllSfAgrAgVI4= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMDAxMDA2MCBTYWx0ZWRfX+PtMYj+XXoRL HaTYAqJ4WMVNLs8aGrOHJrm8d0VWzsAolkQtDpAFOHBbF5miyDvhu2045dHFgwscL7+O2AWHM8d y58bLHPjhDb9qMNaq+wkN1QmIa6uvik6Ljxc4aKvcT7/DLHwzmSd8cRV34IgzqkMsherurlnwho WIps6M3ux4wStYhMDRHcTNT/+aZAzSRNIqkC887+S6OdooMg2KTKXTRAR5EINn94lCZKLEcmHZ8 7kv3wqsUmye6XIHgFoB3IsAdabtkMxkuWsurXC9Bhvh2IWGFigZlFzSxIkq5dx+ER+p2HSfWVaL pjd2jMI8u1FruSZZOs/WJI/h0E2AYMhiO2fskEVVNUkp1yNlEBlmxIqjeUelfXrnLaPu6cH8PL7 wgTne9cPM5tsTQVpdAZXHtEyLe58hI5WgTbjFaqCy7hbxis7KJ44HZuGwONQpaNFplTAK1tx9j5 W2B57pYX5dqD4r7bHkw== X-Proofpoint-GUID: bMbajRsJNlkm2mAkuHUo6ypbQr4iLKZq X-Authority-Analysis: v=2.4 cv=RKcmjIi+ c=1 sm=1 tr=0 ts=6abe7c3d cx=c_pps a=aDMHemPKRhS1OARIsFnwRA==:117 a=aDMHemPKRhS1OARIsFnwRA==:17 a=660iZSQnnn4A:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=iQ6ETzBq9ecOQQE5vZCe:22 a=VnNF1IyMAAAA:8 a=8_BHS44Jvbp8vecA08QA:9 X-Proofpoint-ORIG-GUID: 0W1O-286rvC1mu1PabgEZg7bTFnxTIPk X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-10-01_04,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1011 priorityscore=1501 spamscore=0 bulkscore=0 impostorscore=0 adultscore=0 lowpriorityscore=0 suspectscore=0 malwarescore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2610010060 X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: binutils-bounces~patchwork=sourceware.org@sourceware.org record_relr_dyn_got_relocs is called after allocate_dynrelocs has repurposed h->got from refcount to offset semantics. This goes along with a change in indication for no GOT entry allocated from h->got.refcount <= 0 to h->got.offset == (bfd_vma)-1. bfd/ * elfnn-loongarch.c (record_relr_dyn_got_relocs): Fix h->got union phase confusion. Signed-off-by: Jens Remus --- bfd/elfnn-loongarch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bfd/elfnn-loongarch.c b/bfd/elfnn-loongarch.c index 1a2b3b0399e3..6293efc48edd 100644 --- a/bfd/elfnn-loongarch.c +++ b/bfd/elfnn-loongarch.c @@ -2288,7 +2288,7 @@ record_relr_dyn_got_relocs (struct elf_link_hash_entry *h, void *inf) return true; if (h->type == STT_GNU_IFUNC && h->def_regular) return true; - if (h->got.refcount <= 0) + if (h->got.offset == (bfd_vma) -1) return true; if (loongarch_elf_hash_entry (h)->tls_type & (GOT_TLS_GD | GOT_TLS_IE | GOT_TLS_GDESC)) From patchwork Thu Oct 1 15:28:58 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Remus X-Patchwork-Id: 145112 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CEE304BB58F1 for ; Thu, 1 Oct 2026 15:30:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CEE304BB58F1 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=RH9wh3FS X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id A94F74BB3BFC for ; Thu, 1 Oct 2026 15:29:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A94F74BB3BFC Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linux.ibm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A94F74BB3BFC Authentication-Results: sourceware.org; arc=none smtp.remote-ip=148.163.156.1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1790868552; cv=none; b=ghKlVqVOS7qyPbbwdSFJDPBwnvXA7p4tf16ZuOihfvsDc+GNi+GoLIVFLCyz6uQtsCHDA0xYCbZiH0HcUzTrzu0mnPcjlEfDEOkQJNp6dbLWwqEiPB+C9W1vTQeHmmd9YC8pt8W5vLyel5/znv44/4+ZbFD51vTewSsOGn0/rm0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1790868552; c=relaxed/simple; bh=8S0phyTmG6SHGbbwa1vvcA5QPT/tv0wDG1RA2Tku6dg=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=DjxJkH3Mnx5pRFcpTMiwJHg36EcUl7nH5d202SFBoi9GGD3JPYNyN/7ujkVpi6xRzR5M8n16acetdr79W9NnvXmHy9stJB2QmNUWZ90n5pwFyFIISKgZhhEWCSUZ8c/7Sif30qlri9TWtRZ8yUPmkky3qPduNIdppBjNwSWuPY8= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=RH9wh3FS DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A94F74BB3BFC Received: from pps.filterd (m0360083.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 691Db7sC1924218; Thu, 1 Oct 2026 15:29:01 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=Oma6ExpXCN1kiOUXf yH03FGmCVUAjcsKmGR4Nj0DYJA=; b=RH9wh3FSf/4xCVMmb97tPj4NmitTn57HB 0YX2ZLNt2nQ+0+bq4IYF8dZtxuSg7S67ZVIsIU6LEGXADv8SoVODHm5aHFMZQS9O 9mlgxgHm3fRLURsqiaLtdOT0pHVlBYngAuLnnYQmklE/Okm0KTICX7GrSbvlbEpi CZSUdWZm/zFYdGaSnXzsvFMrCITFKyj1BhzsMREjrD1nKGoWe40BBAmCwKIoKDLD RtDfYu6a4fCcwcrfhZXgGEOUFY2UnzLiX/B856MB3YYgHzlRZrQhqmNBdR2VWs4n 44zixIwkl7aajMjXDJdsxyE6WfhAmCfLPa0jncLhrr660E+4oHSgQ== Received: from ppma12.dal12v.mail.ibm.com (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4gx5j5m74w-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 01 Oct 2026 15:29:01 +0000 (GMT) Received: from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1]) by ppma12.dal12v.mail.ibm.com (8.18.1.11/8.18.1.11) with ESMTP id 691DlTLp1014197; Thu, 1 Oct 2026 15:29:00 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 4h0g8e9pb7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 01 Oct 2026 15:29:00 +0000 (GMT) Received: from smtpav05.fra02v.mail.ibm.com (smtpav05.fra02v.mail.ibm.com [10.20.54.104]) by smtprelay05.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 691FSwAY48693586 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 1 Oct 2026 15:28:58 GMT Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 59D142004D; Thu, 1 Oct 2026 15:28:58 +0000 (GMT) Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 252AA2004E; Thu, 1 Oct 2026 15:28:58 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.87.85.9]) by smtpav05.fra02v.mail.ibm.com (Postfix) with ESMTP; Thu, 1 Oct 2026 15:28:58 +0000 (GMT) From: Jens Remus To: binutils@sourceware.org, Richard Earnshaw , Alice Carlotti , Chenghua Xu , Zhensong Liu , Palmer Dabbelt , Andrew Waterman , Jim Wilson , Nelson Chu , Kito Cheng Cc: Jens Remus Subject: [PATCH v2 3/3] RISC-V: Fix h->got union phase confusion for DT_RELR Date: Thu, 1 Oct 2026 17:28:58 +0200 Message-ID: <20261001152854.3367296-8-jremus@linux.ibm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261001152854.3367296-5-jremus@linux.ibm.com> References: <20261001152854.3367296-5-jremus@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Reinject: loops=2 maxloops=12 X-Proofpoint-Spam-Info: AW1haW4tMjYxMDAxMDA2MCBTYWx0ZWRfX7ISso/H6ooZr JiKTJPa1OLV6TVjxqd2W7WiBVj2FTffuW9qWvrYo+sFzjLrC3FTBcvVnBKtWHWBeeVtVKK0mR1q EKfHX4wEfwU+MroqY3sB0rv7mDxuxbU= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMDAxMDA2MCBTYWx0ZWRfX3QNfjx4qOCJi +EWf5IXT/2drvllwmJjlrxqQIJQd0oVf6eqnA16obBUyvcnAZK30jVcobqka2mCs7oXQhxS56sT E7O7bWgKUxnvFat+ZVa1lsVUqiX7NCO3+MunjdcyiWEiFxtUCvgtj/eUgN4bncOXFAvOCkQ77Ct 8XlIzjxgjjYpFCzEov3uGiKPGa49nckeoPVGw3Jzqx/1/vM1mRHtdbmJAvFb4TryukVxybTC131 DmnTuojvbqgPI7Aue2cA/ItNqmrE0VtzCeIbR9336p7cs7VGNOxdRPon5uTEFiMmEJ5V9yGcSOA Rkx9IQzW9jh8/eKUzPmD4dpiZaSSUI2coOV+FHRpn852/aCii7xiHJtaihCujE8blQ8Yp2j1r0z QjiGr9B5EwunbwbqOWQd2B7U4i5gKqZkg/pY4kyBA2igiyh9JWpgc6/VzakHSgQTgOoHkUJNixi aR+6+w9oQYb5sHXT6tA== X-Proofpoint-GUID: Y7Cy8zhprsUMfWKeOJzRQDwlnZOhOSOd X-Authority-Analysis: v=2.4 cv=RKcmjIi+ c=1 sm=1 tr=0 ts=6abe7c3d cx=c_pps a=bLidbwmWQ0KltjZqbj+ezA==:117 a=bLidbwmWQ0KltjZqbj+ezA==:17 a=660iZSQnnn4A:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=iQ6ETzBq9ecOQQE5vZCe:22 a=VnNF1IyMAAAA:8 a=rpliyhIoVUm-PrzGVrAA:9 X-Proofpoint-ORIG-GUID: MpQnAuwmqm0GgGMDhFEe0InG9DSNViqR X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-10-01_04,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 priorityscore=1501 spamscore=0 bulkscore=0 impostorscore=0 adultscore=0 lowpriorityscore=0 suspectscore=0 malwarescore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2610010060 X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: binutils-bounces~patchwork=sourceware.org@sourceware.org record_relr_dyn_got_relocs is called after allocate_dynrelocs has repurposed h->got from refcount to offset semantics. This goes along with a change in indication for no GOT entry allocated from h->got.refcount <= 0 to h->got.offset == (bfd_vma)-1. bfd/ * elfnn-riscv.c (record_relr_dyn_got_relocs): Fix h->got union phase confusion. Signed-off-by: Jens Remus --- bfd/elfnn-riscv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bfd/elfnn-riscv.c b/bfd/elfnn-riscv.c index 4c6800c90ed3..c7445c7dd98d 100644 --- a/bfd/elfnn-riscv.c +++ b/bfd/elfnn-riscv.c @@ -1806,7 +1806,7 @@ record_relr_dyn_got_relocs (struct elf_link_hash_entry *h, void *inf) return true; if (h->type == STT_GNU_IFUNC && h->def_regular) return true; - if (h->got.refcount <= 0) + if (h->got.offset == (bfd_vma) -1) return true; if (riscv_elf_hash_entry (h)->tls_type & (GOT_TLS_GD | GOT_TLS_IE | GOT_TLSDESC))