* 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.
This commit is contained in:
Alan Modra 2004-01-03 11:09:07 +00:00
parent 386c036baa
commit 5e2f15758b
18 changed files with 74 additions and 109 deletions

View 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.

View 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;

View 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_ */
}

View 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`;

View 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_ */
}

View 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";
}

View 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`;
}

View 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_ */
}

View 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,

View 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;
}

View 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_ */
}

View 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_ */
}

View 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;

View 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;
}

View 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,

View 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);
}

View 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);

View 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