public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* genscripts comment tidy
@ 2019-10-16  0:33 Alan Modra
  2019-10-16 14:10 ` Nick Alcock
  0 siblings, 1 reply; 7+ messages in thread
From: Alan Modra @ 2019-10-16  0:33 UTC (permalink / raw)
  To: binutils

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.

diff --git a/ld/genscripts.sh b/ld/genscripts.sh
index cb2b081e9e..3853f9b859 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

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: genscripts comment tidy
  2019-10-16  0:33 genscripts comment tidy Alan Modra
@ 2019-10-16 14:10 ` Nick Alcock
  2019-10-16 14:16   ` Nick Clifton
  2019-10-16 23:47   ` genscripts comment tidy Alan Modra
  0 siblings, 2 replies; 7+ messages in thread
From: Nick Alcock @ 2019-10-16 14:10 UTC (permalink / raw)
  To: Alan Modra; +Cc: binutils

On 16 Oct 2019, Alan Modra spake thusly:

> -# 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.

Is this stuff still documented anywhere after this commit? Because I
know I found this specific comment very useful only a month ago, and the
purpose of the differently suffixed linker scripts is otherwise quite opaque.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: genscripts comment tidy
  2019-10-16 14:10 ` Nick Alcock
@ 2019-10-16 14:16   ` Nick Clifton
  2019-10-16 18:18     ` Nick Alcock
  2019-10-16 23:47   ` genscripts comment tidy Alan Modra
  1 sibling, 1 reply; 7+ messages in thread
From: Nick Clifton @ 2019-10-16 14:16 UTC (permalink / raw)
  To: Nick Alcock, Alan Modra; +Cc: binutils

Hi Nick,

>> -# A .x script file is the default script.
>> -# A .xr script is for linking without relocation (-r flag).

> Is this stuff still documented anywhere after this commit?  

No. :-(  But it would be nice to have.  Fancy writing a node in
the ld.texi file ?

Cheers
  Nick

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: genscripts comment tidy
  2019-10-16 14:16   ` Nick Clifton
@ 2019-10-16 18:18     ` Nick Alcock
  2020-05-31 12:42       ` ld CTF deduplicator should be coming fairly soon (was Re: genscripts comment tidy) Nick Alcock
  0 siblings, 1 reply; 7+ messages in thread
From: Nick Alcock @ 2019-10-16 18:18 UTC (permalink / raw)
  To: Nick Clifton; +Cc: Alan Modra, binutils

On 16 Oct 2019, Nick Clifton spake thusly:

> Hi Nick,
>
>>> -# A .x script file is the default script.
>>> -# A .xr script is for linking without relocation (-r flag).
>
>> Is this stuff still documented anywhere after this commit?  
>
> No. :-(  But it would be nice to have.  Fancy writing a node in
> the ld.texi file ?

Maybe in a week or two. I really really want to get a working CTF
deduplicator posted here first. :)

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: genscripts comment tidy
  2019-10-16 14:10 ` Nick Alcock
  2019-10-16 14:16   ` Nick Clifton
@ 2019-10-16 23:47   ` Alan Modra
  1 sibling, 0 replies; 7+ messages in thread
From: Alan Modra @ 2019-10-16 23:47 UTC (permalink / raw)
  To: Nick Alcock; +Cc: binutils

On Wed, Oct 16, 2019 at 03:10:01PM +0100, Nick Alcock wrote:
> On 16 Oct 2019, Alan Modra spake thusly:
> 
> > -# 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.
> 
> Is this stuff still documented anywhere after this commit? Because I
> know I found this specific comment very useful only a month ago, and the
> purpose of the differently suffixed linker scripts is otherwise quite opaque.

~/build/gas/x86_64-linux/ld/ldscripts$ grep 'Script for' elf_x86_64.x*
elf_x86_64.xbn:/* Script for -N */
elf_x86_64.xc:/* Script for -z combreloc */
elf_x86_64.xce:/* Script for -z combreloc -z separate-code */
elf_x86_64.xd:/* Script for -pie */
elf_x86_64.xdc:/* Script for -pie -z combreloc */
elf_x86_64.xdce:/* Script for -pie -z combreloc -z separate-code */
elf_x86_64.xde:/* Script for -pie -z separate-code */
elf_x86_64.xdw:/* Script for -pie -z combreloc -z relro -z now */
elf_x86_64.xdwe:/* Script for -pie -z combreloc -z separate-code -z relro -z now */
elf_x86_64.xe:/* Script for -z separate-code */
elf_x86_64.xn:/* Script for -n */
elf_x86_64.xr:/* Script for -r */
elf_x86_64.xs:/* Script for -shared */
elf_x86_64.xsc:/* Script for -shared -z combreloc */
elf_x86_64.xsce:/* Script for -shared -z combreloc -z separate-code */
elf_x86_64.xse:/* Script for -shared -z separate-code */
elf_x86_64.xsw:/* Script for -shared -z combreloc -z relro -z now */
elf_x86_64.xswe:/* Script for -shared -z combreloc -z separate-code -z relro -z now */
elf_x86_64.xu:/* Script for -Ur */
elf_x86_64.xw:/* Script for -z combreloc -z relro -z now */
elf_x86_64.xwe:/* Script for -z combreloc -z separate-code -z relro -z now */

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 7+ messages in thread

* ld CTF deduplicator should be coming fairly soon (was Re: genscripts comment tidy)
  2019-10-16 18:18     ` Nick Alcock
@ 2020-05-31 12:42       ` Nick Alcock
  2020-05-31 17:10         ` Fangrui Song
  0 siblings, 1 reply; 7+ messages in thread
From: Nick Alcock @ 2020-05-31 12:42 UTC (permalink / raw)
  To: Nick Clifton, Alan Modra, binutils

On 16 Oct 2019, Nick Alcock spake thusly:
> On 16 Oct 2019, Nick Clifton spake thusly:
> > No. :-(  But it would be nice to have.  Fancy writing a node in
> > the ld.texi file ?
> Maybe in a week or two. I really really want to get a working CTF
> deduplicator posted here first. :)

Oh ha ha ha, hark at my foolish optimism. After literally months of
going up various blind alleys I have this working at long last and am
getting it into shape for posting in the next week or two (as multiple
series, preparatory stuff and bugfixes in existing code first,
deduplicator second, with a bunch of ld performance and resulting-
CTF-size figures in the cover letter for the second series).

Minimal impact outside libctf/ (a couple of new command-line options to
enable different varieties of type deduplication that authors of very
large codebases might like: would -z be a suitable place in the option
space for that? Perhaps -z ctf-*? I've never been entirely on what -z
stands for...)

Going silent like this is bad of me, sorry. I'll try not to do it again:
with ld dedup in, libctf approaches usability (with only one more libctf
feature needed before GDB can map from symbols to types without DWARF)
and it becomes more important that I pay attention!

Catching up with massive binutils list backlog first, but if it turns
out nobody's documented the genscripts stuff in the meantime, I might
get to writing that genscripts texinfo node :)

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: ld CTF deduplicator should be coming fairly soon (was Re: genscripts comment tidy)
  2020-05-31 12:42       ` ld CTF deduplicator should be coming fairly soon (was Re: genscripts comment tidy) Nick Alcock
@ 2020-05-31 17:10         ` Fangrui Song
  0 siblings, 0 replies; 7+ messages in thread
From: Fangrui Song @ 2020-05-31 17:10 UTC (permalink / raw)
  To: Nick Alcock; +Cc: Nick Clifton, Alan Modra, binutils

On Sun, May 31, 2020 at 5:42 AM Nick Alcock via Binutils
<binutils@sourceware.org> wrote:
>
> On 16 Oct 2019, Nick Alcock spake thusly:
> > On 16 Oct 2019, Nick Clifton spake thusly:
> > > No. :-(  But it would be nice to have.  Fancy writing a node in
> > > the ld.texi file ?
> > Maybe in a week or two. I really really want to get a working CTF
> > deduplicator posted here first. :)
>
> Oh ha ha ha, hark at my foolish optimism. After literally months of
> going up various blind alleys I have this working at long last and am
> getting it into shape for posting in the next week or two (as multiple
> series, preparatory stuff and bugfixes in existing code first,
> deduplicator second, with a bunch of ld performance and resulting-
> CTF-size figures in the cover letter for the second series).
>
> Minimal impact outside libctf/ (a couple of new command-line options to
> enable different varieties of type deduplication that authors of very
> large codebases might like: would -z be a suitable place in the option
> space for that? Perhaps -z ctf-*? I've never been entirely on what -z
> stands for...)

I guess this is just due to how GNU ld handles command line options.
lexsup.c handles common options for all binary formats.
emultemp/elf.em handles ELF specific -z options.

> Going silent like this is bad of me, sorry. I'll try not to do it again:
> with ld dedup in, libctf approaches usability (with only one more libctf
> feature needed before GDB can map from symbols to types without DWARF)
> and it becomes more important that I pay attention!
>
> Catching up with massive binutils list backlog first, but if it turns
> out nobody's documented the genscripts stuff in the meantime, I might
> get to writing that genscripts texinfo node :)

One (strong) objection remains:) I think strip/objcopy should drop
.ctf by default.
This is always how the tools work and I don't think .ctf should break it.
(And I don't think breaking the rule can give .ctf a significant market share -
which is the whole purpose behind the intention to break the rule).
Distribution package managers which want to adopt .ctf should opt-in,
rather than opt-out.
Many pieces of software do strip in their build systems. They do want
to drop extra sections
added by distribution CFLAGS/CXXFLAGS. For some software (e.g.
seabios), not able to dropping unneeded sections can lead to failures.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-05-31 17:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-16  0:33 genscripts comment tidy Alan Modra
2019-10-16 14:10 ` Nick Alcock
2019-10-16 14:16   ` Nick Clifton
2019-10-16 18:18     ` Nick Alcock
2020-05-31 12:42       ` ld CTF deduplicator should be coming fairly soon (was Re: genscripts comment tidy) Nick Alcock
2020-05-31 17:10         ` Fangrui Song
2019-10-16 23:47   ` genscripts comment tidy Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).