]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - ld/emultempl/ticoff.em
2.41 Release sources
[thirdparty/binutils-gdb.git] / ld / emultempl / ticoff.em
index d394e12465cde7e1726f9ec5f0c30c5aa6b9e6c6..31abefe6674dad3513817345ef5f6a376f52a34d 100644 (file)
@@ -3,7 +3,7 @@
 (echo;echo;echo;echo)>e${EMULATION_NAME}.c # there, now line numbers match ;-)
 fragment <<EOF
 /* This file is part of GLD, the Gnu Linker.
-   Copyright (C) 1999-2017 Free Software Foundation, Inc.
+   Copyright (C) 1999-2023 Free Software Foundation, Inc.
 
    This file is part of the GNU Binutils.
 
@@ -30,6 +30,7 @@ fragment <<EOF
 #include "sysdep.h"
 #include "bfd.h"
 #include "bfdlink.h"
+#include "ctf-api.h"
 #include "getopt.h"
 
 #include "ld.h"
@@ -63,18 +64,18 @@ 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"));
 }
 
-static bfd_boolean
+static bool
 gld${EMULATION_NAME}_handle_option (int optc)
 {
   switch (optc)
     {
     default:
-      return FALSE;
+      return false;
 
     case OPTION_COFF_FORMAT:
       if ((*optarg == '0' || *optarg == '1' || *optarg == '2')
@@ -87,15 +88,15 @@ gld${EMULATION_NAME}_handle_option (int optc)
        }
       else
        {
-         einfo (_("%P%F: invalid COFF format version %s\n"), optarg);
+         einfo (_("%F%P: invalid COFF format version %s\n"), optarg);
        }
       break;
     }
-  return FALSE;
+  return false;
 }
 
 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);
@@ -103,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
@@ -153,34 +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_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 */
-};
-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