public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Don't use PLT nor GOT in libc.a [BZ #20750]
@ 2016-11-04 17:47 H.J. Lu
  2016-11-04 19:03 ` Florian Weimer
  0 siblings, 1 reply; 11+ messages in thread
From: H.J. Lu @ 2016-11-04 17:47 UTC (permalink / raw)
  To: GNU C Library

There is no need to use PLT nor GOT in libc.a to branch to a function,
regardless whether libc.a is compiled with PIC or not.

Tested on x86-64.  OK for master?

H.J.
---
	[BZ #20750]
	* sysdeps/x86_64/sysdep.h (JUMPTARGET): Check SHARED instead
	of PIC.
---
 sysdeps/x86_64/sysdep.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sysdeps/x86_64/sysdep.h b/sysdeps/x86_64/sysdep.h
index 75ac747..fd25c90 100644
--- a/sysdeps/x86_64/sysdep.h
+++ b/sysdeps/x86_64/sysdep.h
@@ -89,13 +89,14 @@ lose:									      \
   END (name)
 
 #undef JUMPTARGET
-#ifdef PIC
+#ifdef SHARED
 # ifdef BIND_NOW
 #  define JUMPTARGET(name)	*name##@GOTPCREL(%rip)
 # else
 #  define JUMPTARGET(name)	name##@PLT
 # endif
 #else
+/* For libc.a, we want to branch to target directly.  */
 # define JUMPTARGET(name)	name
 #endif
 
-- 
2.7.4

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

end of thread, other threads:[~2016-11-28 21:32 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-04 17:47 [PATCH] Don't use PLT nor GOT in libc.a [BZ #20750] H.J. Lu
2016-11-04 19:03 ` Florian Weimer
2016-11-04 19:25   ` H.J. Lu
2016-11-07 16:03     ` Florian Weimer
2016-11-07 17:14       ` H.J. Lu
2016-11-24 11:58         ` Allan McRae
2016-11-25  8:43           ` Florian Weimer
2016-11-28 17:46             ` H.J. Lu
2016-11-28 18:27               ` Joseph Myers
2016-11-28 21:32                 ` H.J. Lu
2016-11-28 17:54           ` Szabolcs Nagy

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