summaryrefslogtreecommitdiff
path: root/ld/emultempl/ticoff.em
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2022-02-04 11:04:15 -0800
committerH.J. Lu <hjl.tools@gmail.com>2022-02-06 06:25:41 -0800
commita92613915ec2f38e1ab62ab254dde2a1ad4ad408 (patch)
tree053d8739de7d55b88c7eea6e80656eddbfadedac /ld/emultempl/ticoff.em
parent026fbfa60eb7e94b4c7a6f340d433acb1eb7b7ad (diff)
downloadbinutils-gdb-a92613915ec2f38e1ab62ab254dde2a1ad4ad408.tar.gz
ld: Add emultempl/emulation.em
Add emultempl/emulation.em to define ld_${EMULATION_NAME}_emulation so that new emulation hooks can be added easily. * emultempl/aix.em (LDEMUL_AFTER_OPEN): New. (LDEMUL_SET_OUTPUT_ARCH): Likewise. (LDEMUL_CHOOSE_TARGET): Likewise. (LDEMUL_BEFORE_ALLOCATION): Likewise. (LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS): Likewise. (LDEMUL_OPEN_DYNAMIC_ARCHIVE): Likewise. (LDEMUL_PARSE_ARGS): Likewise. (LDEMUL_ADD_OPTIONS): Likewise. (LDEMUL_HANDLE_OPTION): Likewise. (LDEMUL_UNRECOGNIZED_FILE): Likewise. (LDEMUL_PRINT_SYMBOL): Likewise. (ld_${EMULATION_NAME}_emulation): Removed. Source ${srcdir}/emultempl/emulation.em. * emultempl/beos.em (gld_${EMULATION_NAME}_before_parse): Renamed to ... (gld${EMULATION_NAME}_before_parse): This. (gld_${EMULATION_NAME}_set_symbols): Renamed to ... (gld${EMULATION_NAME}_set_symbols): This. (gld_${EMULATION_NAME}_after_open): Renamed to ... (gld${EMULATION_NAME}_after_open): This. (gld_${EMULATION_NAME}_before_allocation): Renamed to ... (gld${EMULATION_NAME}_before_allocation): This. (gld_${EMULATION_NAME}_get_script): Renamed to ... (gld${EMULATION_NAME}_get_script): This. (LDEMUL_AFTER_OPEN): New. (LDEMUL_BEFORE_ALLOCATION): Likewise. (LDEMUL_PLACE_ORPHAN): Likewise. (LDEMUL_SET_SYMBOLS): Likewise. (LDEMUL_ADD_OPTIONS): Likewise. (LDEMUL_HANDLE_OPTION): Likewise. (ld_${EMULATION_NAME}_emulation): Removed. Source ${srcdir}/emultempl/emulation.em. * emultempl/elf.em (LDEMUL_AFTER_PARSE): New. (LDEMUL_AFTER_OPEN): Likewise. (LDEMUL_BEFORE_PLACE_ORPHANS): Likewise. (LDEMUL_AFTER_ALLOCATION): Likewise. (LDEMUL_SET_OUTPUT_ARCH): Likewise. (LDEMUL_BEFORE_ALLOCATION): Likewise. (LDEMUL_OPEN_DYNAMIC_ARCHIVE): Likewise. (LDEMUL_PLACE_ORPHAN): Likewise. (LDEMUL_ADD_OPTIONS): Likewise. (LDEMUL_HANDLE_OPTION): Likewise. (LDEMUL_LIST_OPTIONS): Likewise. (LDEMUL_UNRECOGNIZED_FILE): Likewise. (ld_${EMULATION_NAME}_emulation): Removed. Source ${srcdir}/emultempl/emulation.em. * emultempl/emulation.em: New file. * emultempl/generic.em (ld_${EMULATION_NAME}_emulation): Removed. Source ${srcdir}/emultempl/emulation.em. * emultempl/msp430.em (LDEMUL_AFTER_OPEN): New. (LDEMUL_AFTER_ALLOCATION): Likewise. (LDEMUL_PLACE_ORPHAN): Likewise. (LDEMUL_FINISH): Likewise. (LDEMUL_ADD_OPTIONS): Likewise. (LDEMUL_HANDLE_OPTION): Likewise. (LDEMUL_LIST_OPTIONS): Likewise. (ld_${EMULATION_NAME}_emulation): Removed. Source ${srcdir}/emultempl/emulation.em. * emultempl/pe.em (gld_${EMULATION_NAME}_before_parse): Renamed to ... (gld${EMULATION_NAME}_before_parse): This. (gld_${EMULATION_NAME}_list_options): Renamed to ... (gld${EMULATION_NAME}_list_options): This. (gld_${EMULATION_NAME}_set_symbols): Renamed to ... (gld${EMULATION_NAME}_set_symbols): This. (gld_${EMULATION_NAME}_after_parse): Renamed to ... (gld${EMULATION_NAME}_after_parse): This. (gld_${EMULATION_NAME}_after_open): Renamed to ... (gld${EMULATION_NAME}_after_open): This. (gld_${EMULATION_NAME}_before_allocation): Renamed to ... (gld${EMULATION_NAME}_before_allocation): This. (gld_${EMULATION_NAME}_unrecognized_file): Renamed to ... (gld${EMULATION_NAME}_unrecognized_file): This. (gld_${EMULATION_NAME}_recognized_file): Renamed to ... (gld${EMULATION_NAME}_recognized_file): This. (gld_${EMULATION_NAME}_finish): Renamed to ... (gld${EMULATION_NAME}_finish): This. (gld_${EMULATION_NAME}_place_orphan): Renamed to ... (gld${EMULATION_NAME}_place_orphan): This. (gld_${EMULATION_NAME}_open_dynamic_archive): Renamed to ... (gld${EMULATION_NAME}_open_dynamic_archive): This. (gld_${EMULATION_NAME}_find_potential_libraries): Renamed to ... (gld${EMULATION_NAME}_find_potential_libraries): This. (gld_${EMULATION_NAME}_get_script): Renamed to ... (gld${EMULATION_NAME}_get_script): This. (LDEMUL_AFTER_PARSE): New. (LDEMUL_AFTER_OPEN): Likewise. (LDEMUL_BEFORE_ALLOCATION): Likewise. (LDEMUL_FINISH=): Likewise. (LDEMUL_OPEN_DYNAMIC_ARCHIVE): Likewise. (LDEMUL_PLACE_ORPHAN): Likewise. (LDEMUL_SET_SYMBOLS): Likewise. (LDEMUL_ADD_OPTIONS): Likewise. (LDEMUL_HANDLE_OPTION): Likewise. (LDEMUL_UNRECOGNIZED_FILE): Likewise. (LDEMUL_LIST_OPTIONS): Likewise. (LDEMUL_RECOGNIZED_FILE): Likewise. (LDEMUL_FIND_POTENTIAL_LIBRARIES): Likewise. (ld_${EMULATION_NAME}_emulation): Removed. Source ${srcdir}/emultempl/emulation.em. * emultempl/pep.em (gld_${EMULATION_NAME}_before_parse): Renamed to ... (gld${EMULATION_NAME}_before_parse): This. (gld_${EMULATION_NAME}_list_options): Renamed to ... (gld${EMULATION_NAME}_list_options): This. (gld_${EMULATION_NAME}_set_symbols): Renamed to ... (gld${EMULATION_NAME}_set_symbols): This. (gld_${EMULATION_NAME}_after_parse): Renamed to ... (gld${EMULATION_NAME}_after_parse): This. (gld_${EMULATION_NAME}_after_open): Renamed to ... (gld${EMULATION_NAME}_after_open): This. (gld_${EMULATION_NAME}_before_allocation): Renamed to ... (gld${EMULATION_NAME}_before_allocation): This. (gld_${EMULATION_NAME}_unrecognized_file): Renamed to ... (gld${EMULATION_NAME}_unrecognized_file): This. (gld_${EMULATION_NAME}_recognized_file): Renamed to ... (gld${EMULATION_NAME}_recognized_file): This. (gld_${EMULATION_NAME}_finish): Renamed to ... (gld${EMULATION_NAME}_finish): This. (gld_${EMULATION_NAME}_place_orphan): Renamed to ... (gld${EMULATION_NAME}_place_orphan): This. (gld_${EMULATION_NAME}_open_dynamic_archive): Renamed to ... (gld${EMULATION_NAME}_open_dynamic_archive): This. (gld_${EMULATION_NAME}_find_potential_libraries): Renamed to ... (gld${EMULATION_NAME}_find_potential_libraries): This. (gld_${EMULATION_NAME}_get_script): Renamed to ... (gld${EMULATION_NAME}_get_script): This. (LDEMUL_AFTER_PARSE): New. (LDEMUL_AFTER_OPEN): Likewise. (LDEMUL_BEFORE_ALLOCATION): Likewise. (LDEMUL_FINISH=): Likewise. (LDEMUL_OPEN_DYNAMIC_ARCHIVE): Likewise. (LDEMUL_PLACE_ORPHAN): Likewise. (LDEMUL_SET_SYMBOLS): Likewise. (LDEMUL_ADD_OPTIONS): Likewise. (LDEMUL_HANDLE_OPTION): Likewise. (LDEMUL_UNRECOGNIZED_FILE): Likewise. (LDEMUL_LIST_OPTIONS): Likewise. (LDEMUL_RECOGNIZED_FILE): Likewise. (LDEMUL_FIND_POTENTIAL_LIBRARIES): Likewise. (ld_${EMULATION_NAME}_emulation): Removed. Source ${srcdir}/emultempl/emulation.em. * emultempl/ticoff.em (gld_${EMULATION_NAME}_list_options): Renamed to ... (gld${EMULATION_NAME}_list_options): This. (gld_${EMULATION_NAME}_before_parse): Renamed to ... (gld_${EMULATION_NAME}_get_script): Renamed to ... (gld${EMULATION_NAME}_get_script): This. (LDEMUL_ADD_OPTIONS): New. (LDEMUL_HANDLE_OPTION): Likewise. (LDEMUL_LIST_OPTIONS): Likewise. (ld_${EMULATION_NAME}_emulation): Removed. Source ${srcdir}/emultempl/emulation.em. * emultempl/vanilla.em (LDEMUL_BEFORE_PARSE): New. (LDEMUL_SET_OUTPUT_ARCH): Likewise. (LDEMUL_GET_SCRIPT): Likewise. (EMULATION_NAME): Likewise. (OUTPUT_FORMAT): Likewise. (ld_vanilla_emulation): Removed. Source ${srcdir}/emultempl/emulation.em.
Diffstat (limited to 'ld/emultempl/ticoff.em')
-rw-r--r--ld/emultempl/ticoff.em48
1 files changed, 8 insertions, 40 deletions
diff --git a/ld/emultempl/ticoff.em b/ld/emultempl/ticoff.em
index 1ac483b9c7f..a57e73bc5c3 100644
--- a/ld/emultempl/ticoff.em
+++ b/ld/emultempl/ticoff.em
@@ -64,7 +64,7 @@ gld${EMULATION_NAME}_add_options
}
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"));
}
@@ -96,7 +96,7 @@ gld${EMULATION_NAME}_handle_option (int optc)
}
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);
@@ -104,7 +104,7 @@ gld_${EMULATION_NAME}_before_parse(void)
}
static char *
-gld_${EMULATION_NAME}_get_script (int *isfile)
+gld${EMULATION_NAME}_get_script (int *isfile)
EOF
if test x"$COMPILE_IN" = xyes
then
@@ -154,40 +154,8 @@ EOF
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