aboutsummaryrefslogtreecommitdiff
path: root/ld/emultempl/elf32.em
diff options
context:
space:
mode:
Diffstat (limited to 'ld/emultempl/elf32.em')
-rw-r--r--ld/emultempl/elf32.em122
1 files changed, 61 insertions, 61 deletions
diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em
index a3af5ca..6261e1d 100644
--- a/ld/emultempl/elf32.em
+++ b/ld/emultempl/elf32.em
@@ -8,7 +8,7 @@ if [ -z "$MACHINE" ]; then
else
OUTPUT_ARCH=${ARCH}:${MACHINE}
fi
-cat >e${EMULATION_NAME}.c <<EOF
+fragment <<EOF
/* This file is is generated by a shell script. DO NOT EDIT! */
/* ${ELFSIZE} bit ELF emulation code for ${EMULATION_NAME}
@@ -70,7 +70,7 @@ EOF
if [ "x${USE_LIBPATH}" = xyes ] ; then
case ${target} in
*-*-linux-* | *-*-k*bsd*-*)
- cat >>e${EMULATION_NAME}.c <<EOF
+ fragment <<EOF
#ifdef HAVE_GLOB
#include <glob.h>
#endif
@@ -81,9 +81,9 @@ fi
# Import any needed special functions and/or overrides.
#
-. ${srcdir}/emultempl/elf-generic.em
+source_em ${srcdir}/emultempl/elf-generic.em
if test -n "$EXTRA_EM_FILE" ; then
-. ${srcdir}/emultempl/${EXTRA_EM_FILE}.em
+ source_em ${srcdir}/emultempl/${EXTRA_EM_FILE}.em
fi
# Functions in this file can be overridden by setting the LDEMUL_* shell
@@ -93,7 +93,7 @@ fi
# as presumably it is called from the overriding function.
#
if test x"$LDEMUL_BEFORE_PARSE" != xgld"$EMULATION_NAME"_before_parse; then
-cat >>e${EMULATION_NAME}.c <<EOF
+fragment <<EOF
static void
gld${EMULATION_NAME}_before_parse (void)
@@ -107,7 +107,7 @@ EOF
fi
if test x"$LDEMUL_RECOGNIZED_FILE" != xgld"${EMULATION_NAME}"_load_symbols; then
-cat >>e${EMULATION_NAME}.c <<EOF
+fragment <<EOF
/* Handle as_needed DT_NEEDED. */
static bfd_boolean
@@ -144,7 +144,7 @@ gld${EMULATION_NAME}_load_symbols (lang_input_statement_type *entry)
EOF
fi
-cat >>e${EMULATION_NAME}.c <<EOF
+fragment <<EOF
/* These variables are required to pass information back and forth
between after_open and check_needed and stat_needed and vercheck. */
@@ -363,7 +363,7 @@ gld${EMULATION_NAME}_try_needed (struct dt_needed *needed,
EOF
case ${target} in
*-*-linux-* | *-*-k*bsd*-*)
- cat >>e${EMULATION_NAME}.c <<EOF
+ fragment <<EOF
{
struct bfd_link_needed_list *l;
@@ -380,7 +380,7 @@ case ${target} in
EOF
;;
esac
-cat >>e${EMULATION_NAME}.c <<EOF
+fragment <<EOF
}
}
@@ -493,7 +493,7 @@ gld${EMULATION_NAME}_search_needed (const char *path,
EOF
if [ "x${USE_LIBPATH}" = xyes ] ; then
- cat >>e${EMULATION_NAME}.c <<EOF
+ fragment <<EOF
/* Add the sysroot to every entry in a path separated by
config.rpath_separator. */
@@ -536,7 +536,7 @@ gld${EMULATION_NAME}_add_sysroot (const char *path)
EOF
case ${target} in
*-*-freebsd* | *-*-dragonfly*)
- cat >>e${EMULATION_NAME}.c <<EOF
+ fragment <<EOF
/* Read the system search path the FreeBSD way rather than the Linux way. */
#ifdef HAVE_ELF_HINTS_H
#include <elf-hints.h>
@@ -598,7 +598,7 @@ EOF
;;
*-*-linux-* | *-*-k*bsd*-*)
- cat >>e${EMULATION_NAME}.c <<EOF
+ fragment <<EOF
/* For a native linker, check the file /etc/ld.so.conf for directories
in which we may find shared libraries. /etc/ld.so.conf is really
only meaningful on Linux. */
@@ -808,7 +808,7 @@ EOF
;;
esac
fi
-cat >>e${EMULATION_NAME}.c <<EOF
+fragment <<EOF
/* See if an input file matches a DT_NEEDED entry by name. */
@@ -860,7 +860,7 @@ gld${EMULATION_NAME}_check_needed (lang_input_statement_type *s)
EOF
if test x"$LDEMUL_AFTER_OPEN" != xgld"$EMULATION_NAME"_after_open; then
-cat >>e${EMULATION_NAME}.c <<EOF
+fragment <<EOF
static bfd_size_type
gld${EMULATION_NAME}_id_note_section_size (bfd *abfd,
@@ -1188,31 +1188,31 @@ gld${EMULATION_NAME}_after_open (void)
search_dirs_type *search;
EOF
if [ "x${NATIVE}" = xyes ] ; then
-cat >>e${EMULATION_NAME}.c <<EOF
+fragment <<EOF
const char *lib_path;
EOF
fi
if [ "x${USE_LIBPATH}" = xyes ] ; then
-cat >>e${EMULATION_NAME}.c <<EOF
+fragment <<EOF
struct bfd_link_needed_list *rp;
int found;
EOF
fi
-cat >>e${EMULATION_NAME}.c <<EOF
+fragment <<EOF
if (gld${EMULATION_NAME}_search_needed (command_line.rpath_link,
&n, force))
break;
EOF
if [ "x${USE_LIBPATH}" = xyes ] ; then
-cat >>e${EMULATION_NAME}.c <<EOF
+fragment <<EOF
if (gld${EMULATION_NAME}_search_needed (command_line.rpath,
&n, force))
break;
EOF
fi
if [ "x${NATIVE}" = xyes ] ; then
-cat >>e${EMULATION_NAME}.c <<EOF
+fragment <<EOF
if (command_line.rpath_link == NULL
&& command_line.rpath == NULL)
{
@@ -1227,7 +1227,7 @@ cat >>e${EMULATION_NAME}.c <<EOF
EOF
fi
if [ "x${USE_LIBPATH}" = xyes ] ; then
-cat >>e${EMULATION_NAME}.c <<EOF
+fragment <<EOF
found = 0;
rp = bfd_elf_get_runpath_list (output_bfd, &link_info);
for (; !found && rp != NULL; rp = rp->next)
@@ -1247,7 +1247,7 @@ fi
if [ "x${USE_LIBPATH}" = xyes ] ; then
case ${target} in
*-*-freebsd* | *-*-dragonfly*)
- cat >>e${EMULATION_NAME}.c <<EOF
+ fragment <<EOF
if (gld${EMULATION_NAME}_check_ld_elf_hints (l->name, force))
break;
EOF
@@ -1256,7 +1256,7 @@ EOF
*-*-linux-* | *-*-k*bsd*-*)
# Linux
- cat >>e${EMULATION_NAME}.c <<EOF
+ fragment <<EOF
if (gld${EMULATION_NAME}_check_ld_so_conf (l->name, force))
break;
@@ -1264,7 +1264,7 @@ EOF
;;
esac
fi
-cat >>e${EMULATION_NAME}.c <<EOF
+fragment <<EOF
len = strlen (l->name);
for (search = search_head; search != NULL; search = search->next)
{
@@ -1282,7 +1282,7 @@ cat >>e${EMULATION_NAME}.c <<EOF
if (search != NULL)
break;
EOF
-cat >>e${EMULATION_NAME}.c <<EOF
+fragment <<EOF
}
if (force < 2)
@@ -1296,7 +1296,7 @@ cat >>e${EMULATION_NAME}.c <<EOF
EOF
fi
-cat >>e${EMULATION_NAME}.c <<EOF
+fragment <<EOF
/* Look through an expression for an assignment statement. */
@@ -1377,7 +1377,7 @@ if test x"$LDEMUL_BEFORE_ALLOCATION" != xgld"$EMULATION_NAME"_before_allocation;
else
ELF_INTERPRETER_SET_DEFAULT=
fi
-cat >>e${EMULATION_NAME}.c <<EOF
+fragment <<EOF
/* This is called after the sections have been attached to output
sections, but before any sizes or addresses have been set. */
@@ -1478,7 +1478,7 @@ EOF
fi
if test x"$LDEMUL_OPEN_DYNAMIC_ARCHIVE" != xgld"$EMULATION_NAME"_open_dynamic_archive; then
-cat >>e${EMULATION_NAME}.c <<EOF
+fragment <<EOF
/* Try to open a dynamic archive. This is where we know that ELF
dynamic libraries have an extension of .so (or .sl on oddball systems
@@ -1557,7 +1557,7 @@ EOF
fi
if test x"$LDEMUL_PLACE_ORPHAN" != xgld"$EMULATION_NAME"_place_orphan; then
-cat >>e${EMULATION_NAME}.c <<EOF
+fragment <<EOF
/* A variant of lang_output_section_find used by place_orphan. */
@@ -1807,7 +1807,7 @@ EOF
fi
if test x"$LDEMUL_FINISH" != xgld"$EMULATION_NAME"_finish; then
-cat >>e${EMULATION_NAME}.c <<EOF
+fragment <<EOF
static void
gld${EMULATION_NAME}_finish (void)
@@ -1821,7 +1821,7 @@ EOF
fi
if test x"$LDEMUL_GET_SCRIPT" != xgld"$EMULATION_NAME"_get_script; then
-cat >>e${EMULATION_NAME}.c <<EOF
+fragment <<EOF
static char *
gld${EMULATION_NAME}_get_script (int *isfile)
@@ -1834,7 +1834,7 @@ then
# sed commands to quote an ld script as a C string.
sc="-f stringify.sed"
-cat >>e${EMULATION_NAME}.c <<EOF
+fragment <<EOF
{
*isfile = 0;
@@ -1888,7 +1888,7 @@ echo '; }' >> e${EMULATION_NAME}.c
else
# Scripts read from the filesystem.
-cat >>e${EMULATION_NAME}.c <<EOF
+fragment <<EOF
{
*isfile = 1;
@@ -1901,14 +1901,14 @@ cat >>e${EMULATION_NAME}.c <<EOF
EOF
if cmp -s ldscripts/${EMULATION_NAME}.x ldscripts/${EMULATION_NAME}.xn; then :
else
-cat >>e${EMULATION_NAME}.c <<EOF
+fragment <<EOF
else if (!config.magic_demand_paged)
return "ldscripts/${EMULATION_NAME}.xn";
EOF
fi
if test -n "$GENERATE_PIE_SCRIPT" ; then
if test -n "$GENERATE_COMBRELOC_SCRIPT" ; then
-cat >>e${EMULATION_NAME}.c <<EOF
+fragment <<EOF
else if (link_info.pie && link_info.combreloc
&& link_info.relro && (link_info.flags & DT_BIND_NOW))
return "ldscripts/${EMULATION_NAME}.xdw";
@@ -1916,14 +1916,14 @@ cat >>e${EMULATION_NAME}.c <<EOF
return "ldscripts/${EMULATION_NAME}.xdc";
EOF
fi
-cat >>e${EMULATION_NAME}.c <<EOF
+fragment <<EOF
else if (link_info.pie)
return "ldscripts/${EMULATION_NAME}.xd";
EOF
fi
if test -n "$GENERATE_SHLIB_SCRIPT" ; then
if test -n "$GENERATE_COMBRELOC_SCRIPT" ; then
-cat >>e${EMULATION_NAME}.c <<EOF
+fragment <<EOF
else if (link_info.shared && link_info.combreloc
&& link_info.relro && (link_info.flags & DT_BIND_NOW))
return "ldscripts/${EMULATION_NAME}.xsw";
@@ -1931,13 +1931,13 @@ cat >>e${EMULATION_NAME}.c <<EOF
return "ldscripts/${EMULATION_NAME}.xsc";
EOF
fi
-cat >>e${EMULATION_NAME}.c <<EOF
+fragment <<EOF
else if (link_info.shared)
return "ldscripts/${EMULATION_NAME}.xs";
EOF
fi
if test -n "$GENERATE_COMBRELOC_SCRIPT" ; then
-cat >>e${EMULATION_NAME}.c <<EOF
+fragment <<EOF
else if (link_info.combreloc && link_info.relro
&& (link_info.flags & DT_BIND_NOW))
return "ldscripts/${EMULATION_NAME}.xw";
@@ -1945,7 +1945,7 @@ cat >>e${EMULATION_NAME}.c <<EOF
return "ldscripts/${EMULATION_NAME}.xc";
EOF
fi
-cat >>e${EMULATION_NAME}.c <<EOF
+fragment <<EOF
else
return "ldscripts/${EMULATION_NAME}.x";
}
@@ -1957,12 +1957,12 @@ fi
if test -n "$PARSE_AND_LIST_ARGS_CASES" -o x"$GENERATE_SHLIB_SCRIPT" = xyes; then
if test -n "$PARSE_AND_LIST_PROLOGUE" ; then
-cat >>e${EMULATION_NAME}.c <<EOF
+fragment <<EOF
$PARSE_AND_LIST_PROLOGUE
EOF
fi
-cat >>e${EMULATION_NAME}.c <<EOF
+fragment <<EOF
#define OPTION_DISABLE_NEW_DTAGS (400)
#define OPTION_ENABLE_NEW_DTAGS (OPTION_DISABLE_NEW_DTAGS + 1)
@@ -1983,7 +1983,7 @@ gld${EMULATION_NAME}_add_options
EOF
if test x"$GENERATE_SHLIB_SCRIPT" = xyes; then
-cat >>e${EMULATION_NAME}.c <<EOF
+fragment <<EOF
{"disable-new-dtags", no_argument, NULL, OPTION_DISABLE_NEW_DTAGS},
{"enable-new-dtags", no_argument, NULL, OPTION_ENABLE_NEW_DTAGS},
{"eh-frame-hdr", no_argument, NULL, OPTION_EH_FRAME_HDR},
@@ -1994,12 +1994,12 @@ EOF
fi
if test -n "$PARSE_AND_LIST_LONGOPTS" ; then
-cat >>e${EMULATION_NAME}.c <<EOF
+fragment <<EOF
$PARSE_AND_LIST_LONGOPTS
EOF
fi
-cat >>e${EMULATION_NAME}.c <<EOF
+fragment <<EOF
{NULL, no_argument, NULL, 0}
};
@@ -2035,7 +2035,7 @@ gld${EMULATION_NAME}_handle_option (int optc)
EOF
if test x"$GENERATE_SHLIB_SCRIPT" = xyes; then
-cat >>e${EMULATION_NAME}.c <<EOF
+fragment <<EOF
case OPTION_DISABLE_NEW_DTAGS:
link_info.new_dtags = FALSE;
break;
@@ -2128,7 +2128,7 @@ cat >>e${EMULATION_NAME}.c <<EOF
EOF
if test -n "$COMMONPAGESIZE"; then
-cat >>e${EMULATION_NAME}.c <<EOF
+fragment <<EOF
else if (strcmp (optarg, "relro") == 0)
link_info.relro = TRUE;
else if (strcmp (optarg, "norelro") == 0)
@@ -2136,7 +2136,7 @@ cat >>e${EMULATION_NAME}.c <<EOF
EOF
fi
-cat >>e${EMULATION_NAME}.c <<EOF
+fragment <<EOF
else if (CONST_STRNEQ (optarg, "max-page-size="))
{
char *end;
@@ -2166,12 +2166,12 @@ EOF
fi
if test -n "$PARSE_AND_LIST_ARGS_CASES" ; then
-cat >>e${EMULATION_NAME}.c <<EOF
+fragment <<EOF
$PARSE_AND_LIST_ARGS_CASES
EOF
fi
-cat >>e${EMULATION_NAME}.c <<EOF
+fragment <<EOF
}
return TRUE;
@@ -2180,7 +2180,7 @@ cat >>e${EMULATION_NAME}.c <<EOF
EOF
if test x"$LDEMUL_LIST_OPTIONS" != xgld"$EMULATION_NAME"_list_options; then
-cat >>e${EMULATION_NAME}.c <<EOF
+fragment <<EOF
static void
gld${EMULATION_NAME}_list_options (FILE * file)
@@ -2189,7 +2189,7 @@ gld${EMULATION_NAME}_list_options (FILE * file)
EOF
if test x"$GENERATE_SHLIB_SCRIPT" = xyes; then
-cat >>e${EMULATION_NAME}.c <<EOF
+fragment <<EOF
fprintf (file, _(" -Bgroup\t\tSelects group name lookup rules for DSO\n"));
fprintf (file, _(" --disable-new-dtags\tDisable new dynamic tags\n"));
fprintf (file, _(" --enable-new-dtags\tEnable new dynamic tags\n"));
@@ -2213,23 +2213,23 @@ cat >>e${EMULATION_NAME}.c <<EOF
EOF
if test -n "$COMMONPAGESIZE"; then
-cat >>e${EMULATION_NAME}.c <<EOF
+fragment <<EOF
fprintf (file, _(" -z norelro\t\tDon't create RELRO program header\n"));
EOF
fi
-cat >>e${EMULATION_NAME}.c <<EOF
+fragment <<EOF
fprintf (file, _(" -z now\t\tMark object non-lazy runtime binding\n"));
fprintf (file, _(" -z origin\t\tMark object requiring immediate \$ORIGIN processing\n\t\t\t at runtime\n"));
EOF
if test -n "$COMMONPAGESIZE"; then
-cat >>e${EMULATION_NAME}.c <<EOF
+fragment <<EOF
fprintf (file, _(" -z relro\t\tCreate RELRO program header\n"));
EOF
fi
-cat >>e${EMULATION_NAME}.c <<EOF
+fragment <<EOF
fprintf (file, _(" -z max-page-size=SIZE\tSet maximum page size to SIZE\n"));
fprintf (file, _(" -z common-page-size=SIZE\n\t\t\tSet common page size to SIZE\n"));
fprintf (file, _(" -z KEYWORD\t\tIgnored for Solaris compatibility\n"));
@@ -2237,34 +2237,34 @@ EOF
fi
if test -n "$PARSE_AND_LIST_OPTIONS" ; then
-cat >>e${EMULATION_NAME}.c <<EOF
+fragment <<EOF
$PARSE_AND_LIST_OPTIONS
EOF
fi
-cat >>e${EMULATION_NAME}.c <<EOF
+fragment <<EOF
}
EOF
if test -n "$PARSE_AND_LIST_EPILOGUE" ; then
-cat >>e${EMULATION_NAME}.c <<EOF
+fragment <<EOF
$PARSE_AND_LIST_EPILOGUE
EOF
fi
fi
else
-cat >>e${EMULATION_NAME}.c <<EOF
+fragment <<EOF
#define gld${EMULATION_NAME}_add_options NULL
#define gld${EMULATION_NAME}_handle_option NULL
EOF
if test x"$LDEMUL_LIST_OPTIONS" != xgld"$EMULATION_NAME"_list_options; then
-cat >>e${EMULATION_NAME}.c <<EOF
+fragment <<EOF
#define gld${EMULATION_NAME}_list_options NULL
EOF
fi
fi
-cat >>e${EMULATION_NAME}.c <<EOF
+fragment <<EOF
struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
{