[binutils-gdb] LoongArch: Fix the size of tls desc relocations

liu zhensong via Binutils-cvs <[email protected]> Fri, 10 Jul 2026 07:01:37 +0000 (GMT)
Newsgroups gmane.comp.gnu.binutils.cvs
Message-ID <[email protected]>
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=2a6fb1798b6a81d57985494bba284239505a23ff

commit 2a6fb1798b6a81d57985494bba284239505a23ff
Author: mengqinggang <[email protected]>
Date:   Mon Jul 6 08:19:27 2026 +0800

    LoongArch: Fix the size of tls desc relocations
    
    Change the size of R_LARCH_TLS_DESC64_* from 8 to 4.

Diff:
---
 bfd/elfxx-loongarch.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/bfd/elfxx-loongarch.c b/bfd/elfxx-loongarch.c
index 11754d62737..b39a5c50b8d 100644
--- a/bfd/elfxx-loongarch.c
+++ b/bfd/elfxx-loongarch.c
@@ -1642,7 +1642,7 @@ static loongarch_reloc_howto_type loongarch_howto_table[] =
   /* TLS_DESC64 LARGE PCREL.  */
   LOONGARCH_HOWTO (R_LARCH_TLS_DESC64_PC_LO20, /* type (113).  */
 	32,				       /* rightshift.  */
-	8,				       /* size.  */
+	4,				       /* size.  */
 	20,				       /* bitsize.  */
 	true,				       /* pc_relative.  */
 	5,				       /* bitpos.  */
@@ -1659,7 +1659,7 @@ static loongarch_reloc_howto_type loongarch_howto_table[] =
 
   LOONGARCH_HOWTO (R_LARCH_TLS_DESC64_PC_HI12, /* type (114).  */
 	52,				       /* rightshift.  */
-	8,				       /* size.  */
+	4,				       /* size.  */
 	12,				       /* bitsize.  */
 	true,				       /* pc_relative.  */
 	10,				       /* bitpos.  */
@@ -1712,7 +1712,7 @@ static loongarch_reloc_howto_type loongarch_howto_table[] =
   /* TLS_DESC64 LARGE ABS.  */
   LOONGARCH_HOWTO (R_LARCH_TLS_DESC64_LO20,    /* type (117).  */
 	32,				       /* rightshift.  */
-	8,				       /* size.  */
+	4,				       /* size.  */
 	20,				       /* bitsize.  */
 	false,				       /* pc_relative.  */
 	5,				       /* bitpos.  */
@@ -1729,7 +1729,7 @@ static loongarch_reloc_howto_type loongarch_howto_table[] =
 
   LOONGARCH_HOWTO (R_LARCH_TLS_DESC64_HI12,    /* type (118).  */
 	52,				       /* rightshift.  */
-	8,				       /* size.  */
+	4,				       /* size.  */
 	12,				       /* bitsize.  */
 	false,				       /* pc_relative.  */
 	10,				       /* bitpos.  */