summaryrefslogtreecommitdiff
path: root/ld/ld.texi
diff options
context:
space:
mode:
authorUlf Samuelsson <ulf@emagii.com>2023-02-14 10:13:28 +0000
committerNick Clifton <nickc@redhat.com>2023-02-14 10:13:28 +0000
commit0d79a2a8e2d91fc258ac795c19c13e3ab505a6c2 (patch)
tree6d366ae54f94ded995f08e3f2ea8ac47aa542de5 /ld/ld.texi
parent12ef68305572ed139825be827b2bb1d1aef3ca25 (diff)
downloadbinutils-gdb-0d79a2a8e2d91fc258ac795c19c13e3ab505a6c2.tar.gz
ASCIZ Command for output section
Adds a new directive to the linker script syntax: ASCIZ. This inserts a zero-terminated string into the output at the place where it is used.
Diffstat (limited to 'ld/ld.texi')
-rw-r--r--ld/ld.texi13
1 files changed, 13 insertions, 0 deletions
diff --git a/ld/ld.texi b/ld/ld.texi
index 36005dc2b0d..f576a8bae6c 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