From: H.J. Lu Date: Mon, 28 Nov 2016 17:44:49 +0000 (-0800) Subject: X86_64: Don't use PLT nor GOT in static archives [BZ #20750] X-Git-Tag: glibc-2.25~262 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c9070e6305c08365c5f8b604bdca39c699d70cfa;p=thirdparty%2Fglibc.git X86_64: Don't use PLT nor GOT in static archives [BZ #20750] There is no need to use PLT nor GOT in static archives to branch to a function, regardless whether static archives is compiled with PIC or not. When static archives are used to create dynamic executable, PLT/GOT may be used. The resulting executable still works correctly. [BZ #20750] * sysdeps/x86_64/sysdep.h (JUMPTARGET): Check SHARED instead of PIC. --- diff --git a/ChangeLog b/ChangeLog index 0474b4fe6b3..ec8b6d88ae6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2016-11-28 H.J. Lu + + [BZ #20750] + * sysdeps/x86_64/sysdep.h (JUMPTARGET): Check SHARED instead + of PIC. + 2016-11-28 Andrew Pinski Yury Norov Steve Ellcey diff --git a/sysdeps/x86_64/sysdep.h b/sysdeps/x86_64/sysdep.h index 75ac747be8a..4b67fa80c19 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 static archives, branch to target directly. */ # define JUMPTARGET(name) name #endif