2 # genscripts.sh - generate the ld-emulation-target specific files
3 # Copyright (C) 2004-2024 Free Software Foundation, Inc.
5 # This file is part of the Gnu Linker.
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 3, or (at your option)
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with GLD; see the file COPYING. If not, write to the Free
19 # Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
22 # Usage: genscripts_extra.sh \
33 # enable_initfini_array \
40 # genscripts_extra.sh \
45 # sparc-sun-sunos4.1.3 \
46 # sparc-sun-sunos4.1.3 \
47 # sparc-sun-sunos4.1.3 \
52 # sparc-sun-sunos4.1.3 \
55 # produces the linker scripts:
57 # sun3.x [default linker script]
58 # sun3.xbn [used when the linker is invoked with "-N"]
59 # sun3.xn [used when the linker is invoked with "-n"]
60 # sun3.xr [used when the linker is invoked with "-r"]
61 # sun3.xu [used when the linker is invoked with "-Ur"]
63 # depending on platform specific settings linker scripts with the
64 # following suffixes might be generated as well:
66 # xdwe: -pie -z combreloc -z separate-code -z relro -z now
67 # xdwer: -pie -z combreloc -z separate-code -z relro -z now --rosegment
68 # xdw: -pie -z combreloc -z relro -z now
69 # xdceo: -pie -z combreloc -z separate-code -z relro
70 # xdceor: -pie -z combreloc -z separate-code -z relro --rosegment
71 # xdce: -pie -z combreloc -z separate-code
72 # xdcer: -pie -z combreloc -z separate-code --rosegment
73 # xdco: -pie -z combreloc -z relro
74 # xdc: -pie -z combreloc
75 # xdeo: -pie -z separate-code -z relro
76 # xdeor: -pie -z separate-code -z relro --rosegment
77 # xde: -pie -z separate-code
78 # xder: -pie -z separate-code --rosegment
82 # xswe: -shared -z combreloc -z separate-code -z relro -z now
83 # xswer: -shared -z combreloc -z separate-code -z relro -z now --rosegment
84 # xsw: -shared -z combreloc -z relro -z now
85 # xsceo: -shared -z combreloc -z separate-code -z relro
86 # xsceor: -shared -z combreloc -z separate-code -z relro --rosegment
87 # xsce: -shared -z combreloc -z separate-code
88 # xscer: -shared -z combreloc -z separate-code --rosegment
89 # xsco: -shared -z combreloc -z relro
90 # xsc: -shared -z combreloc
91 # xseo: -shared -z separate-code -z relro
92 # xseor: -shared -z separate-code -z relro --rosegment
93 # xse: -shared -z separate-code
94 # xser: -shared -z separate-code --rosegment
95 # xso: -shared -z relro
98 # xwe: -z combreloc -z separate-code -z relro -z now --rosegment
99 # xwer: -z combreloc -z separate-code -z relro -z now
100 # xw: -z combreloc -z relro -z now
101 # xceo: -z combreloc -z separate-code -z relro
102 # xceor: -z combreloc -z separate-code -z relro --rosegment
103 # xce: -z combreloc -z separate-code
104 # xcer: -z combreloc -z separate-code --rosegment
105 # xco: -z combreloc -z relro
107 # xeo: -z separate-code -z relro
108 # xeor: -z separate-code -z relro --rosegment
109 # xe: -z separate-code
110 # xer: -z separate-code --rosegment
114 # It also produced the C source file:
118 # which is then compiled into the linker.
120 # The linker scripts are created by running the shell script
121 # /sources/ld/emulparams/sparc.sh to set the value of ${SCRIPT_NAME}
122 # (and any other variables it wants to). ${SCRIPT_NAME} is then
123 # invoked with a variable called ${LD_FLAG} to tell it which version
124 # of the linker script to create.
140 ENABLE_INITFINI_ARRAY
=$5
147 if test -n "${DEPDIR}"; then
148 echo $1 >> ${DEPDIR}/e
${EMULATION_NAME}.Tc
153 if test -n "${DEPDIR}"; then
154 rm -f ${DEPDIR}/e
${EMULATION_NAME}.Tc
157 # Include the emulation-specific parameters:
158 CUSTOMIZER_SCRIPT
="${srcdir}/emulparams/${EMULATION_NAME}.sh"
159 source_sh
${CUSTOMIZER_SCRIPT}
161 # Set some flags for the emultempl scripts. USE_LIBPATH will
162 # be set for any libpath-using emulation; NATIVE will be set for a
163 # libpath-using emulation where ${host} = ${target}. NATIVE
164 # may already have been set by the emulparams file, but that's OK
165 # (it'll just get set to "yes" twice).
167 case " $EMULATION_LIBPATH " in
168 *" ${EMULATION_NAME} "*)
169 if [ "x${host}" = "x${target}" ] ; then
172 elif [ "x${use_sysroot}" = "xyes" ] ; then
178 # If the emulparams file sets NATIVE, make sure USE_LIBPATH is set also.
179 if test "x$NATIVE" = "xyes" ; then
183 # Set the library search path, for libraries named by -lfoo.
184 # If LIB_PATH is defined (e.g., by Makefile) and non-empty, it is used.
185 # Otherwise, the default is set here.
187 # The format is the usual list of colon-separated directories.
188 # To force a logically empty LIB_PATH, do LIBPATH=":".
190 # If we are using a sysroot, prefix library paths with "=" to indicate this.
192 # If the emulparams file set LIBPATH_SUFFIX, prepend an extra copy of
193 # the library path with the suffix applied.
195 # Paths with LIBPATH_SUFFIX
197 # Paths without LIBPATH_SUFFIX
199 if [ "${LIB_PATH}" != ":" ] ; then
200 lib_path2
=${LIB_PATH}
203 # Add args to lib_path1 and lib_path2, discarding any duplicates
208 # The "=" is harmless if we aren't using a sysroot, but also needless.
209 if [ "x${use_sysroot}" = "xyes" ] ; then
213 for libpath_suffix
in ${LIBPATH_SUFFIX}; do
216 case :${lib_path1}: in
218 ::) lib_path1
=${lib} ;;
219 *) lib_path1
=${lib_path1}:${lib} ;;
222 if test -n "${LIBPATH_SUFFIX_SKIP}"; then
224 *${LIBPATH_SUFFIX_SKIP}) skip_lib
=yes ;;
227 if test "${skip_lib}" = "no"; then
228 case :${lib_path1}: in
229 *:${lib}${libpath_suffix}:*) ;;
230 ::) lib_path1
=${lib}${libpath_suffix} ;;
231 *) lib_path1
=${lib_path1}:${lib}${libpath_suffix} ;;
236 if test "${skip_lib}" = "no"; then
237 case :${lib_path1}:${lib_path2}: in
239 *::) lib_path2
=${lib} ;;
240 *) lib_path2
=${lib_path2}:${lib} ;;
247 # Always search $(tooldir)/lib, aka /usr/local/TARGET/lib when native
248 # except when LIBPATH=":".
249 if [ "${LIB_PATH}" != ":" ] ; then
251 if [ "x${TOOL_LIB}" = "x" ] ; then
252 if [ "x${NATIVE}" = "xyes" ] ; then
253 libs
="${exec_prefix}/${target_alias}/lib"
256 # For multilib'ed targets, ensure both ${target_alias}/lib${LIBPATH_SUFFIX}
257 # and ${TOOL_LIB}/lib${LIBPATH_SUFFIX} are in the default search path,
258 # because 64bit libraries may be in both places, depending on
259 # cross-development setup method (e.g.: /usr/s390x-linux/lib64
260 # vs. /usr/s390-linux/lib64)
261 for libpath_suffix
in ${LIBPATH_SUFFIX}; do
262 case "${NATIVE}:${libpath_suffix}:${TOOL_LIB}" in
263 :* |
*::* |
*:*:*${libpath_suffix}) ;;
264 *) libs
="${exec_prefix}/${target_alias}/lib${libpath_suffix}" ;;
267 libs
="${exec_prefix}/${TOOL_LIB}/lib ${libs}"
269 append_to_lib_path
${libs}
272 if [ "x${LIB_PATH}" = "x" ] && [ "x${USE_LIBPATH}" = xyes
] ; then
273 libs
=${NATIVE_LIB_DIRS}
274 if [ "x${NATIVE}" = "xyes" ] ; then
277 *) libs
="${libdir} ${libs}" ;;
280 append_to_lib_path
${libs}
283 case :${lib_path1}:${lib_path2}: in
284 *:: |
::*) LIB_PATH
=${lib_path1}${lib_path2} ;;
285 *) LIB_PATH
=${lib_path1}:${lib_path2} ;;
288 LIB_SEARCH_DIRS
=`echo ${LIB_PATH} | sed -e 's/:/ /g' -e 's/\([^ ][^ ]*\)/SEARCH_DIR(\\"\1\\");/g'`
290 # We need it for testsuite.
291 set $EMULATION_LIBPATH
292 if [ "x$1" = "x$EMULATION_NAME" ]; then
293 test -d tmpdir || mkdir tmpdir
294 rm -f tmpdir
/libpath.exp
295 echo "set libpath \"${LIB_PATH}\"" |
sed -e 's/:/ /g' > tmpdir
/libpath.exp
298 if [ "x$SCRIPT_NAME" = "xelf" ]; then
299 GENERATE_COMBRELOC_SCRIPT
=yes
302 SEGMENT_SIZE
=${SEGMENT_SIZE-${MAXPAGESIZE-${TARGET_PAGE_SIZE}}}
304 # Determine DATA_ALIGNMENT for the 5 variants, using
305 # values specified in the emulparams/<script_to_run>.sh file or default.
307 DATA_ALIGNMENT_
="${DATA_ALIGNMENT_-${DATA_ALIGNMENT-ALIGN(${SEGMENT_SIZE})}}"
308 DATA_ALIGNMENT_n
="${DATA_ALIGNMENT_n-${DATA_ALIGNMENT_}}"
309 DATA_ALIGNMENT_N
="${DATA_ALIGNMENT_N-${DATA_ALIGNMENT-.}}"
310 DATA_ALIGNMENT_r
="${DATA_ALIGNMENT_r-${DATA_ALIGNMENT-}}"
311 DATA_ALIGNMENT_u
="${DATA_ALIGNMENT_u-${DATA_ALIGNMENT_r}}"
313 # Create scripts using different settings of the LD_FLAG variable
316 DATA_ALIGNMENT
=${DATA_ALIGNMENT_r}
317 DEFAULT_DATA_ALIGNMENT
="ALIGN(${SEGMENT_SIZE})"
318 ( echo "/* Script for -r */"
319 source_sh
${CUSTOMIZER_SCRIPT}
320 source_sh
${srcdir}/scripttempl
/${SCRIPT_NAME}.sc
321 ) |
sed -e '/^ *$/d;s/[ ]*$//' > ldscripts
/${EMULATION_NAME}.xr
324 DATA_ALIGNMENT
=${DATA_ALIGNMENT_u}
326 ( echo "/* Script for -Ur */"
327 source_sh
${CUSTOMIZER_SCRIPT}
328 source_sh
${srcdir}/scripttempl
/${SCRIPT_NAME}.sc
329 ) |
sed -e '/^ *$/d;s/[ ]*$//' > ldscripts
/${EMULATION_NAME}.xu
331 DATA_ALIGNMENT
=${DATA_ALIGNMENT_}
334 ( echo "/* Default linker script, for normal executables */"
335 source_sh
${CUSTOMIZER_SCRIPT}
336 source_sh
${srcdir}/scripttempl
/${SCRIPT_NAME}.sc
337 ) |
sed -e '/^ *$/d;s/[ ]*$//' > ldscripts
/${EMULATION_NAME}.x
340 ( echo "/* Script for -z separate-code */"
341 source_sh
${CUSTOMIZER_SCRIPT}
342 source_sh
${srcdir}/scripttempl
/${SCRIPT_NAME}.sc
343 ) |
sed -e '/^ *$/d;s/[ ]*$//' > ldscripts
/${EMULATION_NAME}.xe
346 ( echo "/* Script for -z separate-code --rosegment */"
347 source_sh
${CUSTOMIZER_SCRIPT}
348 source_sh
${srcdir}/scripttempl
/${SCRIPT_NAME}.sc
349 ) |
sed -e '/^ *$/d;s/[ ]*$//' > ldscripts
/${EMULATION_NAME}.xer
351 if test -n "$GENERATE_RELRO_SCRIPT"; then
355 ( echo "/* Script for -z relro */"
356 source_sh
${CUSTOMIZER_SCRIPT}
357 source_sh
${srcdir}/scripttempl
/${SCRIPT_NAME}.sc
358 ) |
sed -e '/^ *$/d;s/[ ]*$//' > ldscripts
/${EMULATION_NAME}.xo
361 ( echo "/* Script for -z separate-code -z relro */"
362 source_sh
${CUSTOMIZER_SCRIPT}
363 source_sh
${srcdir}/scripttempl
/${SCRIPT_NAME}.sc
364 ) |
sed -e '/^ *$/d;s/[ ]*$//' > ldscripts
/${EMULATION_NAME}.xeo
367 ( echo "/* Script for -z separate-code -z relro --rosegment */"
368 source_sh
${CUSTOMIZER_SCRIPT}
369 source_sh
${srcdir}/scripttempl
/${SCRIPT_NAME}.sc
370 ) |
sed -e '/^ *$/d;s/[ ]*$//' > ldscripts
/${EMULATION_NAME}.xeor
376 DATA_ALIGNMENT
=${DATA_ALIGNMENT_n}
377 ( echo "/* Script for -n */"
378 source_sh
${CUSTOMIZER_SCRIPT}
379 source_sh
${srcdir}/scripttempl
/${SCRIPT_NAME}.sc
380 ) |
sed -e '/^ *$/d;s/[ ]*$//' > ldscripts
/${EMULATION_NAME}.xn
383 DATA_ALIGNMENT
=${DATA_ALIGNMENT_N}
384 ( echo "/* Script for -N */"
385 source_sh
${CUSTOMIZER_SCRIPT}
386 source_sh
${srcdir}/scripttempl
/${SCRIPT_NAME}.sc
387 ) |
sed -e '/^ *$/d;s/[ ]*$//' > ldscripts
/${EMULATION_NAME}.xbn
389 if test -n "$GENERATE_COMBRELOC_SCRIPT"; then
390 DATA_ALIGNMENT
=${DATA_ALIGNMENT_c-${DATA_ALIGNMENT_}}
392 COMBRELOC
=ldscripts
/${EMULATION_NAME}.xc.tmp
393 ( echo "/* Script for -z combreloc */"
394 source_sh
${CUSTOMIZER_SCRIPT}
395 source_sh
${srcdir}/scripttempl
/${SCRIPT_NAME}.sc
396 ) |
sed -e '/^ *$/d;s/[ ]*$//' > ldscripts
/${EMULATION_NAME}.xc
400 COMBRELOC
=ldscripts
/${EMULATION_NAME}.xce.tmp
401 ( echo "/* Script for -z combreloc -z separate-code */"
402 source_sh
${CUSTOMIZER_SCRIPT}
403 source_sh
${srcdir}/scripttempl
/${SCRIPT_NAME}.sc
404 ) |
sed -e '/^ *$/d;s/[ ]*$//' > ldscripts
/${EMULATION_NAME}.xce
408 COMBRELOC
=ldscripts
/${EMULATION_NAME}.xcer.tmp
409 ( echo "/* Script for -z combreloc -z separate-code --rosegment */"
410 source_sh
${CUSTOMIZER_SCRIPT}
411 source_sh
${srcdir}/scripttempl
/${SCRIPT_NAME}.sc
412 ) |
sed -e '/^ *$/d;s/[ ]*$//' > ldscripts
/${EMULATION_NAME}.xcer
418 COMBRELOC
=ldscripts
/${EMULATION_NAME}.xw.tmp
419 ( echo "/* Script for -z combreloc -z relro -z now */"
420 source_sh
${CUSTOMIZER_SCRIPT}
421 source_sh
${srcdir}/scripttempl
/${SCRIPT_NAME}.sc
422 ) |
sed -e '/^ *$/d;s/[ ]*$//' > ldscripts
/${EMULATION_NAME}.xw
426 COMBRELOC
=ldscripts
/${EMULATION_NAME}.xwe.tmp
427 ( echo "/* Script for -z combreloc -z separate-code -z relro -z now */"
428 source_sh
${CUSTOMIZER_SCRIPT}
429 source_sh
${srcdir}/scripttempl
/${SCRIPT_NAME}.sc
430 ) |
sed -e '/^ *$/d;s/[ ]*$//' > ldscripts
/${EMULATION_NAME}.xwe
435 COMBRELOC
=ldscripts
/${EMULATION_NAME}.xwer.tmp
436 ( echo "/* Script for -z combreloc -z separate-code -z relro -z now --rosegment */"
437 source_sh
${CUSTOMIZER_SCRIPT}
438 source_sh
${srcdir}/scripttempl
/${SCRIPT_NAME}.sc
439 ) |
sed -e '/^ *$/d;s/[ ]*$//' > ldscripts
/${EMULATION_NAME}.xwer
445 if test -n "$GENERATE_RELRO_SCRIPT"; then
449 COMBRELOC
=ldscripts
/${EMULATION_NAME}.xco.tmp
450 ( echo "/* Script for -z combreloc -z relro */"
451 source_sh
${CUSTOMIZER_SCRIPT}
452 source_sh
${srcdir}/scripttempl
/${SCRIPT_NAME}.sc
453 ) |
sed -e '/^ *$/d;s/[ ]*$//' > ldscripts
/${EMULATION_NAME}.xco
457 COMBRELOC
=ldscripts
/${EMULATION_NAME}.xceo.tmp
458 ( echo "/* Script for -z combreloc -z separate-code -z relro */"
459 source_sh
${CUSTOMIZER_SCRIPT}
460 source_sh
${srcdir}/scripttempl
/${SCRIPT_NAME}.sc
461 ) |
sed -e '/^ *$/d;s/[ ]*$//' > ldscripts
/${EMULATION_NAME}.xceo
466 COMBRELOC
=ldscripts
/${EMULATION_NAME}.xceor.tmp
467 ( echo "/* Script for -z combreloc -z separate-code -z relro --rosegment */"
468 source_sh
${CUSTOMIZER_SCRIPT}
469 source_sh
${srcdir}/scripttempl
/${SCRIPT_NAME}.sc
470 ) |
sed -e '/^ *$/d;s/[ ]*$//' > ldscripts
/${EMULATION_NAME}.xceor
478 if test -n "$GENERATE_SHLIB_SCRIPT"; then
480 DATA_ALIGNMENT
=${DATA_ALIGNMENT_s-${DATA_ALIGNMENT_}}
483 ( echo "/* Script for -shared */"
484 source_sh
${CUSTOMIZER_SCRIPT}
485 source_sh
${srcdir}/scripttempl
/${SCRIPT_NAME}.sc
486 ) |
sed -e '/^ *$/d;s/[ ]*$//' > ldscripts
/${EMULATION_NAME}.xs
488 LD_FLAG
=sharedtextonly
489 ( echo "/* Script for -shared -z separate-code */"
490 source_sh
${CUSTOMIZER_SCRIPT}
491 source_sh
${srcdir}/scripttempl
/${SCRIPT_NAME}.sc
492 ) |
sed -e '/^ *$/d;s/[ ]*$//' > ldscripts
/${EMULATION_NAME}.xse
494 LD_FLAG
=rosharedtextonly
495 ( echo "/* Script for -shared -z separate-code --rosegment */"
496 source_sh
${CUSTOMIZER_SCRIPT}
497 source_sh
${srcdir}/scripttempl
/${SCRIPT_NAME}.sc
498 ) |
sed -e '/^ *$/d;s/[ ]*$//' > ldscripts
/${EMULATION_NAME}.xser
500 if test -n "$GENERATE_RELRO_SCRIPT"; then
504 ( echo "/* Script for -shared -z relro */"
505 source_sh
${CUSTOMIZER_SCRIPT}
506 source_sh
${srcdir}/scripttempl
/${SCRIPT_NAME}.sc
507 ) |
sed -e '/^ *$/d;s/[ ]*$//' > ldscripts
/${EMULATION_NAME}.xso
509 LD_FLAG
=sharedtextonly
510 ( echo "/* Script for -shared -z separate-code -z relro */"
511 source_sh
${CUSTOMIZER_SCRIPT}
512 source_sh
${srcdir}/scripttempl
/${SCRIPT_NAME}.sc
513 ) |
sed -e '/^ *$/d;s/[ ]*$//' > ldscripts
/${EMULATION_NAME}.xseo
515 LD_FLAG
=rosharedtextonly
516 ( echo "/* Script for -shared -z separate-code -z relro --rosegment */"
517 source_sh
${CUSTOMIZER_SCRIPT}
518 source_sh
${srcdir}/scripttempl
/${SCRIPT_NAME}.sc
519 ) |
sed -e '/^ *$/d;s/[ ]*$//' > ldscripts
/${EMULATION_NAME}.xseor
524 if test -n "$GENERATE_COMBRELOC_SCRIPT"; then
525 DATA_ALIGNMENT
=${DATA_ALIGNMENT_sc-${DATA_ALIGNMENT}}
527 COMBRELOC
=ldscripts
/${EMULATION_NAME}.xsc.tmp
528 ( echo "/* Script for -shared -z combreloc */"
529 source_sh
${CUSTOMIZER_SCRIPT}
530 source_sh
${srcdir}/scripttempl
/${SCRIPT_NAME}.sc
531 ) |
sed -e '/^ *$/d;s/[ ]*$//' > ldscripts
/${EMULATION_NAME}.xsc
534 LD_FLAG
=csharedtextonly
535 COMBRELOC
=ldscripts
/${EMULATION_NAME}.xsce.tmp
536 ( echo "/* Script for -shared -z combreloc -z separate-code */"
537 source_sh
${CUSTOMIZER_SCRIPT}
538 source_sh
${srcdir}/scripttempl
/${SCRIPT_NAME}.sc
539 ) |
sed -e '/^ *$/d;s/[ ]*$//' > ldscripts
/${EMULATION_NAME}.xsce
542 LD_FLAG
=rocsharedtextonly
543 COMBRELOC
=ldscripts
/${EMULATION_NAME}.xscer.tmp
544 ( echo "/* Script for -shared -z combreloc -z separate-code --rosegment */"
545 source_sh
${CUSTOMIZER_SCRIPT}
546 source_sh
${srcdir}/scripttempl
/${SCRIPT_NAME}.sc
547 ) |
sed -e '/^ *$/d;s/[ ]*$//' > ldscripts
/${EMULATION_NAME}.xscer
553 COMBRELOC
=ldscripts
/${EMULATION_NAME}.xsw.tmp
554 ( echo "/* Script for -shared -z combreloc -z relro -z now */"
555 source_sh
${CUSTOMIZER_SCRIPT}
556 source_sh
${srcdir}/scripttempl
/${SCRIPT_NAME}.sc
557 ) |
sed -e '/^ *$/d;s/[ ]*$//' > ldscripts
/${EMULATION_NAME}.xsw
560 LD_FLAG
=wsharedtextonly
561 COMBRELOC
=ldscripts
/${EMULATION_NAME}.xswe.tmp
562 ( echo "/* Script for -shared -z combreloc -z separate-code -z relro -z now */"
563 source_sh
${CUSTOMIZER_SCRIPT}
564 source_sh
${srcdir}/scripttempl
/${SCRIPT_NAME}.sc
565 ) |
sed -e '/^ *$/d;s/[ ]*$//' > ldscripts
/${EMULATION_NAME}.xswe
568 LD_FLAG
=rowsharedtextonly
569 COMBRELOC
=ldscripts
/${EMULATION_NAME}.xswe.tmp
570 ( echo "/* Script for -shared -z combreloc -z separate-code -z relro -z now --rosegment */"
571 source_sh
${CUSTOMIZER_SCRIPT}
572 source_sh
${srcdir}/scripttempl
/${SCRIPT_NAME}.sc
573 ) |
sed -e '/^ *$/d;s/[ ]*$//' > ldscripts
/${EMULATION_NAME}.xswer
578 if test -n "$GENERATE_RELRO_SCRIPT"; then
582 COMBRELOC
=ldscripts
/${EMULATION_NAME}.xsco.tmp
583 ( echo "/* Script for -shared -z combreloc -z relro */"
584 source_sh
${CUSTOMIZER_SCRIPT}
585 source_sh
${srcdir}/scripttempl
/${SCRIPT_NAME}.sc
586 ) |
sed -e '/^ *$/d;s/[ ]*$//' > ldscripts
/${EMULATION_NAME}.xsco
589 LD_FLAG
=wsharedtextonly
590 COMBRELOC
=ldscripts
/${EMULATION_NAME}.xsceo.tmp
591 ( echo "/* Script for -shared -z combreloc -z separate-code -z relro */"
592 source_sh
${CUSTOMIZER_SCRIPT}
593 source_sh
${srcdir}/scripttempl
/${SCRIPT_NAME}.sc
594 ) |
sed -e '/^ *$/d;s/[ ]*$//' > ldscripts
/${EMULATION_NAME}.xsceo
597 LD_FLAG
=rowsharedtextonly
598 COMBRELOC
=ldscripts
/${EMULATION_NAME}.xsceor.tmp
599 ( echo "/* Script for -shared -z combreloc -z separate-code -z relro --rosegment */"
600 source_sh
${CUSTOMIZER_SCRIPT}
601 source_sh
${srcdir}/scripttempl
/${SCRIPT_NAME}.sc
602 ) |
sed -e '/^ *$/d;s/[ ]*$//' > ldscripts
/${EMULATION_NAME}.xsceor
614 if test -n "$GENERATE_PIE_SCRIPT"; then
617 DATA_ALIGNMENT
=${DATA_ALIGNMENT_s-${DATA_ALIGNMENT_}}
619 ( echo "/* Script for -pie */"
620 source_sh
${CUSTOMIZER_SCRIPT}
621 source_sh
${srcdir}/scripttempl
/${SCRIPT_NAME}.sc
622 ) |
sed -e '/^ *$/d;s/[ ]*$//' > ldscripts
/${EMULATION_NAME}.xd
625 ( echo "/* Script for -pie -z separate-code */"
626 source_sh
${CUSTOMIZER_SCRIPT}
627 source_sh
${srcdir}/scripttempl
/${SCRIPT_NAME}.sc
628 ) |
sed -e '/^ *$/d;s/[ ]*$//' > ldscripts
/${EMULATION_NAME}.xde
630 LD_FLAG
=ropietextonly
631 ( echo "/* Script for -pie -z separate-code --rosegment */"
632 source_sh
${CUSTOMIZER_SCRIPT}
633 source_sh
${srcdir}/scripttempl
/${SCRIPT_NAME}.sc
634 ) |
sed -e '/^ *$/d;s/[ ]*$//' > ldscripts
/${EMULATION_NAME}.xder
636 if test -n "$GENERATE_RELRO_SCRIPT"; then
640 ( echo "/* Script for -pie -z relro */"
641 source_sh
${CUSTOMIZER_SCRIPT}
642 source_sh
${srcdir}/scripttempl
/${SCRIPT_NAME}.sc
643 ) |
sed -e '/^ *$/d;s/[ ]*$//' > ldscripts
/${EMULATION_NAME}.xdo
646 ( echo "/* Script for -pie -z separate-code -z relro */"
647 source_sh
${CUSTOMIZER_SCRIPT}
648 source_sh
${srcdir}/scripttempl
/${SCRIPT_NAME}.sc
649 ) |
sed -e '/^ *$/d;s/[ ]*$//' > ldscripts
/${EMULATION_NAME}.xdeo
651 LD_FLAG
=ropietextonly
652 ( echo "/* Script for -pie -z separate-code -z relro --rosegment */"
653 source_sh
${CUSTOMIZER_SCRIPT}
654 source_sh
${srcdir}/scripttempl
/${SCRIPT_NAME}.sc
655 ) |
sed -e '/^ *$/d;s/[ ]*$//' > ldscripts
/${EMULATION_NAME}.xdeor
660 if test -n "$GENERATE_COMBRELOC_SCRIPT"; then
661 DATA_ALIGNMENT
=${DATA_ALIGNMENT_sc-${DATA_ALIGNMENT}}
662 COMBRELOC
=ldscripts
/${EMULATION_NAME}.xdc.tmp
664 ( echo "/* Script for -pie -z combreloc */"
665 source_sh
${CUSTOMIZER_SCRIPT}
666 source_sh
${srcdir}/scripttempl
/${SCRIPT_NAME}.sc
667 ) |
sed -e '/^ *$/d;s/[ ]*$//' > ldscripts
/${EMULATION_NAME}.xdc
671 COMBRELOC
=ldscripts
/${EMULATION_NAME}.xdce.tmp
672 ( echo "/* Script for -pie -z combreloc -z separate-code */"
673 source_sh
${CUSTOMIZER_SCRIPT}
674 source_sh
${srcdir}/scripttempl
/${SCRIPT_NAME}.sc
675 ) |
sed -e '/^ *$/d;s/[ ]*$//' > ldscripts
/${EMULATION_NAME}.xdce
678 LD_FLAG
=rocpietextonly
679 COMBRELOC
=ldscripts
/${EMULATION_NAME}.xdcer.tmp
680 ( echo "/* Script for -pie -z combreloc -z separate-code --rosegment */"
681 source_sh
${CUSTOMIZER_SCRIPT}
682 source_sh
${srcdir}/scripttempl
/${SCRIPT_NAME}.sc
683 ) |
sed -e '/^ *$/d;s/[ ]*$//' > ldscripts
/${EMULATION_NAME}.xdcer
689 COMBRELOC
=ldscripts
/${EMULATION_NAME}.xdw.tmp
690 ( echo "/* Script for -pie -z combreloc -z relro -z now */"
691 source_sh
${CUSTOMIZER_SCRIPT}
692 source_sh
${srcdir}/scripttempl
/${SCRIPT_NAME}.sc
693 ) |
sed -e '/^ *$/d;s/[ ]*$//' > ldscripts
/${EMULATION_NAME}.xdw
697 COMBRELOC
=ldscripts
/${EMULATION_NAME}.xdwe.tmp
698 ( echo "/* Script for -pie -z combreloc -z separate-code -z relro -z now */"
699 source_sh
${CUSTOMIZER_SCRIPT}
700 source_sh
${srcdir}/scripttempl
/${SCRIPT_NAME}.sc
701 ) |
sed -e '/^ *$/d;s/[ ]*$//' > ldscripts
/${EMULATION_NAME}.xdwe
704 LD_FLAG
=rowpietextonly
705 COMBRELOC
=ldscripts
/${EMULATION_NAME}.xdwer.tmp
706 ( echo "/* Script for -pie -z combreloc -z separate-code -z relro -z now --rosegment */"
707 source_sh
${CUSTOMIZER_SCRIPT}
708 source_sh
${srcdir}/scripttempl
/${SCRIPT_NAME}.sc
709 ) |
sed -e '/^ *$/d;s/[ ]*$//' > ldscripts
/${EMULATION_NAME}.xdwer
714 if test -n "$GENERATE_RELRO_SCRIPT"; then
718 COMBRELOC
=ldscripts
/${EMULATION_NAME}.xdco.tmp
719 ( echo "/* Script for -pie -z combreloc -z relro */"
720 source_sh
${CUSTOMIZER_SCRIPT}
721 source_sh
${srcdir}/scripttempl
/${SCRIPT_NAME}.sc
722 ) |
sed -e '/^ *$/d;s/[ ]*$//' > ldscripts
/${EMULATION_NAME}.xdco
726 COMBRELOC
=ldscripts
/${EMULATION_NAME}.xdceo.tmp
727 ( echo "/* Script for -pie -z combreloc -z separate-code -z relro */"
728 source_sh
${CUSTOMIZER_SCRIPT}
729 source_sh
${srcdir}/scripttempl
/${SCRIPT_NAME}.sc
730 ) |
sed -e '/^ *$/d;s/[ ]*$//' > ldscripts
/${EMULATION_NAME}.xdceo
733 LD_FLAG
=rowpietextonly
734 COMBRELOC
=ldscripts
/${EMULATION_NAME}.xdceor.tmp
735 ( echo "/* Script for -pie -z combreloc -z separate-code -z relro --rosegment */"
736 source_sh
${CUSTOMIZER_SCRIPT}
737 source_sh
${srcdir}/scripttempl
/${SCRIPT_NAME}.sc
738 ) |
sed -e '/^ *$/d;s/[ ]*$//' > ldscripts
/${EMULATION_NAME}.xdceor
750 if test -n "$GENERATE_AUTO_IMPORT_SCRIPT"; then
752 DATA_ALIGNMENT
=${DATA_ALIGNMENT_}
753 ( echo "/* Script for --enable-auto-import */"
754 source_sh
${CUSTOMIZER_SCRIPT}
755 source_sh
${srcdir}/scripttempl
/${SCRIPT_NAME}.sc
756 ) |
sed -e '/^ *$/d;s/[ ]*$//' > ldscripts
/${EMULATION_NAME}.xa
759 case "$COMPILE_IN: $EMULATION_LIBPATH " in
760 :*" ${EMULATION_NAME} "*) COMPILE_IN
=yes;;
764 # Determine if the shell has support for the variable BASH_LINENO.
765 # When it is the case, it is only available inside functions.
768 test "x$BASH_LINENO" != "x"
771 # Enable accruate error source in the compiler error messages, if possible.
773 .
${srcdir}/genscrba.sh
781 cat >> e
${EMULATION_NAME}.c
785 # Generate e${EMULATION_NAME}.c.
786 # Start with an empty file, then the sourced .em script
787 # can use the "fragment" function to append.
788 > e
${EMULATION_NAME}.c
789 source_em
${srcdir}/emultempl
/${TEMPLATE_NAME-generic}.em
791 if test -n "${DEPDIR}"; then
793 for dep
in `cat ${DEPDIR}/e${EMULATION_NAME}.Tc`; do
796 *) ecdeps
="$ecdeps $dep" ;;
799 rm -f ${DEPDIR}/e
${EMULATION_NAME}.Tc
800 echo "e${EMULATION_NAME}.c:${ecdeps}" > ${DEPDIR}/e${EMULATION_NAME}.Pc