diff options
author | Ulf Samuelsson <ulf@emagii.com> | 2023-02-14 10:13:28 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2023-02-14 10:13:28 +0000 |
commit | 0d79a2a8e2d91fc258ac795c19c13e3ab505a6c2 (patch) | |
tree | 6d366ae54f94ded995f08e3f2ea8ac47aa542de5 /ld/ld.texi | |
parent | 12ef68305572ed139825be827b2bb1d1aef3ca25 (diff) | |
download | fsf-binutils-gdb-0d79a2a8e2d91fc258ac795c19c13e3ab505a6c2.zip fsf-binutils-gdb-0d79a2a8e2d91fc258ac795c19c13e3ab505a6c2.tar.gz fsf-binutils-gdb-0d79a2a8e2d91fc258ac795c19c13e3ab505a6c2.tar.bz2 |
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.texi | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -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 |