This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [PATCH] ld/emultempl/elf32.em broken
- To: Thiemo Seufer <ica2_ts at csv dot ica dot uni-stuttgart dot de>
- Subject: Re: [PATCH] ld/emultempl/elf32.em broken
- From: Alexandre Oliva <aoliva at redhat dot com>
- Date: 23 May 2001 20:53:28 -0300
- Cc: binutils at sourceware dot cygnus dot com
- Organization: GCC Team, Red Hat
- References: <20010523232641.I11643@rembrandt.csv.ica.uni-stuttgart.de>
On May 23, 2001, Thiemo Seufer <ica2_ts@csv.ica.uni-stuttgart.de> wrote:
> 2001-05-22 Alexandre Oliva <aoliva@redhat.com>
> * emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation): Use
> it.
> introduced a strange code snippet in elf32.em which broke compilation.
> This patch reverts it.
Yep, I had just noticed this myself, in my weekly binutils+GCC
bootstrap on Solaris/x86. It hard worked on GNU/Linux :-(
Sorry. Here's a patch that fixes the problem without removing the new
feature. This one was tested natively on Solaris/x86 and a number of
other platforms. Ok to install?
Index: ld/ChangeLog
from Alexandre Oliva <aoliva@redhat.com>
* emultempl/elf32.em (ELF_INTERPRETER_SET_DEFAULT): Use this new
variable to avoid non-portable shell construct.
Index: ld/emultempl/elf32.em
===================================================================
RCS file: /cvs/src/src/ld/emultempl/elf32.em,v
retrieving revision 1.46
diff -u -p -r1.46 elf32.em
--- ld/emultempl/elf32.em 2001/05/22 14:00:18 1.46
+++ ld/emultempl/elf32.em 2001/05/23 23:49:19
@@ -789,6 +789,18 @@ gld${EMULATION_NAME}_find_statement_assi
EOF
if test x"$LDEMUL_BEFORE_ALLOCATION" != xgld"$EMULATION_NAME"_before_allocation; then
+ if test x"${ELF_INTERPRETER_NAME+set}" = xset; then
+ ELF_INTERPRETER_SET_DEFAULT="
+ if (sinterp != NULL)
+ {
+ sinterp->contents = ${ELF_INTERPRETER_NAME};
+ sinterp->_raw_size = strlen (sinterp->contents) + 1;
+ }
+
+"
+ else
+ ELF_INTERPRETER_SET_DEFAULT=
+ fi
cat >>e${EMULATION_NAME}.c <<EOF
/* This is called after the sections have been attached to output
@@ -816,15 +828,7 @@ gld${EMULATION_NAME}_before_allocation (
(const char * const *) command_line.auxiliary_filters,
&link_info, &sinterp, lang_elf_version_info)))
einfo ("%P%F: failed to set dynamic section sizes: %E\n");
-
-${ELF_INTERPRETER_NAME+"
- if (sinterp != NULL)
- {
- sinterp->contents = ${ELF_INTERPRETER_NAME};
- sinterp->_raw_size = strlen (sinterp->contents) + 1;
- }
-
-"}
+${ELF_INTERPRETER_SET_DEFAULT}
/* Let the user override the dynamic linker we are using. */
if (command_line.interpreter != NULL
&& sinterp != NULL)
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me