Mention whitespace in script expressions

Message ID YROjCBGjuHcTun79@squeak.grove.modra.org
State New
Headers show
Series
  • Mention whitespace in script expressions
Related show

Commit Message

Alan Modra via Binutils Aug. 11, 2021, 10:14 a.m.
Inside an output section statement, ld's parser can't tell whether a
line
    .+=4;
is an assignment or a file named ".+=4".

	* ld.texi (expressions): Mention need for whitespace.


-- 
Alan Modra
Australia Development Lab, IBM

Patch

diff --git a/ld/ld.texi b/ld/ld.texi
index 5471d9588ed..71cfaa3d1b1 100644
--- a/ld/ld.texi
+++ b/ld/ld.texi
@@ -6286,9 +6286,11 @@  expect when you upgrade.
 @cindex expressions
 @cindex arithmetic
 The syntax for expressions in the linker script language is identical to
-that of C expressions.  All expressions are evaluated as integers.  All
-expressions are evaluated in the same size, which is 32 bits if both the
-host and target are 32 bits, and is otherwise 64 bits.
+that of C expressions, except that whitespace is required in some
+places to resolve syntactic ambiguities.  All expressions are
+evaluated as integers.  All expressions are evaluated in the same
+size, which is 32 bits if both the host and target are 32 bits, and is
+otherwise 64 bits.
 
 You can use and set symbol values in expressions.