From: liuzhensong <liuzhensong@loongson.cn>
To: binutils@sourceware.org
Cc: i.swmail@xen0n.name, xry111@xry111.site, maskray@google.com,
caiyinyu@loongson.cn, chenglulu@loongson.cn,
mengqinggang@loongson.cn, xuchenghua@loongson.cn,
liuzhensong <liuzhensong@loongson.cn>
Subject: [PATCH] LoongArch: ld: Fix bug not generate plt when link a x.so
Date: Sat, 20 Aug 2022 17:08:35 +0800 [thread overview]
Message-ID: <20220820090835.543726-1-liuzhensong@loongson.cn> (raw)
bfd/
elfnn-loongarch.c
---
bfd/elfnn-loongarch.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/bfd/elfnn-loongarch.c b/bfd/elfnn-loongarch.c
index 8d0f66ea7c1..a9ca20ee49b 100644
--- a/bfd/elfnn-loongarch.c
+++ b/bfd/elfnn-loongarch.c
@@ -746,6 +746,14 @@ loongarch_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
case R_LARCH_PCALA_HI20:
if (h != NULL)
{
+ /* For pcalau12i + jirl. */
+ {
+ h->needs_plt = 1;
+ if (h->plt.refcount < 0)
+ h->plt.refcount = 0;
+ h->plt.refcount++;
+ }
+
h->non_got_ref = 1;
h->pointer_equality_needed = 1;
}
--
2.31.1
next reply other threads:[~2022-08-20 9:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-20 9:08 liuzhensong [this message]
2022-08-20 10:56 ` WANG Xuerui
2022-08-20 11:19 ` Xi Ruoyao
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=20220820090835.543726-1-liuzhensong@loongson.cn \
--to=liuzhensong@loongson.cn \
--cc=binutils@sourceware.org \
--cc=caiyinyu@loongson.cn \
--cc=chenglulu@loongson.cn \
--cc=i.swmail@xen0n.name \
--cc=maskray@google.com \
--cc=mengqinggang@loongson.cn \
--cc=xry111@xry111.site \
--cc=xuchenghua@loongson.cn \
/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).