diff options
author | Alan Modra <amodra@gmail.com> | 2004-01-03 11:09:07 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2004-01-03 11:09:07 +0000 |
commit | 5e2f15758b3831ad6fa9f8eee34dbefb689a8d68 (patch) | |
tree | 7366cf53a1fbbce7793b6b5fa0957dd31789ecdb /ld | |
parent | 386c036baa78260724d16fb2672450b09b684dcb (diff) | |
download | gdb-5e2f15758b3831ad6fa9f8eee34dbefb689a8d68.zip gdb-5e2f15758b3831ad6fa9f8eee34dbefb689a8d68.tar.gz gdb-5e2f15758b3831ad6fa9f8eee34dbefb689a8d68.tar.bz2 |
* 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.
Diffstat (limited to 'ld')
-rw-r--r-- | ld/ChangeLog | 21 | ||||
-rw-r--r-- | ld/emultempl/aix.em | 12 | ||||
-rw-r--r-- | ld/emultempl/armcoff.em | 6 | ||||
-rw-r--r-- | ld/emultempl/armelf.em | 4 | ||||
-rw-r--r-- | ld/emultempl/armelf_oabi.em | 6 | ||||
-rw-r--r-- | ld/emultempl/beos.em | 12 | ||||
-rw-r--r-- | ld/emultempl/elf32.em | 12 | ||||
-rw-r--r-- | ld/emultempl/generic.em | 4 | ||||
-rw-r--r-- | ld/emultempl/gld960c.em | 12 | ||||
-rw-r--r-- | ld/emultempl/linux.em | 12 | ||||
-rw-r--r-- | ld/emultempl/m68kcoff.em | 4 | ||||
-rw-r--r-- | ld/emultempl/mipsecoff.em | 12 | ||||
-rw-r--r-- | ld/emultempl/pe.em | 12 | ||||
-rw-r--r-- | ld/emultempl/sunos.em | 14 | ||||
-rw-r--r-- | ld/emultempl/ticoff.em | 18 | ||||
-rw-r--r-- | ld/ldfile.c | 16 | ||||
-rw-r--r-- | ld/ldfile.h | 4 | ||||
-rw-r--r-- | ld/ldgram.y | 2 |
18 files changed, 74 insertions, 109 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index 45877d6..549abb2 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -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. diff --git a/ld/emultempl/aix.em b/ld/emultempl/aix.em index 842911e..513cd50 100644 --- a/ld/emultempl/aix.em +++ b/ld/emultempl/aix.em @@ -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; diff --git a/ld/emultempl/armcoff.em b/ld/emultempl/armcoff.em index 2368b90..468c3b0 100644 --- a/ld/emultempl/armcoff.em +++ b/ld/emultempl/armcoff.em @@ -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_ */ } diff --git a/ld/emultempl/armelf.em b/ld/emultempl/armelf.em index c5c69fc..0c051ad 100644 --- a/ld/emultempl/armelf.em +++ b/ld/emultempl/armelf.em @@ -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`; diff --git a/ld/emultempl/armelf_oabi.em b/ld/emultempl/armelf_oabi.em index f556551..d75c658 100644 --- a/ld/emultempl/armelf_oabi.em +++ b/ld/emultempl/armelf_oabi.em @@ -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_ */ } diff --git a/ld/emultempl/beos.em b/ld/emultempl/beos.em index e2f6099..0431baf 100644 --- a/ld/emultempl/beos.em +++ b/ld/emultempl/beos.em @@ -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"; } diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em index c386be8..9f68a8a 100644 --- a/ld/emultempl/elf32.em +++ b/ld/emultempl/elf32.em @@ -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`; } diff --git a/ld/emultempl/generic.em b/ld/emultempl/generic.em index c33d86b..4d17ca2 100644 --- a/ld/emultempl/generic.em +++ b/ld/emultempl/generic.em @@ -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_ */ } diff --git a/ld/emultempl/gld960c.em b/ld/emultempl/gld960c.em index 89e75ae..ef2293e 100644 --- a/ld/emultempl/gld960c.em +++ b/ld/emultempl/gld960c.em @@ -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, diff --git a/ld/emultempl/linux.em b/ld/emultempl/linux.em index b48549d..d041b68 100644 --- a/ld/emultempl/linux.em +++ b/ld/emultempl/linux.em @@ -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; } diff --git a/ld/emultempl/m68kcoff.em b/ld/emultempl/m68kcoff.em index eefa327..162dcf7 100644 --- a/ld/emultempl/m68kcoff.em +++ b/ld/emultempl/m68kcoff.em @@ -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_ */ } diff --git a/ld/emultempl/mipsecoff.em b/ld/emultempl/mipsecoff.em index c0e8093..dde33c2 100644 --- a/ld/emultempl/mipsecoff.em +++ b/ld/emultempl/mipsecoff.em @@ -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_ */ } diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em index 38120b1..ccf7a8e 100644 --- a/ld/emultempl/pe.em +++ b/ld/emultempl/pe.em @@ -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; diff --git a/ld/emultempl/sunos.em b/ld/emultempl/sunos.em index 80ce2de..358bc9a 100644 --- a/ld/emultempl/sunos.em +++ b/ld/emultempl/sunos.em @@ -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; } diff --git a/ld/emultempl/ticoff.em b/ld/emultempl/ticoff.em index 29b1afb..8f86b04 100644 --- a/ld/emultempl/ticoff.em +++ b/ld/emultempl/ticoff.em @@ -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, diff --git a/ld/ldfile.c b/ld/ldfile.c index cb0a3c3..a6f0d60 100644 --- a/ld/ldfile.c +++ b/ld/ldfile.c @@ -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); } diff --git a/ld/ldfile.h b/ld/ldfile.h index 8b2e6e9..6d5f09d 100644 --- a/ld/ldfile.h +++ b/ld/ldfile.h @@ -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); diff --git a/ld/ldgram.y b/ld/ldgram.y index c00b7af..17717fb 100644 --- a/ld/ldgram.y +++ b/ld/ldgram.y @@ -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 |