return true;
}
-
-struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation = {
- gld${EMULATION_NAME}_before_parse,
- syslib_default,
- hll_default,
- after_parse_default,
- gld${EMULATION_NAME}_after_open,
- after_check_relocs_default,
- before_place_orphans_default,
- after_allocation_default,
- gld${EMULATION_NAME}_set_output_arch,
- gld${EMULATION_NAME}_choose_target,
- gld${EMULATION_NAME}_before_allocation,
- gld${EMULATION_NAME}_get_script,
- "${EMULATION_NAME}",
- "${OUTPUT_FORMAT}",
- finish_default,
- gld${EMULATION_NAME}_create_output_section_statements,
- gld${EMULATION_NAME}_open_dynamic_archive,
- 0, /* place_orphan */
- 0, /* set_symbols */
- gld${EMULATION_NAME}_parse_args,
- gld${EMULATION_NAME}_add_options,
- gld${EMULATION_NAME}_handle_option,
- gld${EMULATION_NAME}_unrecognized_file,
- NULL, /* list_options */
- NULL, /* recognized_file */
- NULL, /* find potential_libraries */
- NULL, /* new_vers_pattern */
- NULL, /* extra_map_file_text */
- ${LDEMUL_EMIT_CTF_EARLY-NULL},
- ${LDEMUL_ACQUIRE_STRINGS_FOR_CTF-NULL},
- ${LDEMUL_NEW_DYNSYM_FOR_CTF-NULL},
- gld${EMULATION_NAME}_print_symbol
-};
EOF
+
+LDEMUL_AFTER_OPEN=gld${EMULATION_NAME}_after_open
+LDEMUL_SET_OUTPUT_ARCH=gld${EMULATION_NAME}_set_output_arch
+LDEMUL_CHOOSE_TARGET=gld${EMULATION_NAME}_choose_target
+LDEMUL_BEFORE_ALLOCATION=gld${EMULATION_NAME}_before_allocation
+LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS=gld${EMULATION_NAME}_create_output_section_statements
+LDEMUL_OPEN_DYNAMIC_ARCHIVE=gld${EMULATION_NAME}_open_dynamic_archive
+LDEMUL_PARSE_ARGS=gld${EMULATION_NAME}_parse_args
+LDEMUL_ADD_OPTIONS=gld${EMULATION_NAME}_add_options
+LDEMUL_HANDLE_OPTION=gld${EMULATION_NAME}_handle_option
+LDEMUL_UNRECOGNIZED_FILE=gld${EMULATION_NAME}_unrecognized_file
+LDEMUL_PRINT_SYMBOL=gld${EMULATION_NAME}_print_symbol
+
+source_em ${srcdir}/emultempl/emulation.em
extern const char *output_filename;
static void
-gld_${EMULATION_NAME}_before_parse (void)
+gld${EMULATION_NAME}_before_parse (void)
{
ldfile_set_output_arch ("${OUTPUT_ARCH}", bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`);
output_filename = "a.exe";
read. */
static void
-gld_${EMULATION_NAME}_set_symbols (void)
+gld${EMULATION_NAME}_set_symbols (void)
{
/* Run through and invent symbols for all the
names and insert the defaults. */
}
static void
-gld_${EMULATION_NAME}_after_open (void)
+gld${EMULATION_NAME}_after_open (void)
{
after_open_default ();
}
static void
-gld_${EMULATION_NAME}_before_allocation (void)
+gld${EMULATION_NAME}_before_allocation (void)
{
#ifdef TARGET_IS_armpe
/* FIXME: we should be able to set the size of the interworking stub
}
\f
static char *
-gld_${EMULATION_NAME}_get_script (int *isfile)
+gld${EMULATION_NAME}_get_script (int *isfile)
EOF
if test x"$COMPILE_IN" = xyes
EOF
fi
-fragment <<EOF
-
+LDEMUL_AFTER_OPEN=gld${EMULATION_NAME}_after_open
+LDEMUL_BEFORE_ALLOCATION=gld${EMULATION_NAME}_before_allocation
+LDEMUL_PLACE_ORPHAN=gld${EMULATION_NAME}_place_orphan
+LDEMUL_SET_SYMBOLS=gld${EMULATION_NAME}_set_symbols
+LDEMUL_ADD_OPTIONS=gld${EMULATION_NAME}_add_options
+LDEMUL_HANDLE_OPTION=gld${EMULATION_NAME}_handle_option
-struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
-{
- gld_${EMULATION_NAME}_before_parse,
- syslib_default,
- hll_default,
- after_parse_default,
- gld_${EMULATION_NAME}_after_open,
- after_check_relocs_default,
- before_place_orphans_default,
- after_allocation_default,
- set_output_arch_default,
- ldemul_default_target,
- gld_${EMULATION_NAME}_before_allocation,
- gld_${EMULATION_NAME}_get_script,
- "${EMULATION_NAME}",
- "${OUTPUT_FORMAT}",
- finish_default,
- NULL, /* create output section statements */
- NULL, /* open dynamic archive */
- gld${EMULATION_NAME}_place_orphan,
- gld_${EMULATION_NAME}_set_symbols,
- NULL, /* parse_args */
- gld${EMULATION_NAME}_add_options,
- gld${EMULATION_NAME}_handle_option,
- NULL, /* unrecognized file */
- NULL, /* list options */
- NULL, /* recognized file */
- NULL, /* find_potential_libraries */
- NULL, /* new_vers_pattern */
- NULL, /* extra_map_file_text */
- ${LDEMUL_EMIT_CTF_EARLY-NULL},
- ${LDEMUL_ACQUIRE_STRINGS_FOR_CTF-NULL},
- ${LDEMUL_NEW_DYNSYM_FOR_CTF-NULL},
- ${LDEMUL_PRINT_SYMBOL-NULL}
-};
-EOF
+source_em ${srcdir}/emultempl/emulation.em
fi
fi
-fragment <<EOF
-
-struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
-{
- ${LDEMUL_BEFORE_PARSE-gld${EMULATION_NAME}_before_parse},
- ${LDEMUL_SYSLIB-syslib_default},
- ${LDEMUL_HLL-hll_default},
- ${LDEMUL_AFTER_PARSE-ldelf_after_parse},
- ${LDEMUL_AFTER_OPEN-gld${EMULATION_NAME}_after_open},
- ${LDEMUL_AFTER_CHECK_RELOCS-after_check_relocs_default},
- ${LDEMUL_BEFORE_PLACE_ORPHANS-ldelf_before_place_orphans},
- ${LDEMUL_AFTER_ALLOCATION-gld${EMULATION_NAME}_after_allocation},
- ${LDEMUL_SET_OUTPUT_ARCH-ldelf_set_output_arch},
- ${LDEMUL_CHOOSE_TARGET-ldemul_default_target},
- ${LDEMUL_BEFORE_ALLOCATION-gld${EMULATION_NAME}_before_allocation},
- ${LDEMUL_GET_SCRIPT-gld${EMULATION_NAME}_get_script},
- "${EMULATION_NAME}",
- "${OUTPUT_FORMAT}",
- ${LDEMUL_FINISH-finish_default},
- ${LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS-NULL},
- ${LDEMUL_OPEN_DYNAMIC_ARCHIVE-ldelf_open_dynamic_archive},
- ${LDEMUL_PLACE_ORPHAN-ldelf_place_orphan},
- ${LDEMUL_SET_SYMBOLS-NULL},
- ${LDEMUL_PARSE_ARGS-NULL},
- gld${EMULATION_NAME}_add_options,
- gld${EMULATION_NAME}_handle_option,
- ${LDEMUL_UNRECOGNIZED_FILE-NULL},
- ${LDEMUL_LIST_OPTIONS-${gld_list_options}},
- ${LDEMUL_RECOGNIZED_FILE-ldelf_load_symbols},
- ${LDEMUL_FIND_POTENTIAL_LIBRARIES-NULL},
- ${LDEMUL_NEW_VERS_PATTERN-NULL},
- ${LDEMUL_EXTRA_MAP_FILE_TEXT-NULL},
- ${LDEMUL_EMIT_CTF_EARLY-NULL},
- ${LDEMUL_ACQUIRE_STRINGS_FOR_CTF-NULL},
- ${LDEMUL_NEW_DYNSYM_FOR_CTF-NULL},
- ${LDEMUL_PRINT_SYMBOL-NULL}
-};
-EOF
+LDEMUL_AFTER_PARSE=${LDEMUL_AFTER_PARSE-ldelf_after_parse}
+LDEMUL_AFTER_OPEN=${LDEMUL_AFTER_OPEN-gld${EMULATION_NAME}_after_open}
+LDEMUL_BEFORE_PLACE_ORPHANS=${LDEMUL_BEFORE_PLACE_ORPHANS-ldelf_before_place_orphans}
+LDEMUL_AFTER_ALLOCATION=${LDEMUL_AFTER_ALLOCATION-gld${EMULATION_NAME}_after_allocation}
+LDEMUL_SET_OUTPUT_ARCH=${LDEMUL_SET_OUTPUT_ARCH-ldelf_set_output_arch}
+LDEMUL_BEFORE_ALLOCATION=${LDEMUL_BEFORE_ALLOCATION-gld${EMULATION_NAME}_before_allocation}
+LDEMUL_OPEN_DYNAMIC_ARCHIVE=${LDEMUL_OPEN_DYNAMIC_ARCHIVE-ldelf_open_dynamic_archive}
+LDEMUL_PLACE_ORPHAN=${LDEMUL_PLACE_ORPHAN-ldelf_place_orphan}
+LDEMUL_ADD_OPTIONS=gld${EMULATION_NAME}_add_options
+LDEMUL_HANDLE_OPTION=gld${EMULATION_NAME}_handle_option
+LDEMUL_LIST_OPTIONS=${LDEMUL_LIST_OPTIONS-${gld_list_options}}
+LDEMUL_RECOGNIZED_FILE=${LDEMUL_RECOGNIZED_FILE-ldelf_load_symbols}
+
+source_em ${srcdir}/emultempl/emulation.em
--- /dev/null
+# This shell script emits a C file. -*- C -*-
+# It does some substitutions.
+fragment <<EOF
+
+struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
+{
+ ${LDEMUL_BEFORE_PARSE-gld${EMULATION_NAME}_before_parse},
+ ${LDEMUL_SYSLIB-syslib_default},
+ ${LDEMUL_HLL-hll_default},
+ ${LDEMUL_AFTER_PARSE-after_parse_default},
+ ${LDEMUL_AFTER_OPEN-after_open_default},
+ ${LDEMUL_AFTER_CHECK_RELOCS-after_check_relocs_default},
+ ${LDEMUL_BEFORE_PLACE_ORPHANS-before_place_orphans_default},
+ ${LDEMUL_AFTER_ALLOCATION-after_allocation_default},
+ ${LDEMUL_SET_OUTPUT_ARCH-set_output_arch_default},
+ ${LDEMUL_CHOOSE_TARGET-ldemul_default_target},
+ ${LDEMUL_BEFORE_ALLOCATION-before_allocation_default},
+ ${LDEMUL_GET_SCRIPT-gld${EMULATION_NAME}_get_script},
+ "${EMULATION_NAME}",
+ "${OUTPUT_FORMAT}",
+ ${LDEMUL_FINISH-finish_default},
+ ${LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS-NULL},
+ ${LDEMUL_OPEN_DYNAMIC_ARCHIVE-NULL},
+ ${LDEMUL_PLACE_ORPHAN-NULL},
+ ${LDEMUL_SET_SYMBOLS-NULL},
+ ${LDEMUL_PARSE_ARGS-NULL},
+ ${LDEMUL_ADD_OPTIONS-NULL},
+ ${LDEMUL_HANDLE_OPTION-NULL},
+ ${LDEMUL_UNRECOGNIZED_FILE-NULL},
+ ${LDEMUL_LIST_OPTIONS-NULL},
+ ${LDEMUL_RECOGNIZED_FILE-NULL},
+ ${LDEMUL_FIND_POTENTIAL_LIBRARIES-NULL},
+ ${LDEMUL_NEW_VERS_PATTERN-NULL},
+ ${LDEMUL_EXTRA_MAP_FILE_TEXT-NULL},
+ ${LDEMUL_EMIT_CTF_EARLY-NULL},
+ ${LDEMUL_ACQUIRE_STRINGS_FOR_CTF-NULL},
+ ${LDEMUL_NEW_DYNSYM_FOR_CTF-NULL},
+ ${LDEMUL_PRINT_SYMBOL-NULL}
+};
+EOF
fi
fi
-fragment <<EOF
-
-struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
-{
- ${LDEMUL_BEFORE_PARSE-gld${EMULATION_NAME}_before_parse},
- ${LDEMUL_SYSLIB-syslib_default},
- ${LDEMUL_HLL-hll_default},
- ${LDEMUL_AFTER_PARSE-after_parse_default},
- ${LDEMUL_AFTER_OPEN-after_open_default},
- ${LDEMUL_AFTER_CHECK_RELOCS-after_check_relocs_default},
- ${LDEMUL_BEFORE_PLACE_ORPHANS-before_place_orphans_default},
- ${LDEMUL_AFTER_ALLOCATION-after_allocation_default},
- ${LDEMUL_SET_OUTPUT_ARCH-set_output_arch_default},
- ${LDEMUL_CHOOSE_TARGET-ldemul_default_target},
- ${LDEMUL_BEFORE_ALLOCATION-before_allocation_default},
- ${LDEMUL_GET_SCRIPT-gld${EMULATION_NAME}_get_script},
- "${EMULATION_NAME}",
- "${OUTPUT_FORMAT}",
- ${LDEMUL_FINISH-finish_default},
- ${LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS-NULL},
- ${LDEMUL_OPEN_DYNAMIC_ARCHIVE-NULL},
- ${LDEMUL_PLACE_ORPHAN-NULL},
- ${LDEMUL_SET_SYMBOLS-NULL},
- ${LDEMUL_PARSE_ARGS-NULL},
- ${LDEMUL_ADD_OPTIONS-NULL},
- ${LDEMUL_HANDLE_OPTION-NULL},
- ${LDEMUL_UNRECOGNIZED_FILE-NULL},
- ${LDEMUL_LIST_OPTIONS-NULL},
- ${LDEMUL_RECOGNIZED_FILE-NULL},
- ${LDEMUL_FIND_POTENTIAL_LIBRARIES-NULL},
- ${LDEMUL_NEW_VERS_PATTERN-NULL},
- ${LDEMUL_EXTRA_MAP_FILE_TEXT-NULL},
- ${LDEMUL_EMIT_CTF_EARLY-NULL},
- ${LDEMUL_ACQUIRE_STRINGS_FOR_CTF-NULL},
- ${LDEMUL_NEW_DYNSYM_FOR_CTF-NULL},
- ${LDEMUL_PRINT_SYMBOL-NULL}
-};
-EOF
+source_em ${srcdir}/emultempl/emulation.em
finish_default ();
check_array_section_alignment ();
}
-
-struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
-{
- ${LDEMUL_BEFORE_PARSE-gld${EMULATION_NAME}_before_parse},
- ${LDEMUL_SYSLIB-syslib_default},
- ${LDEMUL_HLL-hll_default},
- ${LDEMUL_AFTER_PARSE-after_parse_default},
- msp430_elf_after_open,
- after_check_relocs_default,
- before_place_orphans_default,
- msp430_elf_after_allocation,
- ${LDEMUL_SET_OUTPUT_ARCH-set_output_arch_default},
- ${LDEMUL_CHOOSE_TARGET-ldemul_default_target},
- ${LDEMUL_BEFORE_ALLOCATION-before_allocation_default},
- ${LDEMUL_GET_SCRIPT-gld${EMULATION_NAME}_get_script},
- "${EMULATION_NAME}",
- "${OUTPUT_FORMAT}",
- gld${EMULATION_NAME}_finish,
- ${LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS-NULL},
- ${LDEMUL_OPEN_DYNAMIC_ARCHIVE-NULL},
- ${LDEMUL_PLACE_ORPHAN-gld${EMULATION_NAME}_place_orphan},
- ${LDEMUL_SET_SYMBOLS-NULL},
- ${LDEMUL_PARSE_ARGS-NULL},
- gld${EMULATION_NAME}_add_options,
- gld${EMULATION_NAME}_handle_option,
- ${LDEMUL_UNRECOGNIZED_FILE-NULL},
- gld${EMULATION_NAME}_list_options,
- ${LDEMUL_RECOGNIZED_FILE-NULL},
- ${LDEMUL_FIND_POTENTIAL_LIBRARIES-NULL},
- ${LDEMUL_NEW_VERS_PATTERN-NULL},
- ${LDEMUL_EXTRA_MAP_FILE_TEXT-NULL},
- ${LDEMUL_EMIT_CTF_EARLY-NULL},
- ${LDEMUL_ACQUIRE_STRINGS_FOR_CTF-NULL},
- ${LDEMUL_NEW_DYNSYM_FOR_CTF-NULL},
- ${LDEMUL_PRINT_SYMBOL-NULL}
-};
EOF
+
+LDEMUL_AFTER_OPEN=msp430_elf_after_open
+LDEMUL_AFTER_ALLOCATION=msp430_elf_after_allocation
+LDEMUL_PLACE_ORPHAN=${LDEMUL_PLACE_ORPHAN-gld${EMULATION_NAME}_place_orphan}
+LDEMUL_FINISH=gld${EMULATION_NAME}_finish
+LDEMUL_ADD_OPTIONS=gld${EMULATION_NAME}_add_options
+LDEMUL_HANDLE_OPTION=gld${EMULATION_NAME}_handle_option
+LDEMUL_LIST_OPTIONS=gld${EMULATION_NAME}_list_options
+
+source_em ${srcdir}/emultempl/emulation.em
# \f
# Local Variables:
# mode: c
}
static void
-gld_${EMULATION_NAME}_before_parse (void)
+gld${EMULATION_NAME}_before_parse (void)
{
is_underscoring ();
ldfile_set_output_arch ("${OUTPUT_ARCH}", bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`);
static void
-gld_${EMULATION_NAME}_list_options (FILE *file)
+gld${EMULATION_NAME}_list_options (FILE *file)
{
fprintf (file, _(" --base_file <basefile> Generate a base file for relocatable DLLs\n"));
fprintf (file, _(" --dll Set image base to the default for DLLs\n"));
read. */
static void
-gld_${EMULATION_NAME}_set_symbols (void)
+gld${EMULATION_NAME}_set_symbols (void)
{
/* Run through and invent symbols for all the
names and insert the defaults. */
have been read. */
static void
-gld_${EMULATION_NAME}_after_parse (void)
+gld${EMULATION_NAME}_after_parse (void)
{
/* PR ld/6744: Warn the user if they have used an ELF-only
option hoping it will work on PE. */
}
static void
-gld_${EMULATION_NAME}_after_open (void)
+gld${EMULATION_NAME}_after_open (void)
{
after_open_default ();
}
\f
static void
-gld_${EMULATION_NAME}_before_allocation (void)
+gld${EMULATION_NAME}_before_allocation (void)
{
#if defined(TARGET_IS_armpe) || defined(TARGET_IS_arm_wince_pe)
/* FIXME: we should be able to set the size of the interworking stub
#endif /* DLL_SUPPORT */
static bool
-gld_${EMULATION_NAME}_unrecognized_file (lang_input_statement_type *entry ATTRIBUTE_UNUSED)
+gld${EMULATION_NAME}_unrecognized_file (lang_input_statement_type *entry ATTRIBUTE_UNUSED)
{
#ifdef DLL_SUPPORT
const char *ext = entry->filename + strlen (entry->filename) - 4;
}
static bool
-gld_${EMULATION_NAME}_recognized_file (lang_input_statement_type *entry ATTRIBUTE_UNUSED)
+gld${EMULATION_NAME}_recognized_file (lang_input_statement_type *entry ATTRIBUTE_UNUSED)
{
#ifdef DLL_SUPPORT
#ifdef TARGET_IS_i386pe
}
static void
-gld_${EMULATION_NAME}_finish (void)
+gld${EMULATION_NAME}_finish (void)
{
#if defined(TARGET_IS_armpe) || defined(TARGET_IS_arm_wince_pe)
struct bfd_link_hash_entry * h;
sort_sections. */
static lang_output_section_statement_type *
-gld_${EMULATION_NAME}_place_orphan (asection *s,
- const char *secname,
- int constraint)
+gld${EMULATION_NAME}_place_orphan (asection *s,
+ const char *secname,
+ int constraint)
{
const char *orig_secname = secname;
char *dollar = NULL;
}
static bool
-gld_${EMULATION_NAME}_open_dynamic_archive
+gld${EMULATION_NAME}_open_dynamic_archive
(const char *arch ATTRIBUTE_UNUSED,
search_dirs_type *search,
lang_input_statement_type *entry)
}
static int
-gld_${EMULATION_NAME}_find_potential_libraries
+gld${EMULATION_NAME}_find_potential_libraries
(char *name, lang_input_statement_type *entry)
{
return ldfile_open_file_search (name, entry, "", ".lib");
}
\f
static char *
-gld_${EMULATION_NAME}_get_script (int *isfile)
+gld${EMULATION_NAME}_get_script (int *isfile)
EOF
if test x"$COMPILE_IN" = xyes
EOF
fi
-fragment <<EOF
-
-
-struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
-{
- gld_${EMULATION_NAME}_before_parse,
- syslib_default,
- hll_default,
- gld_${EMULATION_NAME}_after_parse,
- gld_${EMULATION_NAME}_after_open,
- after_check_relocs_default,
- before_place_orphans_default,
- after_allocation_default,
- set_output_arch_default,
- ldemul_default_target,
- gld_${EMULATION_NAME}_before_allocation,
- gld_${EMULATION_NAME}_get_script,
- "${EMULATION_NAME}",
- "${OUTPUT_FORMAT}",
- gld_${EMULATION_NAME}_finish,
- NULL, /* Create output section statements. */
- gld_${EMULATION_NAME}_open_dynamic_archive,
- gld_${EMULATION_NAME}_place_orphan,
- gld_${EMULATION_NAME}_set_symbols,
- NULL, /* parse_args */
- gld${EMULATION_NAME}_add_options,
- gld${EMULATION_NAME}_handle_option,
- gld_${EMULATION_NAME}_unrecognized_file,
- gld_${EMULATION_NAME}_list_options,
- gld_${EMULATION_NAME}_recognized_file,
- gld_${EMULATION_NAME}_find_potential_libraries,
- NULL, /* new_vers_pattern. */
- NULL, /* extra_map_file_text. */
- ${LDEMUL_EMIT_CTF_EARLY-NULL},
- ${LDEMUL_ACQUIRE_STRINGS_FOR_CTF-NULL},
- ${LDEMUL_NEW_DYNSYM_FOR_CTF-NULL},
- ${LDEMUL_PRINT_SYMBOL-NULL}
-};
-EOF
+LDEMUL_AFTER_PARSE=gld${EMULATION_NAME}_after_parse
+LDEMUL_AFTER_OPEN=gld${EMULATION_NAME}_after_open
+LDEMUL_BEFORE_ALLOCATION=gld${EMULATION_NAME}_before_allocation
+LDEMUL_FINISH=gld${EMULATION_NAME}_finish
+LDEMUL_OPEN_DYNAMIC_ARCHIVE=gld${EMULATION_NAME}_open_dynamic_archive
+LDEMUL_PLACE_ORPHAN=gld${EMULATION_NAME}_place_orphan
+LDEMUL_SET_SYMBOLS=gld${EMULATION_NAME}_set_symbols
+LDEMUL_ADD_OPTIONS=gld${EMULATION_NAME}_add_options
+LDEMUL_HANDLE_OPTION=gld${EMULATION_NAME}_handle_option
+LDEMUL_UNRECOGNIZED_FILE=gld${EMULATION_NAME}_unrecognized_file
+LDEMUL_LIST_OPTIONS=gld${EMULATION_NAME}_list_options
+LDEMUL_RECOGNIZED_FILE=gld${EMULATION_NAME}_recognized_file
+LDEMUL_FIND_POTENTIAL_LIBRARIES=gld${EMULATION_NAME}_find_potential_libraries
+
+source_em ${srcdir}/emultempl/emulation.em
static void
-gld_${EMULATION_NAME}_before_parse (void)
+gld${EMULATION_NAME}_before_parse (void)
{
is_underscoring ();
ldfile_set_output_arch ("${OUTPUT_ARCH}", bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`);
static void
-gld_${EMULATION_NAME}_list_options (FILE *file)
+gld${EMULATION_NAME}_list_options (FILE *file)
{
fprintf (file, _(" --base_file <basefile> Generate a base file for relocatable DLLs\n"));
fprintf (file, _(" --dll Set image base to the default for DLLs\n"));
read. */
static void
-gld_${EMULATION_NAME}_set_symbols (void)
+gld${EMULATION_NAME}_set_symbols (void)
{
/* Run through and invent symbols for all the
names and insert the defaults. */
have been read. */
static void
-gld_${EMULATION_NAME}_after_parse (void)
+gld${EMULATION_NAME}_after_parse (void)
{
/* PR ld/6744: Warn the user if they have used an ELF-only
option hoping it will work on PE+. */
}
static void
-gld_${EMULATION_NAME}_after_open (void)
+gld${EMULATION_NAME}_after_open (void)
{
after_open_default ();
}
\f
static void
-gld_${EMULATION_NAME}_before_allocation (void)
+gld${EMULATION_NAME}_before_allocation (void)
{
is_underscoring ();
before_allocation_default ();
#endif /* DLL_SUPPORT */
static bool
-gld_${EMULATION_NAME}_unrecognized_file (lang_input_statement_type *entry ATTRIBUTE_UNUSED)
+gld${EMULATION_NAME}_unrecognized_file (lang_input_statement_type *entry ATTRIBUTE_UNUSED)
{
#ifdef DLL_SUPPORT
const char *ext = entry->filename + strlen (entry->filename) - 4;
}
static bool
-gld_${EMULATION_NAME}_recognized_file (lang_input_statement_type *entry ATTRIBUTE_UNUSED)
+gld${EMULATION_NAME}_recognized_file (lang_input_statement_type *entry ATTRIBUTE_UNUSED)
{
is_underscoring ();
#ifdef DLL_SUPPORT
}
static void
-gld_${EMULATION_NAME}_finish (void)
+gld${EMULATION_NAME}_finish (void)
{
is_underscoring ();
finish_default ();
sort_sections. */
static lang_output_section_statement_type *
-gld_${EMULATION_NAME}_place_orphan (asection *s,
+gld${EMULATION_NAME}_place_orphan (asection *s,
const char *secname,
int constraint)
{
}
static bool
-gld_${EMULATION_NAME}_open_dynamic_archive
+gld${EMULATION_NAME}_open_dynamic_archive
(const char *arch ATTRIBUTE_UNUSED,
search_dirs_type *search,
lang_input_statement_type *entry)
}
static int
-gld_${EMULATION_NAME}_find_potential_libraries
+gld${EMULATION_NAME}_find_potential_libraries
(char *name, lang_input_statement_type *entry)
{
return ldfile_open_file_search (name, entry, "", ".lib");
}
\f
static char *
-gld_${EMULATION_NAME}_get_script (int *isfile)
+gld${EMULATION_NAME}_get_script (int *isfile)
EOF
if test x"$COMPILE_IN" = xyes
EOF
fi
-fragment <<EOF
-
-
-struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
-{
- gld_${EMULATION_NAME}_before_parse,
- syslib_default,
- hll_default,
- gld_${EMULATION_NAME}_after_parse,
- gld_${EMULATION_NAME}_after_open,
- after_check_relocs_default,
- before_place_orphans_default,
- after_allocation_default,
- set_output_arch_default,
- ldemul_default_target,
- gld_${EMULATION_NAME}_before_allocation,
- gld_${EMULATION_NAME}_get_script,
- "${EMULATION_NAME}",
- "${OUTPUT_FORMAT}",
- gld_${EMULATION_NAME}_finish,
- NULL, /* Create output section statements. */
- gld_${EMULATION_NAME}_open_dynamic_archive,
- gld_${EMULATION_NAME}_place_orphan,
- gld_${EMULATION_NAME}_set_symbols,
- NULL, /* parse_args */
- gld${EMULATION_NAME}_add_options,
- gld${EMULATION_NAME}_handle_option,
- gld_${EMULATION_NAME}_unrecognized_file,
- gld_${EMULATION_NAME}_list_options,
- gld_${EMULATION_NAME}_recognized_file,
- gld_${EMULATION_NAME}_find_potential_libraries,
- NULL, /* new_vers_pattern. */
- NULL, /* extra_map_file_text */
- ${LDEMUL_EMIT_CTF_EARLY-NULL},
- ${LDEMUL_ACQUIRE_STRINGS_FOR_CTF-NULL},
- ${LDEMUL_NEW_DYNSYM_FOR_CTF-NULL},
- ${LDEMUL_PRINT_SYMBOL-NULL}
-};
-EOF
+LDEMUL_AFTER_PARSE=gld${EMULATION_NAME}_after_parse
+LDEMUL_AFTER_OPEN=gld${EMULATION_NAME}_after_open
+LDEMUL_BEFORE_ALLOCATION=gld${EMULATION_NAME}_before_allocation
+LDEMUL_FINISH=gld${EMULATION_NAME}_finish
+LDEMUL_OPEN_DYNAMIC_ARCHIVE=gld${EMULATION_NAME}_open_dynamic_archive
+LDEMUL_PLACE_ORPHAN=gld${EMULATION_NAME}_place_orphan
+LDEMUL_SET_SYMBOLS=gld${EMULATION_NAME}_set_symbols
+LDEMUL_ADD_OPTIONS=gld${EMULATION_NAME}_add_options
+LDEMUL_HANDLE_OPTION=gld${EMULATION_NAME}_handle_option
+LDEMUL_UNRECOGNIZED_FILE=gld${EMULATION_NAME}_unrecognized_file
+LDEMUL_LIST_OPTIONS=gld${EMULATION_NAME}_list_options
+LDEMUL_RECOGNIZED_FILE=gld${EMULATION_NAME}_recognized_file
+LDEMUL_FIND_POTENTIAL_LIBRARIES=gld${EMULATION_NAME}_find_potential_libraries
+
+source_em ${srcdir}/emultempl/emulation.em
}
static void
-gld_${EMULATION_NAME}_list_options (FILE * file)
+gld${EMULATION_NAME}_list_options (FILE * file)
{
fprintf (file, _(" --format 0|1|2 Specify which COFF version to use\n"));
}
}
static void
-gld_${EMULATION_NAME}_before_parse(void)
+gld${EMULATION_NAME}_before_parse(void)
{
#ifndef TARGET_ /* I.e., if not generic. */
ldfile_set_output_arch ("`echo ${ARCH}`", bfd_arch_unknown);
}
static char *
-gld_${EMULATION_NAME}_get_script (int *isfile)
+gld${EMULATION_NAME}_get_script (int *isfile)
EOF
if test x"$COMPILE_IN" = xyes
then
fi
-fragment <<EOF
-struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
-{
- gld_${EMULATION_NAME}_before_parse,
- syslib_default,
- hll_default,
- after_parse_default,
- after_open_default,
- after_check_relocs_default,
- before_place_orphans_default,
- after_allocation_default,
- set_output_arch_default,
- ldemul_default_target,
- before_allocation_default,
- gld_${EMULATION_NAME}_get_script,
- "${EMULATION_NAME}",
- "${OUTPUT_FORMAT}",
- finish_default,
- NULL, /* create output section statements */
- NULL, /* open dynamic archive */
- NULL, /* place orphan */
- NULL, /* set_symbols */
- NULL, /* parse_args */
- gld${EMULATION_NAME}_add_options,
- gld${EMULATION_NAME}_handle_option,
- NULL, /* unrecognized_file */
- gld_${EMULATION_NAME}_list_options,
- NULL, /* recognized file */
- NULL, /* find_potential_libraries */
- NULL, /* new_vers_pattern */
- NULL, /* extra_map_file_text */
- ${LDEMUL_EMIT_CTF_EARLY-NULL},
- ${LDEMUL_ACQUIRE_STRINGS_FOR_CTF-NULL},
- ${LDEMUL_NEW_DYNSYM_FOR_CTF-NULL},
- ${LDEMUL_PRINT_SYMBOL-NULL}
-};
-EOF
+LDEMUL_ADD_OPTIONS=gld${EMULATION_NAME}_add_options
+LDEMUL_HANDLE_OPTION=gld${EMULATION_NAME}_handle_option
+LDEMUL_LIST_OPTIONS=gld${EMULATION_NAME}_list_options
+
+source_em ${srcdir}/emultempl/emulation.em
*isfile = 0;
return "";
}
-
-struct ld_emulation_xfer_struct ld_vanilla_emulation =
-{
- vanilla_before_parse,
- syslib_default,
- hll_default,
- after_parse_default,
- after_open_default,
- after_check_relocs_default,
- before_place_orphans_default,
- after_allocation_default,
- vanilla_set_output_arch,
- ldemul_default_target,
- before_allocation_default,
- vanilla_get_script,
- "vanilla",
- "a.out-sunos-big",
- finish_default,
- NULL, /* create output section statements */
- NULL, /* open dynamic archive */
- NULL, /* place orphan */
- NULL, /* set symbols */
- NULL, /* parse args */
- NULL, /* add_options */
- NULL, /* handle_option */
- NULL, /* unrecognized file */
- NULL, /* list options */
- NULL, /* recognized file */
- NULL, /* find_potential_libraries */
- NULL, /* new_vers_pattern */
- NULL, /* extra_map_file_text */
- NULL, /* emit_ctf_early */
- NULL, /* acquire_strings_for_ctf */
- NULL, /* new_dynsym_for_ctf */
- NULL /* print_symbol */
-};
EOF
+
+LDEMUL_BEFORE_PARSE=vanilla_before_parse
+LDEMUL_SET_OUTPUT_ARCH=vanilla_set_output_arch
+LDEMUL_GET_SCRIPT=vanilla_get_script
+EMULATION_NAME=vanilla
+OUTPUT_FORMAT=a.out-sunos-big
+
+source_em ${srcdir}/emultempl/emulation.em