[PATCH v0 1/4] LoongArch: Fix the size of tls desc relocations

mengqinggang mengqinggang@loongson.cn
Tue Jul 7 17:47:16 GMT 2026


Change the size of R_LARCH_TLS_DESC64_* from 8 to 4.
---
 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.  */
-- 
2.34.1



More information about the Binutils mailing list