From patchwork Tue Oct 25 01:33:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nelson Chu X-Patchwork-Id: 10454 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp745131wru; Mon, 24 Oct 2022 18:34:07 -0700 (PDT) X-Google-Smtp-Source: AMsMyM74LGONSW48eJnDIYI7WJz5maX+nJw6aFfnWF5rCDe70QfyiPndfxrkaWL7XPU9Vr+MXJlf X-Received: by 2002:a17:906:c14f:b0:793:30e1:96be with SMTP id dp15-20020a170906c14f00b0079330e196bemr25157074ejc.447.1666661646911; Mon, 24 Oct 2022 18:34:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666661646; cv=none; d=google.com; s=arc-20160816; b=YiH/yvRvI8WQsJg2MRympHszCUr93CAOx7MR/JKki4LCgmXbfTtJYnM0SUhB/tgux5 yBBD7O42QNfdIZ5eMAEH5rh0cAUxj4O2wbDNWzpb/BdGKuBIiMPKEkrMHd28/hs3kI4y Vzy0xxqaVCz9xPDRFRPSjLSH6G1eUbUdcM/EhteUpbo1j0d+YjLg54WyQknCEOdJAPss rlrLnVnAQUxFpR4E3XjMSTzebmuKxU9qcobObHJlSyRYhtdCHOTqSnk53A4FCfz39g8r FdwDLmMohCTggJ2nej1LI7o0AKPtKzXEZkC2BGqdl25arhni+HaYM7bDEo4YtLvEII+H avvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dmarc-filter:delivered-to; bh=Iwo+jjXIYpbYIBZqnWndhsPTK0rxcYiuGFaCs99MPFo=; b=LWGD6QqR9XwjMWYOmrCsB0WNXbIoNvXsnOSfZm3vlBquM1PGHWusoaaIwrCCmABHfp qDM0iJuz2z3DO2PgZcPjAEvWccCoIf5VKv2a2lHnkkDbv5axVV2aSZIw+SSdY1N9PMXD VobUzl2oPqo9IuiQI1c0z7bKA3B34MzRlUg5XzFZ5pXiS9wmo68ONHJs/bORH1XuEwCl LLDIEpFScVualK/Zf8YFJnnuB8a4211OIVOjUK5e320LNxqR861ww0DiLm99fTPDqMPH 9mRJlPjYSEEA9T0eofk2jxEKKvl37RKDmIXdI2kfr6A1hlLIZgVvtCUZiBKitlmPDvnZ xFVQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org" Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id 29-20020a50875d000000b004511d552be3si349115edv.4.2022.10.24.18.34.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Oct 2022 18:34:06 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B37C13858C2F for ; Tue, 25 Oct 2022 01:34:05 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org 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 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 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 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: , 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?1747621403509953400?= X-GMAIL-MSGID: =?utf-8?q?1747621403509953400?= 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;