From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 63887 invoked by alias); 1 Nov 2017 16:32:36 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 63870 invoked by uid 89); 1 Nov 2017 16:32:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-22.3 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,RDNS_DYNAMIC,TVD_RCVD_IP autolearn=ham version=3.3.2 spammy=Hx-languages-length:1364 X-HELO: brightrain.aerifal.cx Received: from 216-12-86-13.cv.mvl.ntelos.net (HELO brightrain.aerifal.cx) (216.12.86.13) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 01 Nov 2017 16:32:25 +0000 Received: from dalias by brightrain.aerifal.cx with local (Exim 3.15 #2) id 1e9vwD-0004G4-00; Wed, 01 Nov 2017 16:32:21 +0000 Date: Wed, 01 Nov 2017 16:32:00 -0000 From: Rich Felker To: "H.J. Lu" Cc: gcc-patches@gcc.gnu.org, Joseph Myers Subject: Re: [PATCH] Use Pcrt1.o%s/gPcrt1.o%s for -static-pie Message-ID: <20171101163221.GA16240@brightrain.aerifal.cx> References: <20171015131657.GA24340@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171015131657.GA24340@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes X-SW-Source: 2017-11/txt/msg00021.txt.bz2 On Sun, Oct 15, 2017 at 06:16:57AM -0700, H.J. Lu wrote: > crt1.o is used to create dynamic and non-PIE static executables. Static > PIE needs to link with Pcrt1.o, instead of crt1.o, to relocate static PIE > at run-time. When -pg is used with -static-pie, gPcrt1.o should be used. > > Tested on x86-64. OK for master? Is there a reason you didn't follow the existing naming practice here? Openbsd and musl libc have both had static pie for a long time now and have used rcrt1.o as the name. Rich > --- > * config/gnu-user.h (GNU_USER_TARGET_STARTFILE_SPEC): Use > Pcrt1.o%s/gPcrt1.o%s for -static-pie. > --- > gcc/config/gnu-user.h | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h > index a967b69a350..c1cfdc3da90 100644 > --- a/gcc/config/gnu-user.h > +++ b/gcc/config/gnu-user.h > @@ -51,9 +51,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see > #if defined HAVE_LD_PIE > #define GNU_USER_TARGET_STARTFILE_SPEC \ > "%{shared:; \ > - pg|p|profile:gcrt1.o%s; \ > + pg|p|profile:%{static-pie:gPcrt1.o%s;:gcrt1.o%s}; \ > static:crt1.o%s; \ > - static-pie|" PIE_SPEC ":Scrt1.o%s; \ > + static-pie:Pcrt1.o%s; \ > + " PIE_SPEC ":Scrt1.o%s; \ > :crt1.o%s} \ > crti.o%s \ > %{static:crtbeginT.o%s; \ > -- > 2.13.5