import insight-2000-02-04 snapshot (2nd try)
[external/binutils.git] / ld / emultempl / lnk960.em
index 066d46b..9ab6b3f 100644 (file)
@@ -2,7 +2,7 @@
 # It does some substitutions.
 cat >e${EMULATION_NAME}.c <<EOF
 /* intel coff loader emulation specific stuff
-   Copyright (C) 1991, 1993 Free Software Foundation, Inc.
+   Copyright (C) 1991, 93, 94, 95, 96, 1999 Free Software Foundation, Inc.
    Written by Steve Chamberlain steve@cygnus.com
 
 This file is part of GLD, the Gnu Linker.
@@ -263,27 +263,25 @@ then
 # Scripts compiled in.
 
 # sed commands to quote an ld script as a C string.
-sc='s/["\\]/\\&/g
-s/$/\\n\\/
-1s/^/"/
-$s/$/n"/
-'
+sc="-f stringify.sed"
 
 cat >>e${EMULATION_NAME}.c <<EOF
+{                           
   *isfile = 0;
 
   if (link_info.relocateable == true && config.build_constructors == true)
-    return `sed "$sc" ldscripts/${EMULATION_NAME}.xu`;
-  else if (link_info.relocateable == true)
-    return `sed "$sc" ldscripts/${EMULATION_NAME}.xr`;
-  else if (!config.text_read_only)
-    return `sed "$sc" ldscripts/${EMULATION_NAME}.xbn`;
-  else if (!config.magic_demand_paged)
-    return `sed "$sc" ldscripts/${EMULATION_NAME}.xn`;
-  else
-    return `sed "$sc" ldscripts/${EMULATION_NAME}.x`;
-}
+    return
 EOF
+sed $sc ldscripts/${EMULATION_NAME}.xu                     >> e${EMULATION_NAME}.c
+echo '  ; else if (link_info.relocateable == true) return' >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xr                     >> e${EMULATION_NAME}.c
+echo '  ; else if (!config.text_read_only) return'         >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xbn                    >> e${EMULATION_NAME}.c
+echo '  ; else if (!config.magic_demand_paged) return'     >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xn                     >> e${EMULATION_NAME}.c
+echo '  ; else return'                                     >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.x                      >> e${EMULATION_NAME}.c
+echo '; }'                                                 >> e${EMULATION_NAME}.c
 
 else
 # Scripts read from the filesystem.
@@ -322,6 +320,15 @@ struct ld_emulation_xfer_struct ld_lnk960_emulation =
   lnk960_before_allocation,
   lnk960_get_script,
   "lnk960",
-  ""
+  "",
+  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 */
 };
 EOF