public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] LoongArch: Fix a bug of getting relocation type
@ 2024-01-26  3:39 mengqinggang
  2024-01-26  9:01 ` mengqinggang
  0 siblings, 1 reply; 8+ messages in thread
From: mengqinggang @ 2024-01-26  3:39 UTC (permalink / raw)
  To: binutils
  Cc: xuchenghua, chenglulu, liuzhensong, cailulu, xry111, i.swmail,
	maskray, luweining, wanglei, hejinyang, mengqinggang

The old code works because R_LARCH_RELAX has no symbol index. It causes
'(rel + 1)->r_info == R_LARCH_RELAX' is 1 and ELFNN_R_TYPE (1) is 1.
---
 bfd/elfnn-loongarch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bfd/elfnn-loongarch.c b/bfd/elfnn-loongarch.c
index b2caa5fc3e1..0cc6273726c 100644
--- a/bfd/elfnn-loongarch.c
+++ b/bfd/elfnn-loongarch.c
@@ -4166,7 +4166,7 @@ loongarch_relax_tls_le (bfd *abfd, asection *sec,
   static uint32_t insn_rj,insn_rd;
   symval = symval - elf_hash_table (link_info)->tls_sec->vma;
   /* Whether the symbol offset is in the interval (offset < 0x800).  */
-  if (ELFNN_R_TYPE ((rel + 1)->r_info == R_LARCH_RELAX) && (symval < 0x800))
+  if (ELFNN_R_TYPE ((rel + 1)->r_info) == R_LARCH_RELAX && (symval < 0x800))
     {
       switch (ELFNN_R_TYPE (rel->r_info))
 	{
-- 
2.36.0


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

end of thread, other threads:[~2024-01-29 11:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-26  3:39 [PATCH] LoongArch: Fix a bug of getting relocation type mengqinggang
2024-01-26  9:01 ` mengqinggang
2024-01-26 10:55   ` Nick Clifton
2024-01-26 11:02     ` Xi Ruoyao
2024-01-26 11:41       ` Nick Clifton
2024-01-27 13:37       ` Lulu Cai
2024-01-28  4:14         ` lulu Tsai
2024-01-29 11:24           ` Nick Clifton

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