From 86af25fe1d986f332c3502d83fbc499eabfb515d Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Fri, 25 May 2001 05:39:22 +0000 Subject: [PATCH] 2001-05-24 H.J. Lu * 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. --- ld/ChangeLog | 13 +++++++++++++ ld/emultempl/aix.em | 15 ++++++++++++++- ld/emultempl/beos.em | 15 ++++++++++++++- ld/emultempl/elf32.em | 15 ++++++++++++++- ld/emultempl/linux.em | 15 ++++++++++++++- ld/emultempl/mipsecoff.em | 15 ++++++++++++++- ld/emultempl/pe.em | 15 ++++++++++++++- ld/emultempl/sunos.em | 15 ++++++++++++++- 8 files changed, 111 insertions(+), 7 deletions(-) diff --git a/ld/ChangeLog b/ld/ChangeLog index 7a9025e025e..ae6dd7c3575 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,16 @@ +2001-05-24 H.J. Lu + + * 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. + 2001-05-24 Tom Rix * emultempl/aix.em : (gld${EMULATION_NAME}_read_file) diff --git a/ld/emultempl/aix.em b/ld/emultempl/aix.em index 88d13b29c7f..b88960ceb42 100644 --- a/ld/emultempl/aix.em +++ b/ld/emultempl/aix.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 <arch; + ldfile_output_machine = arch->mach; + ldfile_output_machine_name = arch->printable_name; + } + else + ldfile_output_architecture = bfd_arch_${ARCH}; #endif /* not TARGET_ */ config.has_shared = true; diff --git a/ld/emultempl/beos.em b/ld/emultempl/beos.em index 3c9e3edc9b2..4ad033bf4ec 100644 --- a/ld/emultempl/beos.em +++ b/ld/emultempl/beos.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 <arch; + ldfile_output_machine = arch->mach; + ldfile_output_machine_name = arch->printable_name; + } + else + ldfile_output_architecture = bfd_arch_${ARCH}; } /* PE format extra command line options. */ diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em index c5ffe147eb3..cce6b3e2e52 100644 --- a/ld/emultempl/elf32.em +++ b/ld/emultempl/elf32.em @@ -3,6 +3,11 @@ # This file is now misnamed, because it supports both 32 bit and 64 bit # ELF emulations. test -z "${ELFSIZE}" && ELFSIZE=32 +if [ -z "$MACHINE" ]; then + OUTPUT_ARCH=${ARCH} +else + OUTPUT_ARCH=${ARCH}:${MACHINE} +fi cat >e${EMULATION_NAME}.c <>e${EMULATION_NAME}.c <arch; + ldfile_output_machine = arch->mach; + ldfile_output_machine_name = arch->printable_name; + } + else + ldfile_output_architecture = bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`; config.dynamic_link = ${DYNAMIC_LINK-true}; config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo true ; else echo false ; fi`; } diff --git a/ld/emultempl/linux.em b/ld/emultempl/linux.em index 888a3ddc61c..85ed138d746 100644 --- a/ld/emultempl/linux.em +++ b/ld/emultempl/linux.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 <arch; + ldfile_output_machine = arch->mach; + ldfile_output_machine_name = arch->printable_name; + } + else + ldfile_output_architecture = bfd_arch_${ARCH}; config.dynamic_link = true; config.has_shared = true; } diff --git a/ld/emultempl/mipsecoff.em b/ld/emultempl/mipsecoff.em index 205943b69f7..7fc392cae5b 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 <arch; + ldfile_output_machine = arch->mach; + ldfile_output_machine_name = arch->printable_name; + } + else + ldfile_output_architecture = bfd_arch_${ARCH}; #endif /* not TARGET_ */ } diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em index 99c40abd70f..f8dee33aff7 100644 --- a/ld/emultempl/pe.em +++ b/ld/emultempl/pe.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 rm -f e${EMULATION_NAME}.c (echo;echo;echo;echo;echo)>e${EMULATION_NAME}.c # there, now line numbers match ;-) cat >>e${EMULATION_NAME}.c <arch; + ldfile_output_machine = arch->mach; + ldfile_output_machine_name = arch->printable_name; + } + else + ldfile_output_architecture = bfd_arch_${ARCH}; #ifdef DLL_SUPPORT config.has_shared = 1; diff --git a/ld/emultempl/sunos.em b/ld/emultempl/sunos.em index c98d87e1f76..d2f62e98c7e 100644 --- a/ld/emultempl/sunos.em +++ b/ld/emultempl/sunos.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 <arch; + ldfile_output_machine = arch->mach; + ldfile_output_machine_name = arch->printable_name; + } + else + ldfile_output_architecture = bfd_arch_${ARCH}; config.dynamic_link = true; config.has_shared = true; } -- 2.30.2