public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] x86-64: Ignore r_addend for R_X86_64_GLOB_DAT/R_X86_64_JUMP_SLOT
@ 2022-05-21  2:23 H.J. Lu
  2022-05-22 22:10 ` Fangrui Song
  2022-05-25 16:52 ` Florian Weimer
  0 siblings, 2 replies; 10+ messages in thread
From: H.J. Lu @ 2022-05-21  2:23 UTC (permalink / raw)
  To: libc-alpha

According to x86-64 psABI, r_addend should be ignored for R_X86_64_GLOB_DAT
and R_X86_64_JUMP_SLOT.
---
 sysdeps/x86_64/dl-machine.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/sysdeps/x86_64/dl-machine.h b/sysdeps/x86_64/dl-machine.h
index c70af7ab1e..7f607f6dff 100644
--- a/sysdeps/x86_64/dl-machine.h
+++ b/sysdeps/x86_64/dl-machine.h
@@ -325,11 +325,13 @@ and creates an unsatisfiable circular dependency.\n",
 #  endif
 	  /* Set to symbol size plus addend.  */
 	  value = sym->st_size;
+	  *reloc_addr = value + reloc->r_addend;
+	  break;
 # endif
-	  /* Fall through.  */
+
 	case R_X86_64_GLOB_DAT:
 	case R_X86_64_JUMP_SLOT:
-	  *reloc_addr = value + reloc->r_addend;
+	  *reloc_addr = value;
 	  break;
 
 	case R_X86_64_DTPMOD64:
-- 
2.36.1


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

end of thread, other threads:[~2022-07-14  0:06 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-21  2:23 [PATCH] x86-64: Ignore r_addend for R_X86_64_GLOB_DAT/R_X86_64_JUMP_SLOT H.J. Lu
2022-05-22 22:10 ` Fangrui Song
2022-05-25 16:52 ` Florian Weimer
2022-05-25 17:49   ` H.J. Lu
2022-05-25 18:19     ` Florian Weimer
2022-05-25 18:28       ` Adhemerval Zanella
2022-05-25 19:29         ` H.J. Lu
2022-05-25 20:24           ` Fangrui Song
2022-05-26 20:59             ` H.J. Lu
2022-07-14  0:06               ` Sunil Pandey

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