ld script lower-case absolute and sizeof_headers

Message ID YRZyWdpdWGQ4Nhu2@squeak.grove.modra.org
State New
Headers show
Series
  • ld script lower-case absolute and sizeof_headers
Related show

Commit Message

Alan Modra via Binutils Aug. 13, 2021, 1:23 p.m.
I think these happened by accident, so let's see what breaks if they
are removed.

	* ldlex.l: Remove lower case "absolute" and "sizeof_headers"
	in non-mri mode.
	* ld.texi: Remove sizeof_headers index.
	* testsuite/ld-mmix/mmohdr1.ld: Use SIZEOF_HEADERS.


-- 
Alan Modra
Australia Development Lab, IBM

Patch

diff --git a/ld/ld.texi b/ld/ld.texi
index 71cfaa3d1b1..72b5c373ba1 100644
--- a/ld/ld.texi
+++ b/ld/ld.texi
@@ -7044,7 +7044,6 @@  SECTIONS@{ @dots{}
 @end smallexample
 
 @item SIZEOF_HEADERS
-@itemx sizeof_headers
 @kindex SIZEOF_HEADERS
 @cindex header size
 Return the size in bytes of the output file's headers.  This is
diff --git a/ld/ldlex.l b/ld/ldlex.l
index dfe8382d0bb..b0861d78e49 100644
--- a/ld/ldlex.l
+++ b/ld/ldlex.l
@@ -245,6 +245,7 @@  V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^\\]([*?.$_a-zA-Z0-9\[\]\-\!\^\\]|::)*
 <SCRIPT,EXPRESSION>"ADDR"		{ RTOKEN(ADDR);}
 <SCRIPT,EXPRESSION>"LOADADDR"		{ RTOKEN(LOADADDR);}
 <SCRIPT,EXPRESSION>"ALIGNOF"		{ RTOKEN(ALIGNOF); }
+<SCRIPT,EXPRESSION>"ABSOLUTE"		{ RTOKEN(ABSOLUTE); }
 <EXPRESSION>"MAX"			{ RTOKEN(MAX_K); }
 <EXPRESSION>"MIN"			{ RTOKEN(MIN_K); }
 <EXPRESSION>"LOG2CEIL"			{ RTOKEN(LOG2CEIL); }
@@ -252,7 +253,6 @@  V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^\\]([*?.$_a-zA-Z0-9\[\]\-\!\^\\]|::)*
 <SCRIPT,WILD>"ENTRY"			{ RTOKEN(ENTRY);}
 <SCRIPT,MRI>"EXTERN"			{ RTOKEN(EXTERN);}
 <SCRIPT,EXPRESSION>"NEXT"		{ RTOKEN(NEXT);}
-<SCRIPT,EXPRESSION>"sizeof_headers"	{ RTOKEN(SIZEOF_HEADERS);}
 <SCRIPT,EXPRESSION>"SIZEOF_HEADERS"	{ RTOKEN(SIZEOF_HEADERS);}
 <SCRIPT,EXPRESSION>"SEGMENT_START"	{ RTOKEN(SEGMENT_START);}
 <SCRIPT>"MAP"				{ RTOKEN(MAP);}
@@ -325,6 +325,7 @@  V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^\\]([*?.$_a-zA-Z0-9\[\]\-\!\^\\]|::)*
 <MRI>"*".*			{ /* Mri comment line */ }
 <MRI>";".*			{ /* Mri comment line */ }
 <MRI>"END"			{ RTOKEN(ENDWORD); }
+<MRI>"ABSOLUTE"			{ RTOKEN(ABSOLUTE); }
 <MRI>"ALIGNMOD"			{ RTOKEN(ALIGNMOD);}
 <MRI>"ALIGN"			{ RTOKEN(ALIGN_K);}
 <MRI>"CHIP"			{ RTOKEN(CHIP); }
@@ -340,8 +341,8 @@  V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^\\]([*?.$_a-zA-Z0-9\[\]\-\!\^\\]|::)*
 <MRI>"START"			{ RTOKEN(START); }
 <MRI>"LIST".*			{ RTOKEN(LIST); /* LIST and ignore to end of line */ }
 <MRI>"SECT"			{ RTOKEN(SECT); }
-<SCRIPT,EXPRESSION,MRI>"ABSOLUTE"			{ RTOKEN(ABSOLUTE); }
 <MRI>"end"			{ RTOKEN(ENDWORD); }
+<MRI>"absolute"			{ RTOKEN(ABSOLUTE); }
 <MRI>"alignmod"			{ RTOKEN(ALIGNMOD);}
 <MRI>"align"			{ RTOKEN(ALIGN_K);}
 <MRI>"chip"			{ RTOKEN(CHIP); }
@@ -358,7 +359,6 @@  V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^\\]([*?.$_a-zA-Z0-9\[\]\-\!\^\\]|::)*
 <MRI>"start"			{ RTOKEN(START); }
 <MRI>"list".*			{ RTOKEN(LIST); /* LIST and ignore to end of line */ }
 <MRI>"sect"			{ RTOKEN(SECT); }
-<SCRIPT,EXPRESSION,MRI>"absolute"			{ RTOKEN(ABSOLUTE); }
 
 <MRI>{FILENAMECHAR1}{NOCFILENAMECHAR}*	{
 /* Filename without commas, needed to parse mri stuff */
diff --git a/ld/testsuite/ld-mmix/mmohdr1.ld b/ld/testsuite/ld-mmix/mmohdr1.ld
index 716c3f42c5d..d4f2f13c51b 100644
--- a/ld/testsuite/ld-mmix/mmohdr1.ld
+++ b/ld/testsuite/ld-mmix/mmohdr1.ld
@@ -3,7 +3,7 @@  OUTPUT_FORMAT("mmo")
 ENTRY(Main)
 SECTIONS
 {
-  .text 0x100 + sizeof_headers :
+  .text 0x100 + SIZEOF_HEADERS :
   { *(.text); Main = _start; }
 
   .MMIX.reg_contents :