From 597e25914ec5895fba8097946514d4b8c878eb0a Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 6 Aug 1999 22:46:03 +0000 Subject: * 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. --- ld/emultempl/aix.em | 4 ++-- ld/emultempl/armcoff.em | 4 ++-- ld/emultempl/armelf.em | 2 +- ld/emultempl/armelf_oabi.em | 2 +- ld/emultempl/astring.sed | 13 +++++++++++++ ld/emultempl/beos.em | 4 ++-- ld/emultempl/elf32.em | 35 ++++++++++++++--------------------- ld/emultempl/generic.em | 4 ++-- ld/emultempl/gld960.em | 29 +++++++++++++---------------- ld/emultempl/gld960c.em | 29 +++++++++++++---------------- ld/emultempl/hppaelf.em | 29 +++++++++++++---------------- ld/emultempl/linux.em | 29 +++++++++++++---------------- ld/emultempl/lnk960.em | 30 ++++++++++++++---------------- ld/emultempl/mipsecoff.em | 4 ++-- ld/emultempl/ostring.sed | 4 ++++ ld/emultempl/pe.em | 2 +- ld/emultempl/stringify.sed | 4 ---- ld/emultempl/sunos.em | 27 ++++++++++++--------------- 18 files changed, 122 insertions(+), 133 deletions(-) create mode 100644 ld/emultempl/astring.sed create mode 100644 ld/emultempl/ostring.sed delete mode 100644 ld/emultempl/stringify.sed (limited to 'ld/emultempl') diff --git a/ld/emultempl/aix.em b/ld/emultempl/aix.em index c77857f822d..6748af0b387 100644 --- a/ld/emultempl/aix.em +++ b/ld/emultempl/aix.em @@ -4,7 +4,7 @@ cat >e${EMULATION_NAME}.c < AIX support by Ian Lance Taylor @@ -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 <e${EMULATION_NAME}.c <>e${EMULATION_NAME}.c <>e${EMULATION_NAME}.c <>e${EMULATION_NAME}.c <e${EMULATION_NAME}.c <>e${EMULATION_NAME}.c <>e${EMULATION_NAME}.c <> 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 <> e${EMULATION_NAME}.c +sed $sc ldscripts/${EMULATION_NAME}.xs >> e${EMULATION_NAME}.c fi -cat >>e${EMULATION_NAME}.c <> 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. diff --git a/ld/emultempl/generic.em b/ld/emultempl/generic.em index 1c0c8eb214d..9a3f530782b 100644 --- a/ld/emultempl/generic.em +++ b/ld/emultempl/generic.em @@ -4,7 +4,7 @@ cat >e${EMULATION_NAME}.c <>e${EMULATION_NAME}.c <e${EMULATION_NAME}.c <>e${EMULATION_NAME}.c <> 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. diff --git a/ld/emultempl/gld960c.em b/ld/emultempl/gld960c.em index 20cb5eda4ef..4789b22e5bc 100644 --- a/ld/emultempl/gld960c.em +++ b/ld/emultempl/gld960c.em @@ -1,7 +1,7 @@ # This shell script emits a C file. -*- C -*- # It does some substitutions. cat >e${EMULATION_NAME}.c <>e${EMULATION_NAME}.c <> 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. diff --git a/ld/emultempl/hppaelf.em b/ld/emultempl/hppaelf.em index c0ca113db46..69abe3ba2e3 100644 --- a/ld/emultempl/hppaelf.em +++ b/ld/emultempl/hppaelf.em @@ -2,7 +2,7 @@ # It does some substitutions. cat >e${EMULATION_NAME}.c <>e${EMULATION_NAME}.c <> 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. diff --git a/ld/emultempl/linux.em b/ld/emultempl/linux.em index 29f5bd1b559..b8a03ff607f 100644 --- a/ld/emultempl/linux.em +++ b/ld/emultempl/linux.em @@ -4,7 +4,7 @@ cat >e${EMULATION_NAME}.c < Linux support by Eric Youngdale @@ -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 <> 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. diff --git a/ld/emultempl/lnk960.em b/ld/emultempl/lnk960.em index 066d46bb328..9df2f609af9 100644 --- a/ld/emultempl/lnk960.em +++ b/ld/emultempl/lnk960.em @@ -2,7 +2,7 @@ # It does some substitutions. cat >e${EMULATION_NAME}.c <>e${EMULATION_NAME}.c <> 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. diff --git a/ld/emultempl/mipsecoff.em b/ld/emultempl/mipsecoff.em index d1200c46d70..10d5924691f 100644 --- a/ld/emultempl/mipsecoff.em +++ b/ld/emultempl/mipsecoff.em @@ -4,7 +4,7 @@ cat >e${EMULATION_NAME}.c < 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 <>e${EMULATION_NAME}.c <>e${EMULATION_NAME}.c <> 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. -- cgit v1.2.3-65-gdbad