From patchwork Mon Nov 28 17:46:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 84436 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp1244334qgi; Mon, 28 Nov 2016 09:46:26 -0800 (PST) X-Received: by 10.98.78.88 with SMTP id c85mr23013733pfb.138.1480355186103; Mon, 28 Nov 2016 09:46:26 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id q13si27452532pli.265.2016.11.28.09.46.25 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Nov 2016 09:46:26 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-return-75261-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org; spf=pass (google.com: domain of libc-alpha-return-75261-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-75261-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE dis=NONE) header.from=gmail.com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; q=dns; s=default; b=iTVE QtM4fIcGaF8W4dxVo0+80Ra+/SrTlpdYj/VmaTWn53H/uIUwdVWVWlHytzKYacxs JHc1kTJSxkWgZepgsqz7jrjtCuoQfk3tTyOiyBi4p660BsxTcdkXbA9ZpRsbo1LW k1JZMdEde4VI5NH7B0rONXm1R/RKefnhjvEpA7k= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; s=default; bh=Bp3edZL0r0 bbX38+9XIQQodPEf0=; b=W4jcdfrkTFsQXvB0c0Uhaqf6SI9tqFE1y2fJNw2EOB FjRBKTBarXWFCnoo1vVgH5p2SetXZNYxYlGyYh/pED1TFQNQOIaElX64s/7tqwkr jJPzevIMeoKtqxxgozjoo2Cik0/Uf5pAB4LVfWe/Pqe0FPi8nIZntoKw9r4syYu5 I= Received: (qmail 96655 invoked by alias); 28 Nov 2016 17:46:13 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 96633 invoked by uid 89); 28 Nov 2016 17:46:12 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=H*Ad:U*allan, @plt, jumptarget, 89, 14 X-HELO: mail-qt0-f169.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=dU8GoUncnFDii4GsZo2TGEtxZcX88Xm8V1PeWoqY7cI=; b=dJDjxBX2nUV1upZOdAHlLWBtSPEvkf7OVEteCCkHTyISrXp/ONUvrWDUiNHFZ2lbCm 1Oi1H7jHTzD4UGAWTa+IysCXzdVpNLeCwhbpuHeIHTUS6saki7MIiHJO8ywfqqlWN2XS ArDTh1eka8iD35Qf9s6qkvjS08L+oLSlCZFDetZnbz4tHOnzwpHSFnssHR3nttSbOlpB MY8g3rNeEyy8Uog2yCA0MUjATjzZX2NUoXttSlCwLt22jJEr5vYjmQi8xXhLczIX+vST ZWeIjOE6+NJaL3wqu54QGz4bFMbBJYh0ZS3FED+wqDcw45y5H65wAUg9X69LzRRJZ/8S tv+w== X-Gm-Message-State: AKaTC016nORTi77qNZKL/mo/5wkd9AOdGlTmeXEwu9uXguLwMUnMfTiEeUJ/KdhEmCVtxGSnUOu1klLFD8oYgA== X-Received: by 10.200.50.53 with SMTP id x50mr19934273qta.207.1480355169587; Mon, 28 Nov 2016 09:46:09 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <9fec617f-752d-2818-e193-16be4e1de875@redhat.com> References: <20161104174739.GA5880@intel.com> <1129b1b2-5f7a-26c3-76a7-727a14fdadfb@redhat.com> <9fec617f-752d-2818-e193-16be4e1de875@redhat.com> From: "H.J. Lu" Date: Mon, 28 Nov 2016 09:46:09 -0800 Message-ID: Subject: Re: [PATCH] Don't use PLT nor GOT in libc.a [BZ #20750] To: Florian Weimer Cc: Allan McRae , GNU C Library On Fri, Nov 25, 2016 at 12:43 AM, Florian Weimer 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. >From dddb327ef2da7dfd86aed36b4db6e2fe471ed461 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" 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