public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: "H.J. Lu" <hjl.tools@gmail.com>
To: Florian Weimer <fweimer@redhat.com>
Cc: Allan McRae <allan@archlinux.org>,
	GNU C Library <libc-alpha@sourceware.org>
Subject: Re: [PATCH] Don't use PLT nor GOT in libc.a [BZ #20750]
Date: Mon, 28 Nov 2016 17:46:00 -0000	[thread overview]
Message-ID: <CAMe9rOpcyETFMbJrDu2PontwYnyKX9Q+4jUj-BrATDFp_p7K8A@mail.gmail.com> (raw)
In-Reply-To: <9fec617f-752d-2818-e193-16be4e1de875@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 375 bytes --]

On Fri, Nov 25, 2016 at 12:43 AM, Florian Weimer <fweimer@redhat.com> wrote:
> On 11/24/2016 12:58 PM, Allan McRae wrote:
>>
>> Ping.  My distribution wants to enable PIE and -z,now by default and
>> this is required for glibc to build.
>
>
> My question has been answered.  H.J., could you please check this in?
>
> Thanks,
> Florian
>

This is what I checked in.

-- 
H.J.

[-- Attachment #2: 0001-X86_64-Don-t-use-PLT-nor-GOT-in-static-archives-BZ-2.patch --]
[-- Type: text/x-patch, Size: 1169 bytes --]

From dddb327ef2da7dfd86aed36b4db6e2fe471ed461 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Fri, 4 Nov 2016 10:43:42 -0700
Subject: [PATCH] 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.
---
 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..4b67fa8 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
 
-- 
2.7.4


  reply	other threads:[~2016-11-28 17:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-04 17:47 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 [this message]
2016-11-28 18:27               ` Joseph Myers
2016-11-28 21:32                 ` H.J. Lu
2016-11-28 17:54           ` Szabolcs Nagy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMe9rOpcyETFMbJrDu2PontwYnyKX9Q+4jUj-BrATDFp_p7K8A@mail.gmail.com \
    --to=hjl.tools@gmail.com \
    --cc=allan@archlinux.org \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).