From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20547 invoked by alias); 7 May 2005 00:34:34 -0000 Mailing-List: contact binutils-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sources.redhat.com Received: (qmail 20403 invoked from network); 7 May 2005 00:34:26 -0000 Received: from unknown (HELO sccrmhc13.comcast.net) (204.127.202.64) by sourceware.org with SMTP; 7 May 2005 00:34:26 -0000 Received: from lucon.org ([24.6.212.230]) by comcast.net (sccrmhc13) with ESMTP id <2005050700342501600drht3e>; Sat, 7 May 2005 00:34:25 +0000 Received: by lucon.org (Postfix, from userid 1000) id 5027A646BD; Fri, 6 May 2005 17:34:25 -0700 (PDT) Date: Sat, 07 May 2005 00:49:00 -0000 From: "H. J. Lu" To: Jakub Jelinek , Gwenole Beauchesne , binutils@sources.redhat.com Subject: Re: [PATCH] PR 878: fix -pie Message-ID: <20050507003425.GB25928@lucon.org> References: <20050506103049.GN22843@sunsite.mff.cuni.cz> <20050506154219.GC18041@lucon.org> <20050507001220.GB782@bubble.grove.modra.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050507001220.GB782@bubble.grove.modra.org> User-Agent: Mutt/1.4.1i X-SW-Source: 2005-05/txt/msg00306.txt.bz2 On Sat, May 07, 2005 at 09:42:20AM +0930, Alan Modra wrote: > On Fri, May 06, 2005 at 08:42:19AM -0700, H. J. Lu wrote: > > - if (!link_info.relocatable && !link_info.shared) > > + if (link_info.executable) > > Why did you remove the relocatable test? > I didn't realize that we set link_info.executable for -r. How about this patch? H.J. --- 2005-05-06 H.J. Lu * ldmain.c (main): Set link_info.executable to TRUE only if link_info.relocatable isn't. --- ld/ldmain.c.executable 2005-05-05 12:26:27.000000000 -0700 +++ ld/ldmain.c 2005-05-06 17:29:40.000000000 -0700 @@ -355,7 +355,8 @@ main (int argc, char **argv) einfo (_("%P%F: -f may not be used without -shared\n")); } - if (! link_info.shared || link_info.pie) + if (!link_info.relocatable + && (! link_info.shared || link_info.pie)) link_info.executable = TRUE; /* Treat ld -r -s as ld -r -S -x (i.e., strip all local symbols). I