From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NelsondeMBP.localdomain (114-25-108-97.dynamic-ip.hinet.net [114.25.108.97]) by sourceware.org (Postfix) with ESMTP id 813733858C2D for ; Tue, 25 Oct 2022 01:33:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 813733858C2D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: sourceware.org; spf=none smtp.mailfrom=NelsondeMBP.localdomain Received: by NelsondeMBP.localdomain (Postfix, from userid 501) id 946CB341D83; Tue, 25 Oct 2022 09:33:49 +0800 (CST) From: Nelson Chu To: binutils@sourceware.org Cc: nelson@rivosinc.com Subject: [committed 2/2] RISC-V: Should reset `again' flag for _bfd_riscv_relax_pc. Date: Tue, 25 Oct 2022 09:33:47 +0800 Message-Id: <20221025013347.68282-2-nelson@rivosinc.com> X-Mailer: git-send-email 2.37.0 (Apple Git-136) In-Reply-To: <20221025013347.68282-1-nelson@rivosinc.com> References: <20221025013347.68282-1-nelson@rivosinc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00,GIT_PATCH_0,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,KAM_LAZY_DOMAIN_SECURITY,KHOP_HELO_FCRDNS,NO_DNS_FOR_FROM,PDS_RDNS_DYNAMIC_FP,RCVD_IN_BARRACUDACENTRAL,RCVD_IN_PBL,RDNS_DYNAMIC,SPF_HELO_NONE,SPF_NONE,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 List-Id: The R_RISCV_DELETE relocations are no longer deleted at another relax pass, so we should reset 'again' flag to true for _bfd_riscv_relax_pc, while the deleted bytes are marked as R_RISCV_DELETE. bfd/ * elfnn-riscv.c (_bfd_riscv_relax_pc): Set `again' to true while the deleted bytes are marked as R_RISCV_DELETE. --- bfd/elfnn-riscv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bfd/elfnn-riscv.c b/bfd/elfnn-riscv.c index e4064313724..cf852636c9c 100644 --- a/bfd/elfnn-riscv.c +++ b/bfd/elfnn-riscv.c @@ -4586,7 +4586,7 @@ _bfd_riscv_relax_pc (bfd *abfd ATTRIBUTE_UNUSED, bfd_vma symval, bfd_vma max_alignment, bfd_vma reserve_size, - bool *again ATTRIBUTE_UNUSED, + bool *again, riscv_pcgp_relocs *pcgp_relocs, bool undefined_weak) { @@ -4715,6 +4715,7 @@ _bfd_riscv_relax_pc (bfd *abfd ATTRIBUTE_UNUSED, sym_sec, undefined_weak); /* Delete unnecessary AUIPC and reuse the reloc. */ + *again = true; riscv_relax_delete_bytes (abfd, sec, rel->r_offset, 4, link_info, pcgp_relocs, rel); return true; -- 2.37.0 (Apple Git-136)