2001-05-24 H.J. Lu <hjl@gnu.org>
authorH.J. Lu <hjl.tools@gmail.com>
Fri, 25 May 2001 05:39:22 +0000 (05:39 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Fri, 25 May 2001 05:39:22 +0000 (05:39 +0000)
* 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
ld/emultempl/aix.em
ld/emultempl/beos.em
ld/emultempl/elf32.em
ld/emultempl/linux.em
ld/emultempl/mipsecoff.em
ld/emultempl/pe.em
ld/emultempl/sunos.em

index 7a9025e025e56ef60aac01d46d9f0067795fe57c..ae6dd7c35759efb072df226ec3fbb97f415b775f 100644 (file)
@@ -1,3 +1,16 @@
+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.
+
 2001-05-24 Tom Rix <trix@redhat.com>
 
        * emultempl/aix.em : (gld${EMULATION_NAME}_read_file) 
index 88d13b29c7f65523129c3c8af325070f56632df4..b88960ceb42d61daca52a38840d5933e1ce6817d 100644 (file)
@@ -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! */
 
@@ -114,7 +119,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_ */
   config.has_shared = true;
 
index 3c9e3edc9b2ae6785b4d7a5e8eb06291fe03266e..4ad033bf4ec9cdd8babc8f5c9fa1cb1c350844aa 100644 (file)
@@ -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 part of GLD, the Gnu Linker.
    Copyright 1995, 1996, 1997, 1998, 2000 Free Software Foundation, Inc.
@@ -72,7 +77,15 @@ static void
 gld_${EMULATION_NAME}_before_parse()
 {
   output_filename = "a.exe";
-  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};
 }
 \f
 /* PE format extra command line options.  */
index c5ffe147eb3d7e44c6d11974b90fa360eba71ded..cce6b3e2e522ec8132abe19f33a263bce9a12048 100644 (file)
@@ -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 <<EOF
 /* This file is is generated by a shell script.  DO NOT EDIT! */
 
@@ -90,7 +95,15 @@ cat >>e${EMULATION_NAME}.c <<EOF
 static void
 gld${EMULATION_NAME}_before_parse ()
 {
-  ldfile_output_architecture = bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`;
+  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_`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`;
 }
index 888a3ddc61c6c9e796673522e299e1dc7a0fbb34..85ed138d74673cefcee3722947be17e77ace7050 100644 (file)
@@ -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! */
 
@@ -52,7 +57,15 @@ static char *gld${EMULATION_NAME}_get_script PARAMS ((int *isfile));
 static void
 gld${EMULATION_NAME}_before_parse()
 {
-  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};
   config.dynamic_link = true;
   config.has_shared = true;
 }
index 205943b69f7ef51fd001e98062e1c31be59fc1b5..7fc392cae5bfe4c8b6e626470f59a8db48be31d8 100644 (file)
@@ -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_ */
 }
 
index 99c40abd70f313786e13adfecb0098cba129190d..f8dee33aff7db0670884d2374a3edf23fbf3ceba 100644 (file)
@@ -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 <<EOF
@@ -131,7 +136,15 @@ static void
 gld_${EMULATION_NAME}_before_parse()
 {
   output_filename = "${EXECUTABLE_NAME:-a.exe}";
-  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};
 #ifdef DLL_SUPPORT
   config.has_shared = 1;
 
index c98d87e1f7660c43da3f91fabb241999db952a4a..d2f62e98c7ed36e52f5a8480528bfdde457c25ab 100644 (file)
@@ -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! */
 
@@ -85,7 +90,15 @@ static char *gld${EMULATION_NAME}_get_script PARAMS ((int *isfile));
 static void
 gld${EMULATION_NAME}_before_parse()
 {
-  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};
   config.dynamic_link = true;
   config.has_shared = true;
 }