This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH] Alpha/Linux/ECOFF: Fix configuration
- From: "Maciej W. Rozycki" <macro at codesourcery dot com>
- To: <binutils at sourceware dot org>
- Date: Mon, 29 Apr 2013 20:26:36 +0100
- Subject: [PATCH] Alpha/Linux/ECOFF: Fix configuration
Hi,
In the course of some ELF testing I noticed the Alpha/Linux/ECOFF target,
denoted among others with the alpha-linuxecoff configuration alias, is not
configured correctly. Both alpha-linux and alpha-linuxecoff are
configured with ELF and ECOFF binary format support and the difference
between the two is meant to be that with the former the ELF format is
primary and the ECOFF format is secondary while with the latter the
opposite is the case.
Unfortunately this is not the case, both targets select ELF as the
primary format -- my understanding is `config.sub' was modified at one
point such that alpha-linuxecoff now expands to the
alpha-unknown-linux-gnuecoff canonical configuration specifier and that is
not correctly matched with patterns used across binutils.
Here's a change to correct configuration scripts and to adjust the
is_elf_format test-suite procedure accordingly. For the new patterns I
have followed the existing practice used with *-*-linux*aout* patterns.
The modified configuration builds correctly.
There are some regressions across the testsuite after this change because
some generic ELF tests use ad-hoc target conditionals to enable themselves
rather than is_elf_format. I have not adjusted them with this change as
they are not a direct outcome of this change, but unrelated breakage. It
would be good to audit the test suite sometime to make sure it uses
is_elf_format consistently.
OK to apply?
2013-04-29 Maciej W. Rozycki <macro@codesourcery.com>
bfd/
* config.bfd: Replace alpha*-*-linuxecoff* pattern with
alpha*-*-linux*ecoff*.
binutils/testsuite/
* lib/binutils-common.exp (is_elf_format): Also exclude
*-*-linux*ecoff*.
gas/
* configure.tgt: Replace alpha*-*-linuxecoff* pattern with
alpha*-*-linux*ecoff*.
ld/
* configure.tgt: Replace alpha*-*-linuxecoff* pattern with
alpha*-*-linux*ecoff*. Update the `sed' pattern used to convert
from alpha*-*-linux-* to alpha*-*-linux*ecoff*.
Maciej
binutils-alpha-linuxecoff.diff
Index: binutils-fsf-trunk-quilt/bfd/config.bfd
===================================================================
--- binutils-fsf-trunk-quilt.orig/bfd/config.bfd 2013-04-23 18:26:14.000000000 +0100
+++ binutils-fsf-trunk-quilt/bfd/config.bfd 2013-04-27 02:46:32.613544219 +0100
@@ -202,7 +202,7 @@ case "${targ}" in
targ_selvecs=nlm32_alpha_vec
want64=true
;;
- alpha*-*-linuxecoff*)
+ alpha*-*-linux*ecoff*)
targ_defvec=ecoffalpha_little_vec
targ_selvecs=bfd_elf64_alpha_vec
want64=true
Index: binutils-fsf-trunk-quilt/binutils/testsuite/lib/binutils-common.exp
===================================================================
--- binutils-fsf-trunk-quilt.orig/binutils/testsuite/lib/binutils-common.exp 2013-04-23 18:26:12.000000000 +0100
+++ binutils-fsf-trunk-quilt/binutils/testsuite/lib/binutils-common.exp 2013-04-27 02:53:36.173841163 +0100
@@ -44,6 +44,7 @@ proc is_elf_format {} {
}
if { [istarget *-*-linux*aout*]
+ || [istarget *-*-linux*ecoff*]
|| [istarget *-*-linux*oldld*]
|| [istarget h8500-*-rtems*]
|| [istarget i960-*-rtems*]
Index: binutils-fsf-trunk-quilt/gas/configure.tgt
===================================================================
--- binutils-fsf-trunk-quilt.orig/gas/configure.tgt 2013-04-23 18:26:11.000000000 +0100
+++ binutils-fsf-trunk-quilt/gas/configure.tgt 2013-04-27 02:46:46.123853707 +0100
@@ -121,7 +121,7 @@ case ${generic_target} in
alpha-*-*vms*) fmt=evax ;;
alpha-*-osf*) fmt=ecoff ;;
- alpha-*-linuxecoff*) fmt=ecoff ;;
+ alpha-*-linux*ecoff*) fmt=ecoff ;;
alpha-*-linux-*) fmt=elf em=linux ;;
alpha-*-netbsd*) fmt=elf em=nbsd ;;
alpha-*-openbsd*) fmt=elf em=obsd ;;
Index: binutils-fsf-trunk-quilt/ld/configure.tgt
===================================================================
--- binutils-fsf-trunk-quilt.orig/ld/configure.tgt 2013-04-23 18:26:07.000000000 +0100
+++ binutils-fsf-trunk-quilt/ld/configure.tgt 2013-04-27 02:52:39.663796346 +0100
@@ -57,10 +57,10 @@ alpha*-*-freebsd* | alpha*-*-kfreebsd*-g
targ_emul=elf64alpha_fbsd
targ_extra_emuls="elf64alpha alpha"
tdir_alpha=`echo ${targ_alias} | sed -e 's/freebsd/freebsdecoff/'` ;;
-alpha*-*-linuxecoff*) targ_emul=alpha targ_extra_emuls=elf64alpha
+alpha*-*-linux*ecoff*) targ_emul=alpha targ_extra_emuls=elf64alpha
tdir_elf64alpha=`echo ${targ_alias} | sed -e 's/ecoff//'` ;;
alpha*-*-linux-*) targ_emul=elf64alpha targ_extra_emuls=alpha
- tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'` ;;
+ tdir_alpha=`echo ${targ_alias} | sed -e 's/linux\(-gnu\)*/linux\1ecoff/'` ;;
alpha*-*-osf*) targ_emul=alpha ;;
alpha*-*-gnu*) targ_emul=elf64alpha ;;
alpha*-*-netware*) targ_emul=alpha ;;