public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] LoongArch: ld: Fix bug not generate plt when link a x.so
@ 2022-08-20  9:08 liuzhensong
  2022-08-20 10:56 ` WANG Xuerui
  0 siblings, 1 reply; 3+ messages in thread
From: liuzhensong @ 2022-08-20  9:08 UTC (permalink / raw)
  To: binutils
  Cc: i.swmail, xry111, maskray, caiyinyu, chenglulu, mengqinggang,
	xuchenghua, liuzhensong

  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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-08-20 11:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-20  9:08 [PATCH] LoongArch: ld: Fix bug not generate plt when link a x.so liuzhensong
2022-08-20 10:56 ` WANG Xuerui
2022-08-20 11:19   ` Xi Ruoyao

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).