* emultempl/ostring.sed: Rename from stringify.sed.
authorIan Lance Taylor <ian@airs.com>
Fri, 6 Aug 1999 22:46:03 +0000 (22:46 +0000)
committerIan Lance Taylor <ian@airs.com>
Fri, 6 Aug 1999 22:46:03 +0000 (22:46 +0000)
* emultempl/astring.sed: New file.
* Makefile.am (stringify.sed): New target.
(GEN_DEPENDS): Change $(srcdir)/emultempl/stringify.sed to
stringify.sed.
* configure.in: Define and substitute STRINGIFY.
* emultempl/*.em: Use stringify.sed from build directory rather
than source directory.
* emultempl/elf32.em: Use stringify.sed rather than inline sed
script.
* emultempl/gld960.em, emultempl/gld960c.em: Likewise.
* emultempl/hppaelf.em, emultempl/linux.em: Likewise.
* emultempl/lnk960.em, emultempl/sunos.em: Likewise.
* configure, Makefile.in: Rebuild.

23 files changed:
ld/ChangeLog
ld/Makefile.am
ld/Makefile.in
ld/configure
ld/configure.in
ld/emultempl/aix.em
ld/emultempl/armcoff.em
ld/emultempl/armelf.em
ld/emultempl/armelf_oabi.em
ld/emultempl/astring.sed [new file with mode: 0644]
ld/emultempl/beos.em
ld/emultempl/elf32.em
ld/emultempl/generic.em
ld/emultempl/gld960.em
ld/emultempl/gld960c.em
ld/emultempl/hppaelf.em
ld/emultempl/linux.em
ld/emultempl/lnk960.em
ld/emultempl/mipsecoff.em
ld/emultempl/ostring.sed [new file with mode: 0644]
ld/emultempl/pe.em
ld/emultempl/stringify.sed [deleted file]
ld/emultempl/sunos.em

index 2f0154f09ccfdc16d3346fbca95f9089eff768c5..e9c7c5d9db6138cccd2b5c01078f9ab40da14122 100644 (file)
@@ -1,3 +1,20 @@
+1999-08-06  Ian Lance Taylor  <ian@zembu.com>
+
+       * emultempl/ostring.sed: Rename from stringify.sed.
+       * emultempl/astring.sed: New file.
+       * Makefile.am (stringify.sed): New target.
+       (GEN_DEPENDS): Change $(srcdir)/emultempl/stringify.sed to
+       stringify.sed.
+       * configure.in: Define and substitute STRINGIFY.
+       * emultempl/*.em: Use stringify.sed from build directory rather
+       than source directory.
+       * emultempl/elf32.em: Use stringify.sed rather than inline sed
+       script.
+       * emultempl/gld960.em, emultempl/gld960c.em: Likewise.
+       * emultempl/hppaelf.em, emultempl/linux.em: Likewise.
+       * emultempl/lnk960.em, emultempl/sunos.em: Likewise.
+       * configure, Makefile.in: Rebuild.
+
 1999-08-05  Donn Terry  <donn@interix.com>
 
        * emulparams/i386pe.sh: Define ENTRY, SUBSYSTEM, and
index 3e7f23b58e37ba06a032f83650ea6181747bb53e..193409229ba2166c9b343656940a09cdc6746ad7 100644 (file)
@@ -260,10 +260,13 @@ ldemul-list.h: Makefile
        echo "  0") >ldemul-tmp.h
        mv ldemul-tmp.h ldemul-list.h
 
+stringify.sed: ${srcdir}/emultempl/$(STRINGIFY)
+         cp ${srcdir}/emultempl/$(STRINGIFY) stringify.sed
+
 # These all start with e so 'make clean' can find them.
 
 GENSCRIPTS = $(SHELL) $(srcdir)/genscripts.sh ${srcdir} ${libdir} @host@ @target@ @target_alias@ "@EMULATION_LIBPATH@" "@NATIVE_LIB_DIRS@"
-GEN_DEPENDS = $(srcdir)/genscripts.sh $(srcdir)/emultempl/stringify.sed
+GEN_DEPENDS = $(srcdir)/genscripts.sh stringify.sed
 @TDIRS@
 
 ea29k.c: $(srcdir)/emulparams/a29k.sh \
index b59641fdd70cd528f5a0b0ad1cc98e3d1b0abd1f..7506e456f3cff7cf481540c8fadffd7203479222 100644 (file)
@@ -95,6 +95,7 @@ PACKAGE = @PACKAGE@
 POFILES = @POFILES@
 POSUB = @POSUB@
 RANLIB = @RANLIB@
+STRINGIFY = @STRINGIFY@
 USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
 USE_NLS = @USE_NLS@
 USE_SYMBOL_UNDERSCORE = @USE_SYMBOL_UNDERSCORE@
@@ -351,7 +352,7 @@ POTFILES = $(CFILES) $(HFILES) $(EMULATION_FILES)
 # These all start with e so 'make clean' can find them.
 
 GENSCRIPTS = $(SHELL) $(srcdir)/genscripts.sh ${srcdir} ${libdir} @host@ @target@ @target_alias@ "@EMULATION_LIBPATH@" "@NATIVE_LIB_DIRS@"
-GEN_DEPENDS = $(srcdir)/genscripts.sh $(srcdir)/emultempl/stringify.sed
+GEN_DEPENDS = $(srcdir)/genscripts.sh stringify.sed
 
 ld_new_SOURCES = ldgram.y ldlex.l lexsup.c ldlang.c mri.c ldctor.c ldmain.c \
        ldwrite.c ldexp.c ldemul.c ldver.c ldmisc.c ldfile.c ldcref.c
@@ -964,6 +965,9 @@ ldemul-list.h: Makefile
        done;\
        echo "  0") >ldemul-tmp.h
        mv ldemul-tmp.h ldemul-list.h
+
+stringify.sed: ${srcdir}/emultempl/$(STRINGIFY)
+         cp ${srcdir}/emultempl/$(STRINGIFY) stringify.sed
 @TDIRS@
 
 ea29k.c: $(srcdir)/emulparams/a29k.sh \
index 00a8d9d6c68ca4c5ff09df7db682b1adb483b0c9..f2baf1db600e676e67d797b6a8e42309cc7b8703 100755 (executable)
@@ -4717,6 +4717,42 @@ EOF
 fi
 
 
+# When converting linker scripts into strings for use in emulation
+# files, use astring.sed if the compiler supports ANSI string
+# concatenation, or ostring.sed otherwise.  This is to support the
+# broken Microsoft MSVC compiler, which limits the length of string
+# constants, while still supporting pre-ANSI compilers which do not
+# support string concatenation.
+if eval "test \"`echo '$''{'ld_cv_string_concatenation'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 4731 "configure"
+#include "confdefs.h"
+
+int main() {
+char *a = "a" "a";
+; return 0; }
+EOF
+if { (eval echo configure:4738: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ld_cv_string_concatenation=true
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ld_cv_string_concatenation=false
+fi
+rm -f conftest*
+fi
+
+if test "$ld_cv_string_concatenation" = "true"; then
+  STRINGIFY=astring.sed
+else
+  STRINGIFY=ostring.sed
+fi
+
+
 # target-specific stuff:
 
 all_targets=
@@ -5013,6 +5049,7 @@ s%@HDEFINES@%$HDEFINES%g
 s%@HOSTING_CRT0@%$HOSTING_CRT0%g
 s%@HOSTING_LIBS@%$HOSTING_LIBS%g
 s%@NATIVE_LIB_DIRS@%$NATIVE_LIB_DIRS%g
+s%@STRINGIFY@%$STRINGIFY%g
 s%@EMUL@%$EMUL%g
 /@TDIRS@/r $TDIRS
 s%@TDIRS@%%g
index 01b802eeaeea7b63850795067480a8a91239ed7a..a3546c767142a8225f44ac357d6a6d425cda18d1 100644 (file)
@@ -68,6 +68,23 @@ BFD_NEED_DECLARATION(sbrk)
 BFD_NEED_DECLARATION(getenv)
 BFD_NEED_DECLARATION(environ)
 
+# When converting linker scripts into strings for use in emulation
+# files, use astring.sed if the compiler supports ANSI string
+# concatenation, or ostring.sed otherwise.  This is to support the
+# broken Microsoft MSVC compiler, which limits the length of string
+# constants, while still supporting pre-ANSI compilers which do not
+# support string concatenation.
+AC_CACHE_VAL(ld_cv_string_concatenation,
+[AC_TRY_COMPILE(,[char *a = "a" "a";],
+  [ld_cv_string_concatenation=true],
+  [ld_cv_string_concatenation=false])])
+if test "$ld_cv_string_concatenation" = "true"; then
+  STRINGIFY=astring.sed
+else
+  STRINGIFY=ostring.sed
+fi
+AC_SUBST(STRINGIFY)
+
 # target-specific stuff:
 
 all_targets=
index c77857f822d64d3169e6c062c04b061e22de48d8..6748af0b3879fb1157fb740c1e9e0838ab324443 100644 (file)
@@ -4,7 +4,7 @@ cat >e${EMULATION_NAME}.c <<EOF
 /* This file is is generated by a shell script.  DO NOT EDIT! */
 
 /* AIX emulation code for ${EMULATION_NAME}
-   Copyright (C) 1991, 93, 95, 96, 97, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1991, 93, 95, 96, 97, 98, 1999 Free Software Foundation, Inc.
    Written by Steve Chamberlain <sac@cygnus.com>
    AIX support by Ian Lance Taylor <ian@cygnus.com>
 
@@ -985,7 +985,7 @@ then
 # Scripts compiled in.
 
 # sed commands to quote an ld script as a C string.
-sc="-f ${srcdir}/emultempl/stringify.sed"
+sc="-f stringify.sed"
 
 cat >>e${EMULATION_NAME}.c <<EOF
 {                           
index 484ff83a6607a2aff87d538e84ae044a5280f7e9..3caaa8084ce6b784f8f21e1647884bd3d75a0022 100644 (file)
@@ -4,7 +4,7 @@ cat >e${EMULATION_NAME}.c <<EOF
 /* This file is is generated by a shell script.  DO NOT EDIT! */
 
 /* emulate the original gld for the given ${EMULATION_NAME}
-   Copyright (C) 1991, 93, 96, 97, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1991, 93, 96, 97, 98, 1999 Free Software Foundation, Inc.
    Written by Steve Chamberlain steve@cygnus.com
 
 This file is part of GLD, the Gnu Linker.
@@ -220,7 +220,7 @@ then
 # Scripts compiled in.
 
 # sed commands to quote an ld script as a C string.
-sc="-f ${srcdir}/emultempl/stringify.sed"
+sc="-f stringify.sed"
 
 cat >>e${EMULATION_NAME}.c <<EOF
 {                           
index a0f1a0dae54459abdbd771c9a8f367357ef2b6fc..583850dac7d20d930128ac090e8cbe3ed5d03db9 100644 (file)
@@ -1211,7 +1211,7 @@ then
 # Scripts compiled in.
 
 # sed commands to quote an ld script as a C string.
-sc="-f ${srcdir}/emultempl/stringify.sed"
+sc="-f stringify.sed"
 
 cat >>e${EMULATION_NAME}.c <<EOF
 {                           
index 20a50dfe652a8a5ef22dc48174f689242cb3cff1..3a2dfe472d319415dcaee04563af1022ff64fd2d 100644 (file)
@@ -105,7 +105,7 @@ then
 # Scripts compiled in.
 
 # sed commands to quote an ld script as a C string.
-sc="-f ${srcdir}/emultempl/stringify.sed"
+sc="-f stringify.sed"
 
 cat >>e${EMULATION_NAME}.c <<EOF
 {                           
diff --git a/ld/emultempl/astring.sed b/ld/emultempl/astring.sed
new file mode 100644 (file)
index 0000000..08bd8a6
--- /dev/null
@@ -0,0 +1,13 @@
+s/["\\]/\\&/g
+s/$/\\n\\/
+1 s/^/"/
+25s/\\$/"/
+26s/^/"/
+50s/\\$/"/
+51s/^/"/
+75s/\\$/"/
+76s/^/"/
+100s/\\$/"/
+101s/^/"/
+$ s/$/n"/
+$ s/\\n"n"$/\\n"/
index c2b3ec21a09494f9f90934d7d4310fcc44a6e859..39490ca22c2bd1a75d25e63538c21e827ca249fc 100644 (file)
@@ -2,7 +2,7 @@
 # It does some substitutions.
 cat >e${EMULATION_NAME}.c <<EOF
 /* This file is part of GLD, the Gnu Linker.
-   Copyright 1995, 96, 97, 1998 Free Software Foundation, Inc.
+   Copyright 1995, 96, 97, 98, 1999 Free Software Foundation, Inc.
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -790,7 +790,7 @@ gld_${EMULATION_NAME}_get_script(isfile)
 EOF
 # Scripts compiled in.
 # sed commands to quote an ld script as a C string.
-sc="-f ${srcdir}/emultempl/stringify.sed"
+sc="-f stringify.sed"
 
 cat >>e${EMULATION_NAME}.c <<EOF
 {                           
index 4ec259cd1db5bcf89a6f427088e9fdf651cc52af..163e4c9a9b2fc8bb76c3ee8c4a897a10cf1cae7f 100644 (file)
@@ -1069,38 +1069,31 @@ 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`;
+    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
 
 if test -n "$GENERATE_SHLIB_SCRIPT" ; then
-cat >>e${EMULATION_NAME}.c <<EOF
-  else if (link_info.shared)
-    return `sed "$sc" ldscripts/${EMULATION_NAME}.xs`;
-EOF
+echo '  ; else if (link_info.shared) return'              >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xs                     >> e${EMULATION_NAME}.c
 fi
 
-cat >>e${EMULATION_NAME}.c <<EOF
-  else
-    return `sed "$sc" ldscripts/${EMULATION_NAME}.x`;
-}
-EOF
+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.
index 1c0c8eb214d07a0f268d5ea9c15c1f821f729de2..9a3f530782beda6b1a1edb401a75f64ccd4d977b 100644 (file)
@@ -4,7 +4,7 @@ cat >e${EMULATION_NAME}.c <<EOF
 /* This file is is generated by a shell script.  DO NOT EDIT! */
 
 /* emulate the original gld for the given ${EMULATION_NAME}
-   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.
@@ -56,7 +56,7 @@ then
 # Scripts compiled in.
 
 # sed commands to quote an ld script as a C string.
-sc="-f ${srcdir}/emultempl/stringify.sed"
+sc="-f stringify.sed"
 
 cat >>e${EMULATION_NAME}.c <<EOF
 {                           
index df998fb74a8db1bc9d5a802617dcfbacfe58c325..63b4af09738b6be1e5e5a272e18b2ec3d56ae5d3 100644 (file)
@@ -1,7 +1,7 @@
 # This shell script emits a C file. -*- C -*-
 # It does some substitutions.
 cat >e${EMULATION_NAME}.c <<EOF
-/* Copyright (C) 1991, 1993 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 93, 94, 95, 1999 Free Software Foundation, Inc.
 
 This file is part of GLD, the Gnu Linker.
 
@@ -111,28 +111,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.
index 20cb5eda4ef601d7365615b0c7c1541ed0edc198..4789b22e5bcfdab5952c911c503ba89381cc4db1 100644 (file)
@@ -1,7 +1,7 @@
 # This shell script emits a C file. -*- C -*-
 # It does some substitutions.
 cat >e${EMULATION_NAME}.c <<EOF
-/* Copyright (C) 1991, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 93, 94, 95, 96, 1999 Free Software Foundation, Inc.
 
 This file is part of GLD, the Gnu Linker.
 
@@ -127,28 +127,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.
index c0ca113db4694fe8fa2b2278e4df80abc22dcdc2..69abe3ba2e369191e3ae597412f16042d8dc0f49 100644 (file)
@@ -2,7 +2,7 @@
 # It does some substitutions.
 cat >e${EMULATION_NAME}.c <<EOF
 /* An emulation for HP PA-RISC ELF linkers.
-   Copyright (C) 1991, 93, 94, 95, 1997 Free Software Foundation, Inc.
+   Copyright (C) 1991, 93, 94, 95, 97, 1999 Free Software Foundation, Inc.
    Written by Steve Chamberlain steve@cygnus.com
 
 This file is part of GLD, the Gnu Linker.
@@ -216,28 +216,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.
index 29f5bd1b55925a4dc7a23c586f3c5d36707863b7..b8a03ff607f61d4e4ea797c2e8f92181e6d8777c 100644 (file)
@@ -4,7 +4,7 @@ cat >e${EMULATION_NAME}.c <<EOF
 /* This file is is generated by a shell script.  DO NOT EDIT! */
 
 /* Linux a.out emulation code for ${EMULATION_NAME}
-   Copyright (C) 1991, 93, 94, 95, 96, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1991, 93, 94, 95, 96, 98, 1999 Free Software Foundation, Inc.
    Written by Steve Chamberlain <sac@cygnus.com>
    Linux support by Eric Youngdale <ericy@cais.cais.com>
 
@@ -140,28 +140,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.
index 066d46bb32863974237ea02d52dd0a16c14c1b1b..9df2f609af91b7eda73c0e101e058e6290f56440 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.
index d1200c46d7041b1f6ecce42099a003bf85838fc5..10d5924691f7ea77246fd4dfe1a3717340f45e3c 100644 (file)
@@ -4,7 +4,7 @@ cat >e${EMULATION_NAME}.c <<EOF
 /* This file is is generated by a shell script.  DO NOT EDIT! */
 
 /* Handle embedded relocs for MIPS.
-   Copyright 1994 Free Software Foundation, Inc.
+   Copyright 1994, 95, 97, 1999 Free Software Foundation, Inc.
    Written by Ian Lance Taylor <ian@cygnus.com> based on generic.em.
 
 This file is part of GLD, the Gnu Linker.
@@ -167,7 +167,7 @@ then
 # Scripts compiled in.
 
 # sed commands to quote an ld script as a C string.
-sc="-f ${srcdir}/emultempl/stringify.sed"
+sc="-f stringify.sed"
 
 cat >>e${EMULATION_NAME}.c <<EOF
 {                           
diff --git a/ld/emultempl/ostring.sed b/ld/emultempl/ostring.sed
new file mode 100644 (file)
index 0000000..a526d3f
--- /dev/null
@@ -0,0 +1,4 @@
+s/["\\]/\\&/g
+s/$/\\n\\/
+1 s/^/"/
+$ s/$/n"/
index bdab4f93d7e7c68549b1669eb5d07a923941f488..936f4e806fa42b83dd6cdb21f1757126e2eff26b 100644 (file)
@@ -1196,7 +1196,7 @@ gld_${EMULATION_NAME}_get_script(isfile)
 EOF
 # Scripts compiled in.
 # sed commands to quote an ld script as a C string.
-sc="-f ${srcdir}/emultempl/stringify.sed"
+sc="-f stringify.sed"
 
 cat >>e${EMULATION_NAME}.c <<EOF
 {                           
diff --git a/ld/emultempl/stringify.sed b/ld/emultempl/stringify.sed
deleted file mode 100644 (file)
index a526d3f..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-s/["\\]/\\&/g
-s/$/\\n\\/
-1 s/^/"/
-$ s/$/n"/
index 61a5c01c6b2faac4b3103bc8e7c57e92e8d9c3c5..8f095fef3e653f6dbc00f1d43ded48f01f9bb77c 100644 (file)
@@ -971,28 +971,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.
This page took 0.059096 seconds and 4 git commands to generate.