From: Nelson Chu <nelson@rivosinc.com>
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 [thread overview]
Message-ID: <20221025013347.68282-2-nelson@rivosinc.com> (raw)
In-Reply-To: <20221025013347.68282-1-nelson@rivosinc.com>
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)
next prev parent reply other threads:[~2022-10-25 1:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-25 1:33 [committed 1/2] RISC-V: Improve link time complexity Nelson Chu
2022-10-25 1:33 ` Nelson Chu [this message]
2022-10-25 4:36 ` Nelson Chu
2022-10-25 10:10 ` Luis Machado
2022-10-26 2:06 ` Nelson Chu
2022-10-26 8:30 ` Luis Machado
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221025013347.68282-2-nelson@rivosinc.com \
--to=nelson@rivosinc.com \
--cc=binutils@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).