# This shell script emits a C file. -*- C -*-
# It does some substitutions.
(echo;echo;echo;echo)>e${EMULATION_NAME}.c # there, now line numbers match ;-)
-cat >>e${EMULATION_NAME}.c <<EOF
+fragment <<EOF
/* This file is part of GLD, the Gnu Linker.
- Copyright 1999, 2000, 2002, 2003, 2004, 2007
- Free Software Foundation, Inc.
+ Copyright (C) 1999-2017 Free Software Foundation, Inc.
This file is part of the GNU Binutils.
static void
gld_${EMULATION_NAME}_list_options (FILE * file)
{
- fprintf (file, _(" --format 0|1|2 Specify which COFF version to use\n"));
+ fprintf (file, _(" --format 0|1|2 Specify which COFF version to use\n"));
}
static bfd_boolean
static char *
gld_${EMULATION_NAME}_get_script (int *isfile)
EOF
-if test -n "$COMPILE_IN"
+if test x"$COMPILE_IN" = xyes
then
# Scripts compiled in.
1s/^/"/
$s/$/n"/
'
-cat >>e${EMULATION_NAME}.c <<EOF
+fragment <<EOF
{
*isfile = 0;
- if (link_info.relocatable && config.build_constructors)
+ if (bfd_link_relocatable (&link_info) && config.build_constructors)
return `sed "$sc" ldscripts/${EMULATION_NAME}.xu`;
- else if (link_info.relocatable)
+ else if (bfd_link_relocatable (&link_info))
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 >>e${EMULATION_NAME}.c <<EOF
+fragment <<EOF
{
*isfile = 1;
- if (link_info.relocatable && config.build_constructors)
+ if (bfd_link_relocatable (&link_info) && config.build_constructors)
return "ldscripts/${EMULATION_NAME}.xu";
- else if (link_info.relocatable)
+ else if (bfd_link_relocatable (&link_info))
return "ldscripts/${EMULATION_NAME}.xr";
else if (!config.text_read_only)
return "ldscripts/${EMULATION_NAME}.xbn";
fi
-cat >>e${EMULATION_NAME}.c <<EOF
+fragment <<EOF
struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
{
gld_${EMULATION_NAME}_before_parse,
gld_${EMULATION_NAME}_list_options,
NULL, /* recognized file */
NULL, /* find_potential_libraries */
- NULL /* new_vers_pattern */
+ NULL, /* new_vers_pattern */
+ NULL /* extra_map_file_text */
};
EOF