This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [PATCH] PR 878: fix -pie
On Fri, May 06, 2005 at 12:30:49PM +0200, Jakub Jelinek wrote:
> On Fri, May 06, 2005 at 12:17:47PM +0200, Gwenole Beauchesne wrote:
> > --- binutils-2.16.90.0.2/ld/emultempl/elf32.em.ld-pie-init-fini-syms 2005-04-29 19:50:30.000000000 +0200
> > +++ binutils-2.16.90.0.2/ld/emultempl/elf32.em 2005-04-30 07:58:17.739644900 +0200
> > @@ -1495,7 +1495,7 @@ gld${EMULATION_NAME}_provide_bound_symbo
> > static void
> > gld${EMULATION_NAME}_provide_init_fini_syms (void)
> > {
> > - if (!link_info.relocatable && !link_info.shared)
> > + if (!link_info.relocatable && (!link_info.shared || link_info.pie))
>
> (! link_info.shared || link_info.pie) is link_info.executable.
>
> Jakub
This is the patch I checked in.
H.J.
---
Index: ChangeLog
===================================================================
RCS file: /cvs/src/src/ld/ChangeLog,v
retrieving revision 1.1331
diff -u -p -r1.1331 ChangeLog
--- ChangeLog 6 May 2005 08:26:54 -0000 1.1331
+++ ChangeLog 6 May 2005 15:40:00 -0000
@@ -1,3 +1,8 @@
+2005-05-06 H.J. Lu <hongjiu.lu@intel.com>
+
+ * emultempl/elf32.em (gld${EMULATION_NAME}_provide_init_fini_syms):
+ Just check link_info.executable.
+
2005-05-06 Nick Clifton <nickc@redhat.com>
* Update the address and phone number of the FSF organization in
Index: emultempl/elf32.em
===================================================================
RCS file: /cvs/src/src/ld/emultempl/elf32.em,v
retrieving revision 1.143
diff -u -p -r1.143 elf32.em
--- emultempl/elf32.em 4 May 2005 13:19:02 -0000 1.143
+++ emultempl/elf32.em 6 May 2005 15:40:01 -0000
@@ -1475,7 +1475,7 @@ gld${EMULATION_NAME}_provide_bound_symbo
static void
gld${EMULATION_NAME}_provide_init_fini_syms (void)
{
- if (!link_info.relocatable && !link_info.shared)
+ if (link_info.executable)
{
gld${EMULATION_NAME}_provide_bound_symbols (".preinit_array",
"__preinit_array_start",