* 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-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.
/* 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>
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;
/* 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.
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_ */
}
# 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.
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`;
/* 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.
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_ */
}
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
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
/* ${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>
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`;
}
/* 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
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_ */
}
# 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.
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
-/*
+/*
* emulate the Intels port of gld
*/
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);
}
sc="-f stringify.sed"
cat >>e${EMULATION_NAME}.c <<EOF
-{
+{
*isfile = 0;
if (link_info.relocatable && config.build_constructors)
# Scripts read from the filesystem.
cat >>e${EMULATION_NAME}.c <<EOF
-{
+{
*isfile = 1;
if (link_info.relocatable && config.build_constructors)
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,
/* 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>
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;
}
/* 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>.
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_ */
}
/* 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.
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_ */
}
(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
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;
/* 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>
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;
}
(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
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"
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)
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
{
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_ */
}
$s/$/n"/
'
cat >>e${EMULATION_NAME}.c <<EOF
-{
+{
*isfile = 0;
if (link_info.relocatable && config.build_constructors)
return `sed "$sc" ldscripts/${EMULATION_NAME}.xu`;
# Scripts read from the filesystem.
cat >>e${EMULATION_NAME}.c <<EOF
-{
+{
*isfile = 1;
if (link_info.relocatable && config.build_constructors)
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,
/* 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.
if (! realname)
return FALSE;
-
+
len = strlen (realname);
if (((! notsame && len == ld_canon_sysroot_len)
if (yylval.bigint.str)
free (yylval.bigint.str);
break;
- }
+ }
token = yylex ();
}
ldlex_popstate ();
/* 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);
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);
}
/* 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.
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);
| 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