# This shell script emits a C file. -*- C -*-
# It does some substitutions.
-cat >em_${EMULATION_NAME}.c <<EOF
+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 (C) 1991 Free Software Foundation, Inc.
+ Copyright (C) 1991, 1993 Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define TARGET_IS_${EMULATION_NAME}
#include "bfd.h"
#include "sysdep.h"
+#include "bfdlink.h"
+
#include "ld.h"
-#include "config.h"
#include "ldemul.h"
#include "ldfile.h"
#include "ldmisc.h"
-
-extern boolean lang_float_flag;
-
-extern enum bfd_architecture ldfile_output_architecture;
-extern unsigned long ldfile_output_machine;
-extern char *ldfile_output_machine_name;
+#include "ldmain.h"
static void
gld${EMULATION_NAME}_before_parse()
{
- extern char *lprefix;
- lprefix = "@";
- lprefix_len = 1;
+ link_info.lprefix = "@";
+ link_info.lprefix_len = 1;
ldfile_output_architecture = bfd_arch_${ARCH};
}
# sed commands to quote an ld script as a C string.
sc='s/["\\]/\\&/g
s/$/\\n\\/
-1s/^/"{/
-$s/$/n}"/
+1s/^/"/
+$s/$/n"/
'
-cat >>em_${EMULATION_NAME}.c <<EOF
+cat >>e${EMULATION_NAME}.c <<EOF
{
- extern ld_config_type config;
-
*isfile = 0;
- if (config.relocateable_output == true && config.build_constructors == true)
+ if (link_info.relocateable == true && config.build_constructors == true)
return `sed "$sc" ldscripts/${EMULATION_NAME}.xu`;
- else if (config.relocateable_output == true)
+ else if (link_info.relocateable == true)
return `sed "$sc" ldscripts/${EMULATION_NAME}.xr`;
else if (!config.text_read_only)
return `sed "$sc" ldscripts/${EMULATION_NAME}.xbn`;
else
# Scripts read from the filesystem.
-cat >>em_${EMULATION_NAME}.c <<EOF
+cat >>e${EMULATION_NAME}.c <<EOF
{
- extern ld_config_type config;
-
*isfile = 1;
- if (config.relocateable_output == true && config.build_constructors == true)
+ if (link_info.relocateable == true && config.build_constructors == true)
return "ldscripts/${EMULATION_NAME}.xu";
- else if (config.relocateable_output == true)
+ else if (link_info.relocateable == true)
return "ldscripts/${EMULATION_NAME}.xr";
else if (!config.text_read_only)
return "ldscripts/${EMULATION_NAME}.xbn";
fi
-cat >>em_${EMULATION_NAME}.c <<EOF
+cat >>e${EMULATION_NAME}.c <<EOF
struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
{
syslib_default,
hll_default,
after_parse_default,
+ after_open_default,
after_allocation_default,
set_output_arch_default,
ldemul_default_target,