* emultempl/generic.em: Support EXTRA_EM_FILE.
authorHans-Peter Nilsson <hp@axis.com>
Mon, 13 Aug 2001 07:24:58 +0000 (07:24 +0000)
committerHans-Peter Nilsson <hp@axis.com>
Mon, 13 Aug 2001 07:24:58 +0000 (07:24 +0000)
(ld_${EMULATION_NAME}_emulation): Support emulation parameters
LDEMUL_BEFORE_PARSE, LDEMUL_SYSLIB, LDEMUL_HLL,
LDEMUL_AFTER_PARSE, LDEMUL_AFTER_OPEN, LDEMUL_AFTER_ALLOCATION,
LDEMUL_SET_OUTPUT_ARCH, LDEMUL_CHOOSE_TARGET,
LDEMUL_BEFORE_ALLOCATION, LDEMUL_GET_SCRIPT, LDEMUL_FINISH,
LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS,
LDEMUL_OPEN_DYNAMIC_ARCHIVE, LDEMUL_PLACE_ORPHAN,
LDEMUL_SET_SYMBOLS, LDEMUL_PARSE_ARGS, LDEMUL_UNRECOGNIZED_FILE,
LDEMUL_LIST_OPTIONS, LDEMUL_RECOGNIZED_FILE,
LDEMUL_FIND_POTENTIAL_LIBRARIES.

ld/ChangeLog
ld/emultempl/generic.em

index ccf462f57615a1cdbbc386bbe3ed98fed591aaf5..3b0724f54c3df047758afc8a94fcee2a5cb0507e 100644 (file)
@@ -1,3 +1,17 @@
+2001-08-13  Hans-Peter Nilsson  <hp@bitrange.com>
+
+       * emultempl/generic.em: Support EXTRA_EM_FILE.
+       (ld_${EMULATION_NAME}_emulation): Support emulation parameters
+       LDEMUL_BEFORE_PARSE, LDEMUL_SYSLIB, LDEMUL_HLL,
+       LDEMUL_AFTER_PARSE, LDEMUL_AFTER_OPEN, LDEMUL_AFTER_ALLOCATION,
+       LDEMUL_SET_OUTPUT_ARCH, LDEMUL_CHOOSE_TARGET,
+       LDEMUL_BEFORE_ALLOCATION, LDEMUL_GET_SCRIPT, LDEMUL_FINISH,
+       LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS,
+       LDEMUL_OPEN_DYNAMIC_ARCHIVE, LDEMUL_PLACE_ORPHAN,
+       LDEMUL_SET_SYMBOLS, LDEMUL_PARSE_ARGS, LDEMUL_UNRECOGNIZED_FILE,
+       LDEMUL_LIST_OPTIONS, LDEMUL_RECOGNIZED_FILE,
+       LDEMUL_FIND_POTENTIAL_LIBRARIES.
+
 2001-08-12  Richard Henderson  <rth@redhat.com>
 
        * scripttempl/elf.sc, scripttempl/elfd30v.sc,
index cb5c30c064fdb522f8a95f2eeccda78ae5f078a0..ca1f4449de735599cd9c649bd1ea615c1a76fe77 100644 (file)
@@ -42,6 +42,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 static void gld${EMULATION_NAME}_before_parse PARAMS ((void));
 static char *gld${EMULATION_NAME}_get_script PARAMS ((int *isfile));
 
+EOF
+
+# Import any needed special functions and/or overrides.
+#
+if test -n "$EXTRA_EM_FILE" ; then
+. ${srcdir}/emultempl/${EXTRA_EM_FILE}.em
+fi
+
+if test x"$LDEMUL_BEFORE_PARSE" != xgld"$EMULATION_NAME"_before_parse; then
+cat >>e${EMULATION_NAME}.c <<EOF
+
 static void
 gld${EMULATION_NAME}_before_parse()
 {
@@ -50,6 +61,12 @@ gld${EMULATION_NAME}_before_parse()
 #endif /* not TARGET_ */
 }
 
+EOF
+fi
+
+if test x"$LDEMUL_GET_SCRIPT" != xgld"$EMULATION_NAME"_get_script; then
+cat >>e${EMULATION_NAME}.c <<EOF
+
 static char *
 gld${EMULATION_NAME}_get_script(isfile)
      int *isfile;
@@ -99,34 +116,34 @@ cat >>e${EMULATION_NAME}.c <<EOF
     return "ldscripts/${EMULATION_NAME}.x";
 }
 EOF
-
+fi
 fi
 
 cat >>e${EMULATION_NAME}.c <<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,
+  ${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_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}",
-  NULL,        /* finish */
-  NULL,        /* create output section statements */
-  NULL,        /* open dynamic archive */
-  NULL,        /* place orphan */
-  NULL,        /* set symbols */
-  NULL,        /* parse args */
-  NULL,        /* unrecognized file */
-  NULL,        /* list options */
-  NULL,        /* recognized file */
-  NULL         /* find_potential_libraries */
+  ${LDEMUL_FINISH-NULL},
+  ${LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS-NULL},
+  ${LDEMUL_OPEN_DYNAMIC_ARCHIVE-NULL},
+  ${LDEMUL_PLACE_ORPHAN-NULL},
+  ${LDEMUL_SET_SYMBOLS-NULL},
+  ${LDEMUL_PARSE_ARGS-NULL},
+  ${LDEMUL_UNRECOGNIZED_FILE-NULL},
+  ${LDEMUL_LIST_OPTIONS-NULL},
+  ${LDEMUL_RECOGNIZED_FILE-NULL},
+  ${LDEMUL_FIND_POTENTIAL_LIBRARIES-NULL}
 };
 EOF