This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] PR 878: fix -pie


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  <hongjiu.lu@intel.com>

	* 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]