diff options
author | Alan Modra <amodra@gmail.com> | 2019-10-15 23:06:21 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2019-10-16 11:03:34 +1030 |
commit | dfde93ab8ccdea59f667204bb93056c95a83dfda (patch) | |
tree | 8db5314abfd82794b2e6583c634fece62398cabe /ld | |
parent | 8ef6decbc1f3a5965fff70289e2bdccae3f9aa3c (diff) | |
download | gdb-dfde93ab8ccdea59f667204bb93056c95a83dfda.zip gdb-dfde93ab8ccdea59f667204bb93056c95a83dfda.tar.gz gdb-dfde93ab8ccdea59f667204bb93056c95a83dfda.tar.bz2 |
genscripts comment tidy
Some of the comments in this file are ancient and no longer reflect
reality. This patch removes those comments, and also the description
of ld options emitted to script files. While describing what an
option does in the script file might help reinforce what the option
does, it's unnecessary and makes for overlong lines. Also, some of
the descriptions did not mention all the options.
* genscripts.sh: Correct comments. Remove outdated comment block
saying "Generate 5 or 6 script files..". Remove description of
ld options from comment emitted to script files, and order options
as per comment block in genscripts.sh saying which scripts are
generated.
Diffstat (limited to 'ld')
-rw-r--r-- | ld/ChangeLog | 8 | ||||
-rwxr-xr-x | ld/genscripts.sh | 95 |
2 files changed, 45 insertions, 58 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index f8dca86..5553095 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,11 @@ +2019-10-16 Alan Modra <amodra@gmail.com> + + * genscripts.sh: Correct comments. Remove outdated comment block + saying "Generate 5 or 6 script files..". Remove description of + ld options from comment emitted to script files, and order options + as per comment block in genscripts.sh saying which scripts are + generated. + 2019-10-14 Alan Modra <amodra@gmail.com> * ldctor.h (struct set_element): Make next field a union, adding diff --git a/ld/genscripts.sh b/ld/genscripts.sh index cb2b081..3853f9b 100755 --- a/ld/genscripts.sh +++ b/ld/genscripts.sh @@ -63,7 +63,7 @@ # depending on platform specific settings linker scripts with the # following suffixes might be generated as well: # -# xdwe: -pie -z combreloc -z separate-code -z now +# xdwe: -pie -z combreloc -z separate-code -z relro -z now # xdw: -pie -z combreloc -z relro -z now # xdceo: -pie -z combreloc -z separate-code -z relro # xdce: -pie -z combreloc -z separate-code @@ -74,7 +74,7 @@ # xdo: -pie -z relro # xd: -pie # -# xswe: -shared -z combreloc -z separate-code -z now +# xswe: -shared -z combreloc -z separate-code -z relro -z now # xsw: -shared -z combreloc -z relro -z now # xsceo: -shared -z combreloc -z separate-code -z relro # xsce: -shared -z combreloc -z separate-code @@ -85,7 +85,7 @@ # xso: -shared -z relro # xs: -shared # -# xwe: -z combreloc -z separate-code -z now +# xwe: -z combreloc -z separate-code -z relro -z now # xw: -z combreloc -z relro -z now # xceo: -z combreloc -z separate-code -z relro # xce: -z combreloc -z separate-code @@ -286,27 +286,6 @@ if [ "x$1" = "x$EMULATION_NAME" ]; then echo "set libpath \"${LIB_PATH}\"" | sed -e 's/:/ /g' > tmpdir/libpath.exp fi -# Generate 5 or 6 script files from a master script template in -# ${srcdir}/scripttempl/${SCRIPT_NAME}.sh. Which one of the 5 or 6 -# script files is actually used depends on command line options given -# to ld. (SCRIPT_NAME was set in the emulparams_file.) -# -# A .x script file is the default script. -# A .xr script is for linking without relocation (-r flag). -# A .xu script is like .xr, but *do* create constructors (-Ur flag). -# A .xn script is for linking with -n flag (mix text and data on same page). -# A .xbn script is for linking with -N flag (mix text and data on same page). -# A .xs script is for generating a shared library with the --shared -# flag; it is only generated if $GENERATE_SHLIB_SCRIPT is set by the -# emulation parameters. -# A .xc script is for linking with -z combreloc; it is only generated if -# $GENERATE_COMBRELOC_SCRIPT is set by the emulation parameters or -# $SCRIPT_NAME is "elf". -# A .xsc script is for linking with --shared -z combreloc; it is generated -# if $GENERATE_COMBRELOC_SCRIPT is set by the emulation parameters or -# $SCRIPT_NAME is "elf" and $GENERATE_SHLIB_SCRIPT is set by the emulation -# parameters too. - if [ "x$SCRIPT_NAME" = "xelf" ]; then GENERATE_COMBRELOC_SCRIPT=yes fi @@ -325,7 +304,7 @@ DATA_ALIGNMENT_u="${DATA_ALIGNMENT_u-${DATA_ALIGNMENT_r}}" LD_FLAG=r DATA_ALIGNMENT=${DATA_ALIGNMENT_r} DEFAULT_DATA_ALIGNMENT="ALIGN(${SEGMENT_SIZE})" -( echo "/* Script for ld -r: link without relocation */" +( echo "/* Script for -r */" source_sh ${CUSTOMIZER_SCRIPT} source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xr @@ -333,7 +312,7 @@ DEFAULT_DATA_ALIGNMENT="ALIGN(${SEGMENT_SIZE})" LD_FLAG=u DATA_ALIGNMENT=${DATA_ALIGNMENT_u} CONSTRUCTING=" " -( echo "/* Script for ld -Ur: link w/out relocation, do create constructors */" +( echo "/* Script for -Ur */" source_sh ${CUSTOMIZER_SCRIPT} source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xu @@ -347,7 +326,7 @@ LD_FLAG= ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.x LD_FLAG=textonly -( echo "/* Script for -z separate-code: generate normal executables with separate code segment */" +( echo "/* Script for -z separate-code */" source_sh ${CUSTOMIZER_SCRIPT} source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xe @@ -355,12 +334,12 @@ LD_FLAG=textonly if test -n "$GENERATE_RELRO_SCRIPT"; then LD_FLAG= RELRO=" " - ( echo "/* Script for -z relo: generate normal executables with separate code segment */" + ( echo "/* Script for -z relro */" source_sh ${CUSTOMIZER_SCRIPT} source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xo LD_FLAG=textonly - ( echo "/* Script for -z separate-code -z relo: generate normal executables with separate code segment */" + ( echo "/* Script for -z separate-code -z relro */" source_sh ${CUSTOMIZER_SCRIPT} source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xeo @@ -368,14 +347,14 @@ if test -n "$GENERATE_RELRO_SCRIPT"; then fi LD_FLAG=n DATA_ALIGNMENT=${DATA_ALIGNMENT_n} -( echo "/* Script for -n: mix text and data on same page */" +( echo "/* Script for -n */" source_sh ${CUSTOMIZER_SCRIPT} source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xn LD_FLAG=N DATA_ALIGNMENT=${DATA_ALIGNMENT_N} -( echo "/* Script for -N: mix text and data on same page; don't align data */" +( echo "/* Script for -N */" source_sh ${CUSTOMIZER_SCRIPT} source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xbn @@ -384,14 +363,14 @@ if test -n "$GENERATE_COMBRELOC_SCRIPT"; then DATA_ALIGNMENT=${DATA_ALIGNMENT_c-${DATA_ALIGNMENT_}} LD_FLAG=c COMBRELOC=ldscripts/${EMULATION_NAME}.xc.tmp - ( echo "/* Script for -z combreloc: combine and sort reloc sections */" + ( echo "/* Script for -z combreloc */" source_sh ${CUSTOMIZER_SCRIPT} source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xc rm -f ${COMBRELOC} LD_FLAG=ctextonly COMBRELOC=ldscripts/${EMULATION_NAME}.xce.tmp - ( echo "/* Script for -z combreloc -z separate-code: combine and sort reloc sections with separate code segment */" + ( echo "/* Script for -z combreloc -z separate-code */" source_sh ${CUSTOMIZER_SCRIPT} source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xce @@ -399,14 +378,14 @@ if test -n "$GENERATE_COMBRELOC_SCRIPT"; then RELRO_NOW=" " LD_FLAG=w COMBRELOC=ldscripts/${EMULATION_NAME}.xw.tmp - ( echo "/* Script for -z combreloc -z now -z relro: combine and sort reloc sections */" + ( echo "/* Script for -z combreloc -z relro -z now */" source_sh ${CUSTOMIZER_SCRIPT} source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xw rm -f ${COMBRELOC} LD_FLAG=wtextonly COMBRELOC=ldscripts/${EMULATION_NAME}.xwe.tmp - ( echo "/* Script for -z combreloc -z now -z relro -z separate-code: combine and sort reloc sections with separate code segment */" + ( echo "/* Script for -z combreloc -z separate-code -z relro -z now */" source_sh ${CUSTOMIZER_SCRIPT} source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xwe @@ -417,14 +396,14 @@ if test -n "$GENERATE_COMBRELOC_SCRIPT"; then LD_FLAG=c RELRO=" " COMBRELOC=ldscripts/${EMULATION_NAME}.xco.tmp - ( echo "/* Script for -z combreloc -z relro: combine and sort reloc sections */" + ( echo "/* Script for -z combreloc -z relro */" source_sh ${CUSTOMIZER_SCRIPT} source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xco rm -f ${COMBRELOC} LD_FLAG=ctextonly COMBRELOC=ldscripts/${EMULATION_NAME}.xceo.tmp - ( echo "/* Script for -z combreloc -z separate-code -z relro: combine and sort reloc sections */" + ( echo "/* Script for -z combreloc -z separate-code -z relro */" source_sh ${CUSTOMIZER_SCRIPT} source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xceo @@ -438,12 +417,12 @@ if test -n "$GENERATE_SHLIB_SCRIPT"; then DATA_ALIGNMENT=${DATA_ALIGNMENT_s-${DATA_ALIGNMENT_}} CREATE_SHLIB=" " LD_FLAG=shared - ( echo "/* Script for ld --shared: link shared library */" + ( echo "/* Script for -shared */" source_sh ${CUSTOMIZER_SCRIPT} source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xs LD_FLAG=sharedtextonly - ( echo "/* Script for ld --shared -z separate-code: link shared library with separate code segment */" + ( echo "/* Script for -shared -z separate-code */" source_sh ${CUSTOMIZER_SCRIPT} source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xse @@ -451,12 +430,12 @@ if test -n "$GENERATE_SHLIB_SCRIPT"; then if test -n "$GENERATE_RELRO_SCRIPT"; then RELRO=" " LD_FLAG=shared - ( echo "/* Script for ld --shared -z relro: link shared library */" + ( echo "/* Script for -shared -z relro */" source_sh ${CUSTOMIZER_SCRIPT} source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xso LD_FLAG=sharedtextonly - ( echo "/* Script for ld --shared -z relro -z separate-code: link shared library with separate code segment */" + ( echo "/* Script for -shared -z separate-code -z relro */" source_sh ${CUSTOMIZER_SCRIPT} source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xseo @@ -466,14 +445,14 @@ if test -n "$GENERATE_SHLIB_SCRIPT"; then DATA_ALIGNMENT=${DATA_ALIGNMENT_sc-${DATA_ALIGNMENT}} LD_FLAG=cshared COMBRELOC=ldscripts/${EMULATION_NAME}.xsc.tmp - ( echo "/* Script for --shared -z combreloc: shared library, combine & sort relocs */" + ( echo "/* Script for -shared -z combreloc */" source_sh ${CUSTOMIZER_SCRIPT} source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xsc rm -f ${COMBRELOC} LD_FLAG=csharedtextonly COMBRELOC=ldscripts/${EMULATION_NAME}.xsce.tmp - ( echo "/* Script for --shared -z combreloc -z separate-code: shared library, combine & sort relocs with separate code segment */" + ( echo "/* Script for -shared -z combreloc -z separate-code */" source_sh ${CUSTOMIZER_SCRIPT} source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xsce @@ -481,14 +460,14 @@ if test -n "$GENERATE_SHLIB_SCRIPT"; then RELRO_NOW=" " LD_FLAG=wshared COMBRELOC=ldscripts/${EMULATION_NAME}.xsw.tmp - ( echo "/* Script for --shared -z combreloc -z now -z relro: shared library, combine & sort relocs */" + ( echo "/* Script for -shared -z combreloc -z relro -z now */" source_sh ${CUSTOMIZER_SCRIPT} source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xsw rm -f ${COMBRELOC} LD_FLAG=wsharedtextonly COMBRELOC=ldscripts/${EMULATION_NAME}.xswe.tmp - ( echo "/* Script for --shared -z combreloc -z now -z relro -z separate-code: shared library, combine & sort relocs with separate code segment */" + ( echo "/* Script for -shared -z combreloc -z separate-code -z relro -z now */" source_sh ${CUSTOMIZER_SCRIPT} source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xswe @@ -499,14 +478,14 @@ if test -n "$GENERATE_SHLIB_SCRIPT"; then LD_FLAG=wshared RELRO=" " COMBRELOC=ldscripts/${EMULATION_NAME}.xsco.tmp - ( echo "/* Script for --shared -z combreloc -z relro: shared library, combine & sort relocs with separate code segment */" + ( echo "/* Script for -shared -z combreloc -z relro */" source_sh ${CUSTOMIZER_SCRIPT} source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xsco rm -f ${COMBRELOC} LD_FLAG=wsharedtextonly COMBRELOC=ldscripts/${EMULATION_NAME}.xsceo.tmp - ( echo "/* Script for --shared -z combreloc -z relro -z separate-code: shared library, combine & sort relocs with separate code segment */" + ( echo "/* Script for -shared -z combreloc -z separate-code -z relro */" source_sh ${CUSTOMIZER_SCRIPT} source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xsceo @@ -522,24 +501,24 @@ if test -n "$GENERATE_PIE_SCRIPT"; then DATA_ALIGNMENT=${DATA_ALIGNMENT_s-${DATA_ALIGNMENT_}} CREATE_PIE=" " LD_FLAG=pie - ( echo "/* Script for ld -pie: link position independent executable */" + ( echo "/* Script for -pie */" source_sh ${CUSTOMIZER_SCRIPT} source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xd LD_FLAG=pietextonly - ( echo "/* Script for ld -pie -z separate-code: link position independent executable with separate code segment */" + ( echo "/* Script for -pie -z separate-code */" source_sh ${CUSTOMIZER_SCRIPT} source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xde if test -n "$GENERATE_RELRO_SCRIPT"; then RELRO=" " LD_FLAG=pie - ( echo "/* Script for ld -pie -z relro: link position independent executable */" + ( echo "/* Script for -pie -z relro */" source_sh ${CUSTOMIZER_SCRIPT} source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xdo LD_FLAG=pietextonly - ( echo "/* Script for ld -pie -z relro -z separate-code: link position independent executable with separate code segment */" + ( echo "/* Script for -pie -z separate-code -z relro */" source_sh ${CUSTOMIZER_SCRIPT} source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xdeo @@ -549,14 +528,14 @@ if test -n "$GENERATE_PIE_SCRIPT"; then DATA_ALIGNMENT=${DATA_ALIGNMENT_sc-${DATA_ALIGNMENT}} COMBRELOC=ldscripts/${EMULATION_NAME}.xdc.tmp LD_FLAG=cpie - ( echo "/* Script for -pie -z combreloc: position independent executable, combine & sort relocs */" + ( echo "/* Script for -pie -z combreloc */" source_sh ${CUSTOMIZER_SCRIPT} source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xdc rm -f ${COMBRELOC} LD_FLAG=cpietextonly COMBRELOC=ldscripts/${EMULATION_NAME}.xdce.tmp - ( echo "/* Script for -pie -z combreloc -z separate-code: position independent executable, combine & sort relocs with separate code segment */" + ( echo "/* Script for -pie -z combreloc -z separate-code */" source_sh ${CUSTOMIZER_SCRIPT} source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xdce @@ -564,14 +543,14 @@ if test -n "$GENERATE_PIE_SCRIPT"; then RELRO_NOW=" " LD_FLAG=wpie COMBRELOC=ldscripts/${EMULATION_NAME}.xdw.tmp - ( echo "/* Script for -pie -z combreloc -z now -z relro: position independent executable, combine & sort relocs */" + ( echo "/* Script for -pie -z combreloc -z relro -z now */" source_sh ${CUSTOMIZER_SCRIPT} source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xdw rm -f ${COMBRELOC} LD_FLAG=wpietextonly COMBRELOC=ldscripts/${EMULATION_NAME}.xdwe.tmp - ( echo "/* Script for -pie -z combreloc -z now -z relro -z separate-code: position independent executable, combine & sort relocs with separate code segment */" + ( echo "/* Script for -pie -z combreloc -z separate-code -z relro -z now */" source_sh ${CUSTOMIZER_SCRIPT} source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xdwe @@ -582,14 +561,14 @@ if test -n "$GENERATE_PIE_SCRIPT"; then LD_FLAG=wpie RELRO=" " COMBRELOC=ldscripts/${EMULATION_NAME}.xdco.tmp - ( echo "/* Script for -pie -z combreloc -z relro: position independent executable, combine & sort relocs with separate code segment */" + ( echo "/* Script for -pie -z combreloc -z relro */" source_sh ${CUSTOMIZER_SCRIPT} source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xdco rm -f ${COMBRELOC} LD_FLAG=wpietextonly COMBRELOC=ldscripts/${EMULATION_NAME}.xdceo.tmp - ( echo "/* Script for -pie -z combreloc -z relro -z separate-code: position independent executable, combine & sort relocs with separate code segment */" + ( echo "/* Script for -pie -z combreloc -z separate-code -z relro */" source_sh ${CUSTOMIZER_SCRIPT} source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xdceo @@ -605,7 +584,7 @@ fi if test -n "$GENERATE_AUTO_IMPORT_SCRIPT"; then LD_FLAG=auto_import DATA_ALIGNMENT=${DATA_ALIGNMENT_} - ( echo "/* Script for ld --enable-auto-import: Like the default script except read only data is placed into .data */" + ( echo "/* Script for --enable-auto-import */" source_sh ${CUSTOMIZER_SCRIPT} source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xa |