summaryrefslogtreecommitdiff
path: root/ld/ld.texi
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2023-03-09 11:53:52 +1030
committerAlan Modra <amodra@gmail.com>2023-03-10 21:22:16 +1030
commita4d5aec71e097837ee314eca612f71a3d85b6b3f (patch)
treed8a312e80b6695a55f015b38c6f842b3c4d6fa6a /ld/ld.texi
parent75bd292bea53d6ce8de66f30d67c2edb4a558110 (diff)
downloadbinutils-gdb-a4d5aec71e097837ee314eca612f71a3d85b6b3f.tar.gz
Revert ld ASCII support
Revert "Prevent the ASCII linker script directive from generating huge amounts of padding if the size expression is not a constant." This reverts commit adbe951fc95943016325af08d677f18e8c177ac1. Revert "ld test asciz and ascii fails" This reverts the ascii.d part of commit 5f497256bee624f0fa470949aa41534093bc5b25. Revert "Add support for the ASCII directive inside linker scripts." This mostly reverts commit 9fe129a4105bb59398f73ce96938a94f19265b79 leaving the asciz.d and asciz.t changes in place.
Diffstat (limited to 'ld/ld.texi')
-rw-r--r--ld/ld.texi53
1 files changed, 13 insertions, 40 deletions
diff --git a/ld/ld.texi b/ld/ld.texi
index 3367075cae8..8205d4e6771 100644
--- a/ld/ld.texi
+++ b/ld/ld.texi
@@ -5308,6 +5308,7 @@ C identifiers because they contain a @samp{.} character.
@cindex data
@cindex section data
@cindex output section data
+@kindex ASCIZ ``@var{string}''
@kindex BYTE(@var{expression})
@kindex SHORT(@var{expression})
@kindex LONG(@var{expression})
@@ -5344,6 +5345,18 @@ When the object file format does not have an explicit endianness, as is
true of, for example, S-records, the value will be stored in the
endianness of the first input object file.
+You can include a zero-terminated string in an output section by using
+@code{ASCIZ}. The keyword is followed by a string which is stored at
+the current value of the location counter adding a zero byte at the
+end. If the string includes spaces it must be enclosed in double
+quotes. The string may contain '\n', '\r', '\t' and octal numbers.
+Hex numbers are not supported.
+
+For example, this string of 16 characters will create a 17 byte area
+@smallexample
+ ASCIZ "This is 16 bytes"
+@end smallexample
+
Note---these commands only work inside a section description and not
between them, so the following will produce an error from the linker:
@smallexample
@@ -5354,46 +5367,6 @@ whereas this will work:
SECTIONS @{@ .text : @{@ *(.text) ; LONG(1) @}@ .data : @{@ *(.data) @}@ @}@
@end smallexample
-@cindex output section strings
-@kindex ASCII (@var{expression}) ``@var{string}''
-@kindex ASCIZ ``@var{string}''
-You can include a zero-terminated string in an output section by using
-@code{ASCIZ}. The keyword is followed by a string which is stored at
-the current value of the location counter including adding a zero byte
-at the end. Any length of string is supported by this directive.
-
-You can include a fixed size string in an output section by using
-@code{ASCII}. The keyword is followed by a size enclosed in
-parentheses and then a string. The string is stored at the current
-value of the location counter and zero bytes are added at the end to
-fill up to the specified size. Note the fill value is ignored for
-this padding.
-
-If the string is too long, a warning is issued and the string is
-truncated. The string will still be zero-terminated in this case.
-
-If the expression evaluates to zero then the directive will be treated
-as if it were @code{ASCIZ} instead.
-
-If the string in an @code{ASCII} or @code{ASCIZ} command includes spaces
-it must be enclosed in double quotes.
-
-The string can have C escape characters like '\n', '\r', '\t' and
-octal numbers. The '\"' escape is not supported. Nor are escaped hex
-values.
-
-Example 1: This is string of 16 characters and will create a 32 byte
-area:
-@smallexample
- ASCII (32) "This is 16 bytes"
-@end smallexample
-
-Example 2: This is a string of 16 characters and will create a 17 byte
-area:
-@smallexample
- ASCIZ "This is 16 bytes"
-@end smallexample
-
@kindex FILL(@var{expression})
@cindex holes, filling
@cindex unspecified memory