* 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.
This commit is contained in:
Ian Lance Taylor
1999-08-06 22:46:03 +00:00
parent 4a607dcc2c
commit 597e25914e
22 changed files with 198 additions and 131 deletions

View 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> 1999-08-05 Donn Terry <donn@interix.com>
* emulparams/i386pe.sh: Define ENTRY, SUBSYSTEM, and * emulparams/i386pe.sh: Define ENTRY, SUBSYSTEM, and

View File

@ -260,10 +260,13 @@ ldemul-list.h: Makefile
echo " 0") >ldemul-tmp.h echo " 0") >ldemul-tmp.h
mv ldemul-tmp.h ldemul-list.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. # 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@" 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@ @TDIRS@
ea29k.c: $(srcdir)/emulparams/a29k.sh \ ea29k.c: $(srcdir)/emulparams/a29k.sh \

View File

@ -95,6 +95,7 @@ PACKAGE = @PACKAGE@
POFILES = @POFILES@ POFILES = @POFILES@
POSUB = @POSUB@ POSUB = @POSUB@
RANLIB = @RANLIB@ RANLIB = @RANLIB@
STRINGIFY = @STRINGIFY@
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
USE_NLS = @USE_NLS@ USE_NLS = @USE_NLS@
USE_SYMBOL_UNDERSCORE = @USE_SYMBOL_UNDERSCORE@ 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. # 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@" 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 \ 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 ldwrite.c ldexp.c ldemul.c ldver.c ldmisc.c ldfile.c ldcref.c
@ -964,6 +965,9 @@ ldemul-list.h: Makefile
done;\ done;\
echo " 0") >ldemul-tmp.h echo " 0") >ldemul-tmp.h
mv ldemul-tmp.h ldemul-list.h mv ldemul-tmp.h ldemul-list.h
stringify.sed: ${srcdir}/emultempl/$(STRINGIFY)
cp ${srcdir}/emultempl/$(STRINGIFY) stringify.sed
@TDIRS@ @TDIRS@
ea29k.c: $(srcdir)/emulparams/a29k.sh \ ea29k.c: $(srcdir)/emulparams/a29k.sh \

37
ld/configure vendored
View File

@ -4717,6 +4717,42 @@ EOF
fi 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: # target-specific stuff:
all_targets= all_targets=
@ -5013,6 +5049,7 @@ s%@HDEFINES@%$HDEFINES%g
s%@HOSTING_CRT0@%$HOSTING_CRT0%g s%@HOSTING_CRT0@%$HOSTING_CRT0%g
s%@HOSTING_LIBS@%$HOSTING_LIBS%g s%@HOSTING_LIBS@%$HOSTING_LIBS%g
s%@NATIVE_LIB_DIRS@%$NATIVE_LIB_DIRS%g s%@NATIVE_LIB_DIRS@%$NATIVE_LIB_DIRS%g
s%@STRINGIFY@%$STRINGIFY%g
s%@EMUL@%$EMUL%g s%@EMUL@%$EMUL%g
/@TDIRS@/r $TDIRS /@TDIRS@/r $TDIRS
s%@TDIRS@%%g s%@TDIRS@%%g

View File

@ -68,6 +68,23 @@ BFD_NEED_DECLARATION(sbrk)
BFD_NEED_DECLARATION(getenv) BFD_NEED_DECLARATION(getenv)
BFD_NEED_DECLARATION(environ) 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: # target-specific stuff:
all_targets= all_targets=

View File

@ -4,7 +4,7 @@ cat >e${EMULATION_NAME}.c <<EOF
/* This file is is generated by a shell script. DO NOT EDIT! */ /* This file is is generated by a shell script. DO NOT EDIT! */
/* AIX emulation code for ${EMULATION_NAME} /* 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> Written by Steve Chamberlain <sac@cygnus.com>
AIX support by Ian Lance Taylor <ian@cygnus.com> AIX support by Ian Lance Taylor <ian@cygnus.com>
@ -985,7 +985,7 @@ then
# Scripts compiled in. # Scripts compiled in.
# sed commands to quote an ld script as a C string. # 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 cat >>e${EMULATION_NAME}.c <<EOF
{ {

View File

@ -4,7 +4,7 @@ cat >e${EMULATION_NAME}.c <<EOF
/* This file is is generated by a shell script. DO NOT EDIT! */ /* This file is is generated by a shell script. DO NOT EDIT! */
/* emulate the original gld for the given ${EMULATION_NAME} /* 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 Written by Steve Chamberlain steve@cygnus.com
This file is part of GLD, the Gnu Linker. This file is part of GLD, the Gnu Linker.
@ -220,7 +220,7 @@ then
# Scripts compiled in. # Scripts compiled in.
# sed commands to quote an ld script as a C string. # 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 cat >>e${EMULATION_NAME}.c <<EOF
{ {

View File

@ -1211,7 +1211,7 @@ then
# Scripts compiled in. # Scripts compiled in.
# sed commands to quote an ld script as a C string. # 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 cat >>e${EMULATION_NAME}.c <<EOF
{ {

View File

@ -105,7 +105,7 @@ then
# Scripts compiled in. # Scripts compiled in.
# sed commands to quote an ld script as a C string. # 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 cat >>e${EMULATION_NAME}.c <<EOF
{ {

13
ld/emultempl/astring.sed Normal file
View File

@ -0,0 +1,13 @@
s/["\\]/\\&/g
s/$/\\n\\/
1 s/^/"/
25s/\\$/"/
26s/^/"/
50s/\\$/"/
51s/^/"/
75s/\\$/"/
76s/^/"/
100s/\\$/"/
101s/^/"/
$ s/$/n"/
$ s/\\n"n"$/\\n"/

View File

@ -2,7 +2,7 @@
# It does some substitutions. # It does some substitutions.
cat >e${EMULATION_NAME}.c <<EOF cat >e${EMULATION_NAME}.c <<EOF
/* This file is part of GLD, the Gnu Linker. /* 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 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 it under the terms of the GNU General Public License as published by
@ -790,7 +790,7 @@ gld_${EMULATION_NAME}_get_script(isfile)
EOF EOF
# Scripts compiled in. # Scripts compiled in.
# sed commands to quote an ld script as a C string. # 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 cat >>e${EMULATION_NAME}.c <<EOF
{ {

View File

@ -1069,38 +1069,31 @@ then
# Scripts compiled in. # Scripts compiled in.
# sed commands to quote an ld script as a C string. # sed commands to quote an ld script as a C string.
sc='s/["\\]/\\&/g sc="-f stringify.sed"
s/$/\\n\\/
1s/^/"/
$s/$/n"/
'
cat >>e${EMULATION_NAME}.c <<EOF cat >>e${EMULATION_NAME}.c <<EOF
{ {
*isfile = 0; *isfile = 0;
if (link_info.relocateable == true && config.build_constructors == true) if (link_info.relocateable == true && config.build_constructors == true)
return `sed "$sc" ldscripts/${EMULATION_NAME}.xu`; return
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`;
EOF 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 if test -n "$GENERATE_SHLIB_SCRIPT" ; then
cat >>e${EMULATION_NAME}.c <<EOF echo ' ; else if (link_info.shared) return' >> e${EMULATION_NAME}.c
else if (link_info.shared) sed $sc ldscripts/${EMULATION_NAME}.xs >> e${EMULATION_NAME}.c
return `sed "$sc" ldscripts/${EMULATION_NAME}.xs`;
EOF
fi fi
cat >>e${EMULATION_NAME}.c <<EOF echo ' ; else return' >> e${EMULATION_NAME}.c
else sed $sc ldscripts/${EMULATION_NAME}.x >> e${EMULATION_NAME}.c
return `sed "$sc" ldscripts/${EMULATION_NAME}.x`; echo '; }' >> e${EMULATION_NAME}.c
}
EOF
else else
# Scripts read from the filesystem. # Scripts read from the filesystem.

View File

@ -4,7 +4,7 @@ cat >e${EMULATION_NAME}.c <<EOF
/* This file is is generated by a shell script. DO NOT EDIT! */ /* This file is is generated by a shell script. DO NOT EDIT! */
/* emulate the original gld for the given ${EMULATION_NAME} /* 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 Written by Steve Chamberlain steve@cygnus.com
This file is part of GLD, the Gnu Linker. This file is part of GLD, the Gnu Linker.
@ -56,7 +56,7 @@ then
# Scripts compiled in. # Scripts compiled in.
# sed commands to quote an ld script as a C string. # 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 cat >>e${EMULATION_NAME}.c <<EOF
{ {

View File

@ -1,7 +1,7 @@
# This shell script emits a C file. -*- C -*- # This shell script emits a C file. -*- C -*-
# It does some substitutions. # It does some substitutions.
cat >e${EMULATION_NAME}.c <<EOF 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. This file is part of GLD, the Gnu Linker.
@ -111,28 +111,25 @@ then
# Scripts compiled in. # Scripts compiled in.
# sed commands to quote an ld script as a C string. # sed commands to quote an ld script as a C string.
sc='s/["\\]/\\&/g sc="-f stringify.sed"
s/$/\\n\\/
1s/^/"/
$s/$/n"/
'
cat >>e${EMULATION_NAME}.c <<EOF cat >>e${EMULATION_NAME}.c <<EOF
{ {
*isfile = 0; *isfile = 0;
if (link_info.relocateable == true && config.build_constructors == true) if (link_info.relocateable == true && config.build_constructors == true)
return `sed "$sc" ldscripts/${EMULATION_NAME}.xu`; return
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`;
}
EOF 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 else
# Scripts read from the filesystem. # Scripts read from the filesystem.

View File

@ -1,7 +1,7 @@
# This shell script emits a C file. -*- C -*- # This shell script emits a C file. -*- C -*-
# It does some substitutions. # It does some substitutions.
cat >e${EMULATION_NAME}.c <<EOF 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. This file is part of GLD, the Gnu Linker.
@ -127,28 +127,25 @@ then
# Scripts compiled in. # Scripts compiled in.
# sed commands to quote an ld script as a C string. # sed commands to quote an ld script as a C string.
sc='s/["\\]/\\&/g sc="-f stringify.sed"
s/$/\\n\\/
1s/^/"/
$s/$/n"/
'
cat >>e${EMULATION_NAME}.c <<EOF cat >>e${EMULATION_NAME}.c <<EOF
{ {
*isfile = 0; *isfile = 0;
if (link_info.relocateable == true && config.build_constructors == true) if (link_info.relocateable == true && config.build_constructors == true)
return `sed "$sc" ldscripts/${EMULATION_NAME}.xu`; return
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`;
}
EOF 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 else
# Scripts read from the filesystem. # Scripts read from the filesystem.

View File

@ -2,7 +2,7 @@
# It does some substitutions. # It does some substitutions.
cat >e${EMULATION_NAME}.c <<EOF cat >e${EMULATION_NAME}.c <<EOF
/* An emulation for HP PA-RISC ELF linkers. /* 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 Written by Steve Chamberlain steve@cygnus.com
This file is part of GLD, the Gnu Linker. This file is part of GLD, the Gnu Linker.
@ -216,28 +216,25 @@ then
# Scripts compiled in. # Scripts compiled in.
# sed commands to quote an ld script as a C string. # sed commands to quote an ld script as a C string.
sc='s/["\\]/\\&/g sc="-f stringify.sed"
s/$/\\n\\/
1s/^/"/
$s/$/n"/
'
cat >>e${EMULATION_NAME}.c <<EOF cat >>e${EMULATION_NAME}.c <<EOF
{ {
*isfile = 0; *isfile = 0;
if (link_info.relocateable == true && config.build_constructors == true) if (link_info.relocateable == true && config.build_constructors == true)
return `sed "$sc" ldscripts/${EMULATION_NAME}.xu`; return
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`;
}
EOF 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 else
# Scripts read from the filesystem. # Scripts read from the filesystem.

View File

@ -4,7 +4,7 @@ cat >e${EMULATION_NAME}.c <<EOF
/* This file is is generated by a shell script. DO NOT EDIT! */ /* This file is is generated by a shell script. DO NOT EDIT! */
/* Linux a.out emulation code for ${EMULATION_NAME} /* 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> Written by Steve Chamberlain <sac@cygnus.com>
Linux support by Eric Youngdale <ericy@cais.cais.com> Linux support by Eric Youngdale <ericy@cais.cais.com>
@ -140,28 +140,25 @@ then
# Scripts compiled in. # Scripts compiled in.
# sed commands to quote an ld script as a C string. # sed commands to quote an ld script as a C string.
sc='s/["\\]/\\&/g sc="-f stringify.sed"
s/$/\\n\\/
1s/^/"/
$s/$/n"/
'
cat >>e${EMULATION_NAME}.c <<EOF cat >>e${EMULATION_NAME}.c <<EOF
{ {
*isfile = 0; *isfile = 0;
if (link_info.relocateable == true && config.build_constructors == true) if (link_info.relocateable == true && config.build_constructors == true)
return `sed "$sc" ldscripts/${EMULATION_NAME}.xu`; return
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`;
}
EOF 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 else
# Scripts read from the filesystem. # Scripts read from the filesystem.

View File

@ -2,7 +2,7 @@
# It does some substitutions. # It does some substitutions.
cat >e${EMULATION_NAME}.c <<EOF cat >e${EMULATION_NAME}.c <<EOF
/* intel coff loader emulation specific stuff /* 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 Written by Steve Chamberlain steve@cygnus.com
This file is part of GLD, the Gnu Linker. This file is part of GLD, the Gnu Linker.
@ -263,27 +263,25 @@ then
# Scripts compiled in. # Scripts compiled in.
# sed commands to quote an ld script as a C string. # sed commands to quote an ld script as a C string.
sc='s/["\\]/\\&/g sc="-f stringify.sed"
s/$/\\n\\/
1s/^/"/
$s/$/n"/
'
cat >>e${EMULATION_NAME}.c <<EOF cat >>e${EMULATION_NAME}.c <<EOF
{
*isfile = 0; *isfile = 0;
if (link_info.relocateable == true && config.build_constructors == true) if (link_info.relocateable == true && config.build_constructors == true)
return `sed "$sc" ldscripts/${EMULATION_NAME}.xu`; return
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`;
}
EOF 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 else
# Scripts read from the filesystem. # Scripts read from the filesystem.

View File

@ -4,7 +4,7 @@ cat >e${EMULATION_NAME}.c <<EOF
/* This file is is generated by a shell script. DO NOT EDIT! */ /* This file is is generated by a shell script. DO NOT EDIT! */
/* Handle embedded relocs for MIPS. /* 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. Written by Ian Lance Taylor <ian@cygnus.com> based on generic.em.
This file is part of GLD, the Gnu Linker. This file is part of GLD, the Gnu Linker.
@ -167,7 +167,7 @@ then
# Scripts compiled in. # Scripts compiled in.
# sed commands to quote an ld script as a C string. # 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 cat >>e${EMULATION_NAME}.c <<EOF
{ {

View File

@ -1196,7 +1196,7 @@ gld_${EMULATION_NAME}_get_script(isfile)
EOF EOF
# Scripts compiled in. # Scripts compiled in.
# sed commands to quote an ld script as a C string. # 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 cat >>e${EMULATION_NAME}.c <<EOF
{ {

View File

@ -971,28 +971,25 @@ then
# Scripts compiled in. # Scripts compiled in.
# sed commands to quote an ld script as a C string. # sed commands to quote an ld script as a C string.
sc='s/["\\]/\\&/g sc="-f stringify.sed"
s/$/\\n\\/
1s/^/"/
$s/$/n"/
'
cat >>e${EMULATION_NAME}.c <<EOF cat >>e${EMULATION_NAME}.c <<EOF
{ {
*isfile = 0; *isfile = 0;
if (link_info.relocateable == true && config.build_constructors == true) if (link_info.relocateable == true && config.build_constructors == true)
return `sed "$sc" ldscripts/${EMULATION_NAME}.xu`; return
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`;
}
EOF 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 else
# Scripts read from the filesystem. # Scripts read from the filesystem.