* ldfile.c (ldfile_set_output_arch): Add defarch param.
authorAlan Modra <amodra@gmail.com>
Sat, 3 Jan 2004 11:09:07 +0000 (11:09 +0000)
committerAlan Modra <amodra@gmail.com>
Sat, 3 Jan 2004 11:09:07 +0000 (11:09 +0000)
* ldfile.h (ldfile_set_output_arch): Ditto.
* emultempl/aix.em (gld${EMULATION_NAME}_before_parse): Use
ldfile_set_output_arch.
* emultempl/beos.em (gld${EMULATION_NAME}_before_parse): Ditto.
* emultempl/elf32.em (gld${EMULATION_NAME}_before_parse): Ditto.
* emultempl/linux.em (gld${EMULATION_NAME}_before_parse): Ditto.
* emultempl/mipsecoff.em (gld${EMULATION_NAME}_before_parse): Ditto.
* emultempl/pe.em (gld${EMULATION_NAME}_before_parse): Ditto.
* emultempl/sunos.em (gld${EMULATION_NAME}_before_parse): Ditto.
* ldgram.y: Adjust ldfile_set_output_arch call.
* emultempl/armcoff.em (gld${EMULATION_NAME}_before_parse): Ditto.
* emultempl/armelf.em (gld${EMULATION_NAME}_before_parse): Ditto.
* emultempl/armelf_oabi.em (gld${EMULATION_NAME}_before_parse): Ditto.
* emultempl/generic.em (gld${EMULATION_NAME}_before_parse): Ditto.
* emultempl/gld960c.em (gld960_set_output_arch): Ditto.
* emultempl/m68kcoff.em (gld${EMULATION_NAME}_before_parse): Ditto.
* emultempl/ticoff.em (gld${EMULATION_NAME}_before_parse): Ditto.

18 files changed:
ld/ChangeLog
ld/emultempl/aix.em
ld/emultempl/armcoff.em
ld/emultempl/armelf.em
ld/emultempl/armelf_oabi.em
ld/emultempl/beos.em
ld/emultempl/elf32.em
ld/emultempl/generic.em
ld/emultempl/gld960c.em
ld/emultempl/linux.em
ld/emultempl/m68kcoff.em
ld/emultempl/mipsecoff.em
ld/emultempl/pe.em
ld/emultempl/sunos.em
ld/emultempl/ticoff.em
ld/ldfile.c
ld/ldfile.h
ld/ldgram.y

index 45877d63970f46e4de313d791f05e82c13257188..549abb2a8365789d4426735768d201418179e517 100644 (file)
@@ -1,3 +1,24 @@
+2004-01-03  Alan Modra  <amodra@bigpond.net.au>
+
+       * ldfile.c (ldfile_set_output_arch): Add defarch param.
+       * ldfile.h (ldfile_set_output_arch): Ditto.
+       * emultempl/aix.em (gld${EMULATION_NAME}_before_parse): Use
+       ldfile_set_output_arch.
+       * emultempl/beos.em (gld${EMULATION_NAME}_before_parse): Ditto.
+       * emultempl/elf32.em (gld${EMULATION_NAME}_before_parse): Ditto.
+       * emultempl/linux.em (gld${EMULATION_NAME}_before_parse): Ditto.
+       * emultempl/mipsecoff.em (gld${EMULATION_NAME}_before_parse): Ditto.
+       * emultempl/pe.em (gld${EMULATION_NAME}_before_parse): Ditto.
+       * emultempl/sunos.em (gld${EMULATION_NAME}_before_parse): Ditto.
+       * ldgram.y: Adjust ldfile_set_output_arch call.
+       * emultempl/armcoff.em (gld${EMULATION_NAME}_before_parse): Ditto.
+       * emultempl/armelf.em (gld${EMULATION_NAME}_before_parse): Ditto.
+       * emultempl/armelf_oabi.em (gld${EMULATION_NAME}_before_parse): Ditto.
+       * emultempl/generic.em (gld${EMULATION_NAME}_before_parse): Ditto.
+       * emultempl/gld960c.em (gld960_set_output_arch): Ditto.
+       * emultempl/m68kcoff.em (gld${EMULATION_NAME}_before_parse): Ditto.
+       * emultempl/ticoff.em (gld${EMULATION_NAME}_before_parse): Ditto.
+
 2004-01-02  Bernardo Innocenti  <bernie@develer.com>
 
        * configure.tgt: Add m68k-uClinux target.
index 842911e2c48422040bd173ee13a614cbe7fc6244..513cd50d8594b3cd81c9f402c68ee06d42074727 100644 (file)
@@ -9,7 +9,7 @@ cat >e${EMULATION_NAME}.c <<EOF
 /* This file is is generated by a shell script.  DO NOT EDIT! */
 
 /* AIX emulation code for ${EMULATION_NAME}
-   Copyright 1991, 1993, 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003
+   Copyright 1991, 1993, 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
    Written by Steve Chamberlain <sac@cygnus.com>
    AIX support by Ian Lance Taylor <ian@cygnus.com>
@@ -133,15 +133,7 @@ static char *command_line_blibpath = NULL;
 static void
 gld${EMULATION_NAME}_before_parse (void)
 {
-  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/:.*//'`;
+  ldfile_set_output_arch ("${OUTPUT_ARCH}", bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`);
 
   config.has_shared = TRUE;
 
index 2368b909a87807a4e31027937ea8a1ba8576e4d2..468c3b08beb7a68f791c1255e32cef1f5129d408 100644 (file)
@@ -4,8 +4,8 @@ cat >e${EMULATION_NAME}.c <<EOF
 /* This file is is generated by a shell script.  DO NOT EDIT! */
 
 /* emulate the original gld for the given ${EMULATION_NAME}
-   Copyright 1991, 1993, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
-   Free Software Foundation, Inc.
+   Copyright 1991, 1993, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
+   2004 Free Software Foundation, Inc.
    Written by Steve Chamberlain steve@cygnus.com
 
 This file is part of GLD, the Gnu Linker.
@@ -97,7 +97,7 @@ static void
 gld${EMULATION_NAME}_before_parse (void)
 {
 #ifndef TARGET_                        /* I.e., if not generic.  */
-  ldfile_set_output_arch ("`echo ${ARCH}`");
+  ldfile_set_output_arch ("`echo ${ARCH}`", bfd_arch_unknown);
 #endif /* not TARGET_ */
 }
 
index c5c69fc49edb2f90aa48ae23876ba32c3f7233fd..0c051ad62b89e2d0a8639d058a07ad601ba55d52 100644 (file)
@@ -1,5 +1,5 @@
 # This shell script emits a C file. -*- C -*-
-#   Copyright 1991, 1993, 1996, 1997, 1998, 1999, 2000, 2002, 2003
+#   Copyright 1991, 1993, 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004
 #   Free Software Foundation, Inc.
 #
 # This file is part of GLD, the Gnu Linker.
@@ -32,7 +32,7 @@ static void
 gld${EMULATION_NAME}_before_parse (void)
 {
 #ifndef TARGET_                        /* I.e., if not generic.  */
-  ldfile_set_output_arch ("`echo ${ARCH}`");
+  ldfile_set_output_arch ("`echo ${ARCH}`", bfd_arch_unknown);
 #endif /* not TARGET_ */
   config.dynamic_link = ${DYNAMIC_LINK-TRUE};
   config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo TRUE ; else echo FALSE ; fi`;
index f556551fbda55b1bcc019db852859db0a58e2e6a..d75c65863308dbcbe60ea8e4f21bf15b733b1832 100644 (file)
@@ -4,8 +4,8 @@ cat >e${EMULATION_NAME}.c <<EOF
 /* This file is is generated by a shell script.  DO NOT EDIT! */
 
 /* emulate the original gld for the given ${EMULATION_NAME}
-   Copyright 1991, 1993, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
-   Free Software Foundation, Inc.
+   Copyright 1991, 1993, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
+   2004 Free Software Foundation, Inc.
    Written by Steve Chamberlain steve@cygnus.com
 
 This file is part of GLD, the Gnu Linker.
@@ -51,7 +51,7 @@ static void
 gld${EMULATION_NAME}_before_parse (void)
 {
 #ifndef TARGET_                        /* I.e., if not generic.  */
-  ldfile_set_output_arch ("`echo ${ARCH}`");
+  ldfile_set_output_arch ("`echo ${ARCH}`", bfd_arch_unknown);
 #endif /* not TARGET_ */
 }
 
index e2f609903431dfd33ad38f69d00b70c4ed1c6066..0431baf7cca89571159dc9be5e693b4867933f79 100644 (file)
@@ -7,7 +7,7 @@ else
 fi
 cat >e${EMULATION_NAME}.c <<EOF
 /* This file is part of GLD, the Gnu Linker.
-   Copyright 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003
+   Copyright 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
 
 This program is free software; you can redistribute it and/or modify
@@ -59,15 +59,7 @@ extern const char *output_filename;
 static void
 gld_${EMULATION_NAME}_before_parse (void)
 {
-  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};
+  ldfile_set_output_arch ("${OUTPUT_ARCH}", bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`);
   output_filename = "a.exe";
 }
 \f
index c386be8ce2fbb01ff30b1186fbd20dfda0c616f1..9f68a8a2116e593187187c174db8622a2e807e3c 100644 (file)
@@ -13,7 +13,7 @@ cat >e${EMULATION_NAME}.c <<EOF
 
 /* ${ELFSIZE} bit ELF emulation code for ${EMULATION_NAME}
    Copyright 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-   2002, 2003 Free Software Foundation, Inc.
+   2002, 2003, 2004 Free Software Foundation, Inc.
    Written by Steve Chamberlain <sac@cygnus.com>
    ELF support by Ian Lance Taylor <ian@cygnus.com>
 
@@ -81,15 +81,7 @@ cat >>e${EMULATION_NAME}.c <<EOF
 static void
 gld${EMULATION_NAME}_before_parse (void)
 {
-  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/:.*//'`;
+  ldfile_set_output_arch ("${OUTPUT_ARCH}", 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 c33d86b098ce2c6a5e3f62700c948a3a2f5ec503..4d17ca261ab67614ea39bf26e780f0a74b80fb27 100644 (file)
@@ -4,7 +4,7 @@ cat >e${EMULATION_NAME}.c <<EOF
 /* This file is is generated by a shell script.  DO NOT EDIT! */
 
 /* emulate the original gld for the given ${EMULATION_NAME}
-   Copyright 1991, 1992, 1994, 1996, 2000, 2001, 2002, 2003
+   Copyright 1991, 1992, 1994, 1996, 2000, 2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
    Written by Steve Chamberlain steve@cygnus.com
 
@@ -54,7 +54,7 @@ static void
 gld${EMULATION_NAME}_before_parse (void)
 {
 #ifndef TARGET_                        /* I.e., if not generic.  */
-  ldfile_set_output_arch ("`echo ${ARCH}`");
+  ldfile_set_output_arch ("`echo ${ARCH}`", bfd_arch_unknown);
 #endif /* not TARGET_ */
 }
 
index 89e75aee6fd550e3fc025daa40a725636d6ed0b0..ef2293e7806c80407e4979414accdab022fe307a 100644 (file)
@@ -1,7 +1,7 @@
 # This shell script emits a C file. -*- C -*-
 # It does some substitutions.
 cat >e${EMULATION_NAME}.c <<EOF
-/* Copyright 1991, 1993, 1994, 1996, 1999, 2000, 2001, 2002, 2003
+/* Copyright 1991, 1993, 1994, 1996, 1999, 2000, 2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
 
 This file is part of GLD, the Gnu Linker.
@@ -21,7 +21,7 @@ along with GLD; see the file COPYING.  If not, write to the Free
 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 02111-1307, USA.  */
 
-/* 
+/*
  * emulate the Intels port of  gld
  */
 
@@ -92,7 +92,7 @@ gld960_set_output_arch (void)
       s = concat ("i960:", ldfile_output_machine_name, (char *) NULL);
       for (s1 = s; *s1 != '\0'; s1++)
        *s1 = TOLOWER (*s1);
-      ldfile_set_output_arch (s);
+      ldfile_set_output_arch (s, bfd_arch_unknown);
       free (s);
     }
 
@@ -132,7 +132,7 @@ then
 sc="-f stringify.sed"
 
 cat >>e${EMULATION_NAME}.c <<EOF
-{                           
+{
   *isfile = 0;
 
   if (link_info.relocatable && config.build_constructors)
@@ -153,7 +153,7 @@ else
 # Scripts read from the filesystem.
 
 cat >>e${EMULATION_NAME}.c <<EOF
-{                           
+{
   *isfile = 1;
 
   if (link_info.relocatable && config.build_constructors)
@@ -173,7 +173,7 @@ fi
 
 cat >>e${EMULATION_NAME}.c <<EOF
 
-struct ld_emulation_xfer_struct ld_gld960coff_emulation = 
+struct ld_emulation_xfer_struct ld_gld960coff_emulation =
 {
   gld960_before_parse,
   syslib_default,
index b48549dd5bef249cbd2e2606d61e145281aac5b1..d041b681df65b9fac2d7153fdbc99f68c557a6f8 100644 (file)
@@ -9,7 +9,7 @@ cat >e${EMULATION_NAME}.c <<EOF
 /* This file is is generated by a shell script.  DO NOT EDIT! */
 
 /* Linux a.out emulation code for ${EMULATION_NAME}
-   Copyright 1991, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2002, 2003
+   Copyright 1991, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2002, 2003, 2004
    Free Software Foundation, Inc.
    Written by Steve Chamberlain <sac@cygnus.com>
    Linux support by Eric Youngdale <ericy@cais.cais.com>
@@ -47,15 +47,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 static void
 gld${EMULATION_NAME}_before_parse (void)
 {
-  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};
+  ldfile_set_output_arch ("${OUTPUT_ARCH}", bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`);
   config.dynamic_link = TRUE;
   config.has_shared = TRUE;
 }
index eefa32746b7515b00c34960b6fc618ef13c55228..162dcf7ed7ad8a67f675b0a59ed094fd015b72a1 100644 (file)
@@ -4,7 +4,7 @@ cat >e${EMULATION_NAME}.c <<EOF
 /* This file is is generated by a shell script.  DO NOT EDIT! */
 
 /* Handle embedded relocs for m68k.
-   Copyright 2000, 2002, 2003 Free Software Foundation, Inc.
+   Copyright 2000, 2002, 2003, 2004 Free Software Foundation, Inc.
    Written by Michael Sokolov <msokolov@ivan.Harhan.ORG>, based on generic.em
    by Steve Chamberlain <steve@cygnus.com>, embedded relocs code based on
    mipsecoff.em by Ian Lance Taylor <ian@cygnus.com>.
@@ -43,7 +43,7 @@ static void
 gld${EMULATION_NAME}_before_parse (void)
 {
 #ifndef TARGET_                        /* I.e., if not generic.  */
-  ldfile_set_output_arch ("`echo ${ARCH}`");
+  ldfile_set_output_arch ("`echo ${ARCH}`", bfd_arch_unknown);
 #endif /* not TARGET_ */
 }
 
index c0e8093ef7ec1c940c5ce7cee0fa67a0d053f6e2..dde33c24be5581d6439efe0132e6d9730e08230e 100644 (file)
@@ -9,7 +9,7 @@ cat >e${EMULATION_NAME}.c <<EOF
 /* This file is is generated by a shell script.  DO NOT EDIT! */
 
 /* Handle embedded relocs for MIPS.
-   Copyright 1994, 1995, 1997, 2000, 2002, 2003
+   Copyright 1994, 1995, 1997, 2000, 2002, 2003, 2004
    Free Software Foundation, Inc.
    Written by Ian Lance Taylor <ian@cygnus.com> based on generic.em.
 
@@ -50,15 +50,7 @@ static void
 gld${EMULATION_NAME}_before_parse (void)
 {
 #ifndef TARGET_                        /* I.e., if not generic.  */
-  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};
+  ldfile_set_output_arch ("${OUTPUT_ARCH}", bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`);
 #endif /* not TARGET_ */
 }
 
index 38120b101bde9f8ab36e2df935af01c717fdf406..ccf7a8e9f4f6c12d7189383205f232e39b255508 100644 (file)
@@ -9,7 +9,7 @@ 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
 /* This file is part of GLD, the Gnu Linker.
-   Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+   Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
@@ -123,15 +123,7 @@ extern const char *output_filename;
 static void
 gld_${EMULATION_NAME}_before_parse (void)
 {
-  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};
+  ldfile_set_output_arch ("${OUTPUT_ARCH}", bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`);
   output_filename = "${EXECUTABLE_NAME:-a.exe}";
 #ifdef DLL_SUPPORT
   config.dynamic_link = TRUE;
index 80ce2de643bee7dd3c146ad7f10bb6884bb59e8f..358bc9aabb96cbdc3d514e32be55cbd777bf5a4e 100644 (file)
@@ -9,8 +9,8 @@ cat >e${EMULATION_NAME}.c <<EOF
 /* This file is is generated by a shell script.  DO NOT EDIT! */
 
 /* SunOS emulation code for ${EMULATION_NAME}
-   Copyright 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003
-   Free Software Foundation, Inc.
+   Copyright 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002,
+   2003, 2004 Free Software Foundation, Inc.
    Written by Steve Chamberlain <sac@cygnus.com>
    SunOS shared library support by Ian Lance Taylor <ian@cygnus.com>
 
@@ -83,15 +83,7 @@ static void gld${EMULATION_NAME}_set_need
 static void
 gld${EMULATION_NAME}_before_parse (void)
 {
-  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};
+  ldfile_set_output_arch ("${OUTPUT_ARCH}", bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`);
   config.dynamic_link = TRUE;
   config.has_shared = TRUE;
 }
index 29b1afb1863f352becc5c8ea25cc2a696d85ec2b..8f86b04f0c7cd7847f3dba09bd503fb2456678ea 100644 (file)
@@ -3,7 +3,7 @@
 (echo;echo;echo;echo)>e${EMULATION_NAME}.c # there, now line numbers match ;-)
 cat >>e${EMULATION_NAME}.c <<EOF
 /* This file is part of GLD, the Gnu Linker.
-   Copyright 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
+   Copyright 1999, 2000, 2002, 2003, 2004 Free Software Foundation, Inc.
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -20,8 +20,8 @@ along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 /* For TI COFF */
-/* Need to determine load and run pages for output sections */ 
-  
+/* Need to determine load and run pages for output sections */
+
 #define TARGET_IS_${EMULATION_NAME}
 
 #include "bfd.h"
@@ -63,7 +63,7 @@ static void
 gld_${EMULATION_NAME}_list_options (FILE * file)
 {
   fprintf (file, _("  --format 0|1|2         Specify which COFF version to use\n"));
-}                                
+}
 
 static bfd_boolean
 gld${EMULATION_NAME}_handle_option (int optc)
@@ -80,7 +80,7 @@ gld${EMULATION_NAME}_handle_option (int optc)
         static char buf[] = "coffX-${OUTPUT_FORMAT_TEMPLATE}";
         coff_version = *optarg - '0';
         buf[4] = *optarg;
-       lang_add_output_format (buf, NULL, NULL, 0);    
+       lang_add_output_format (buf, NULL, NULL, 0);
       }
       else
         {
@@ -95,7 +95,7 @@ static void
 gld_${EMULATION_NAME}_before_parse(void)
 {
 #ifndef TARGET_                        /* I.e., if not generic.  */
-  ldfile_set_output_arch ("`echo ${ARCH}`");
+  ldfile_set_output_arch ("`echo ${ARCH}`", bfd_arch_unknown);
 #endif /* not TARGET_ */
 }
 
@@ -113,7 +113,7 @@ s/$/\\n\\/
 $s/$/n"/
 '
 cat >>e${EMULATION_NAME}.c <<EOF
-{                           
+{
   *isfile = 0;
   if (link_info.relocatable && config.build_constructors)
     return `sed "$sc" ldscripts/${EMULATION_NAME}.xu`;
@@ -132,7 +132,7 @@ else
 # Scripts read from the filesystem.
 
 cat >>e${EMULATION_NAME}.c <<EOF
-{                           
+{
   *isfile = 1;
 
   if (link_info.relocatable && config.build_constructors)
@@ -151,7 +151,7 @@ EOF
 fi
 
 cat >>e${EMULATION_NAME}.c <<EOF
-struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation = 
+struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
 {
   gld_${EMULATION_NAME}_before_parse,
   syslib_default,
index cb0a3c384ae916e9ad7e02ec5a98a956a01eab25..a6f0d603dde45093ef30c84562c71e2a7a54c133 100644 (file)
@@ -1,6 +1,6 @@
 /* Linker file opening and searching.
-   Copyright 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2001, 2002, 2003
-   Free Software Foundation, Inc.
+   Copyright 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2001, 2002,
+   2003, 2004 Free Software Foundation, Inc.
 
    This file is part of GLD, the Gnu Linker.
 
@@ -81,7 +81,7 @@ is_sysrooted_pathname (const char *name, bfd_boolean notsame)
 
   if (! realname)
     return FALSE;
-  
+
   len = strlen (realname);
 
   if (((! notsame && len == ld_canon_sysroot_len)
@@ -246,7 +246,7 @@ ldfile_try_open_bfd (const char *attempt,
                          if (yylval.bigint.str)
                            free (yylval.bigint.str);
                          break;
-                       }
+                       }
                      token = yylex ();
                    }
                  ldlex_popstate ();
@@ -579,7 +579,7 @@ ldfile_add_arch (const char *in_name)
 /* Set the output architecture.  */
 
 void
-ldfile_set_output_arch (const char *string)
+ldfile_set_output_arch (const char *string, enum bfd_architecture defarch)
 {
   const bfd_arch_info_type *arch = bfd_scan_arch (string);
 
@@ -589,8 +589,8 @@ ldfile_set_output_arch (const char *string)
       ldfile_output_machine = arch->mach;
       ldfile_output_machine_name = arch->printable_name;
     }
+  else if (defarch != bfd_arch_unknown)
+    ldfile_output_architecture = defarch;
   else
-    {
-      einfo (_("%P%F: cannot represent machine `%s'\n"), string);
-    }
+    einfo (_("%P%F: cannot represent machine `%s'\n"), string);
 }
index 8b2e6e99c592baa96c84fc572f56566b8fdb0bd8..6d5f09d11834421dda6e86703a02ab5f7bef653f 100644 (file)
@@ -1,5 +1,5 @@
 /* ldfile.h -
-   Copyright 1991, 1992, 1993, 1994, 1995, 2000, 2002, 2003
+   Copyright 1991, 1992, 1993, 1994, 1995, 2000, 2002, 2003, 2004
    Free Software Foundation, Inc.
 
    This file is part of GLD, the Gnu Linker.
@@ -57,7 +57,7 @@ extern bfd_boolean ldfile_try_open_bfd
 extern FILE *ldfile_find_command_file
   (const char *name, const char *extend);
 extern void ldfile_set_output_arch
-  (const char *);
+  (const char *, enum bfd_architecture);
 extern bfd_boolean ldfile_open_file_search
   (const char *arch, struct lang_input_statement_struct *,
    const char *lib, const char *suffix);
index c00b7af617b8831d2be95d5eea1f6367f498b0cc..17717fbbbb3dd8130f26ddfceac461ab7a77144e 100644 (file)
@@ -328,7 +328,7 @@ ifile_p1:
        |       OUTPUT_FORMAT '(' NAME ',' NAME ',' NAME ')'
                  { lang_add_output_format ($3, $5, $7, 1); }
         |      OUTPUT_ARCH '(' NAME ')'
-                 { ldfile_set_output_arch($3); }
+                 { ldfile_set_output_arch ($3, bfd_arch_unknown); }
        |       FORCE_COMMON_ALLOCATION
                { command_line.force_common_definition = TRUE ; }
        |       INHIBIT_COMMON_ALLOCATION
This page took 0.037619 seconds and 4 git commands to generate.