aboutsummaryrefslogtreecommitdiff
path: root/ld/emultempl/mipsecoff.em
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2001-05-25 05:39:22 +0000
committerH.J. Lu <hjl.tools@gmail.com>2001-05-25 05:39:22 +0000
commit86af25fe1d986f332c3502d83fbc499eabfb515d (patch)
treeea854c5b5a529938abeb5be81a4fe58ebaf8125e /ld/emultempl/mipsecoff.em
parent936f9717c08e578286f89e1eaff99f35ebd05c1d (diff)
downloadfsf-binutils-gdb-86af25fe1d986f332c3502d83fbc499eabfb515d.zip
fsf-binutils-gdb-86af25fe1d986f332c3502d83fbc499eabfb515d.tar.gz
fsf-binutils-gdb-86af25fe1d986f332c3502d83fbc499eabfb515d.tar.bz2
2001-05-24 H.J. Lu <hjl@gnu.org>
* emultempl/aix.em (OUTPUT_ARCH): Defined. (gld${EMULATION_NAME}_before_parse): Initialize ldfile_output_architecture, ldfile_output_machine and ldfile_output_machine_name from ${OUTPUT_ARCH} if possible. * emultempl/beos.em: Likewise. * emultempl/elf32.em: Likewise. * emultempl/linux.em: Likewise. * emultempl/mipsecoff.em: Likewise. * emultempl/pe.em: Likewise. * emultempl/sunos.em: Likewise.
Diffstat (limited to 'ld/emultempl/mipsecoff.em')
-rw-r--r--ld/emultempl/mipsecoff.em15
1 files changed, 14 insertions, 1 deletions
diff --git a/ld/emultempl/mipsecoff.em b/ld/emultempl/mipsecoff.em
index 205943b..7fc392c 100644
--- a/ld/emultempl/mipsecoff.em
+++ b/ld/emultempl/mipsecoff.em
@@ -1,5 +1,10 @@
# This shell script emits a C file. -*- C -*-
# It does some substitutions.
+if [ -z "$MACHINE" ]; then
+ OUTPUT_ARCH=${ARCH}
+else
+ OUTPUT_ARCH=${ARCH}:${MACHINE}
+fi
cat >e${EMULATION_NAME}.c <<EOF
/* This file is is generated by a shell script. DO NOT EDIT! */
@@ -48,7 +53,15 @@ static void
gld${EMULATION_NAME}_before_parse()
{
#ifndef TARGET_ /* I.e., if not generic. */
- ldfile_output_architecture = bfd_arch_${ARCH};
+ const bfd_arch_info_type *arch = bfd_scan_arch ("${OUTPUT_ARCH}");
+ if (arch)
+ {
+ ldfile_output_architecture = arch->arch;
+ ldfile_output_machine = arch->mach;
+ ldfile_output_machine_name = arch->printable_name;
+ }
+ else
+ ldfile_output_architecture = bfd_arch_${ARCH};
#endif /* not TARGET_ */
}