[PATCH v1 4/7] ld.texi: Add ASCII to info file
Jan Beulich
jbeulich@suse.com
Mon Jul 1 06:50:08 GMT 2024
On 28.06.2024 23:46, binutils@emagii.com wrote:
> --- a/ld/ld.texi
> +++ b/ld/ld.texi
> @@ -5643,6 +5643,7 @@ C identifiers because they contain a @samp{.} character.
> @cindex section data
> @cindex output section data
> @kindex ASCIZ ``@var{string}''
> +@kindex ASCII (@var{expression}) ``@var{string}''
The arrangement is pretty odd, imo. I've tried to spot whether there was
any other construct with an argument following the closing parenthesis,
but I couldn't spot any. I may guess that it's ASCIZ that you're trying
to follow, yet there it's at least _only_ a string that follows the
keyword.
> @@ -5691,6 +5692,27 @@ For example, this string of 16 characters will create a 17 byte area
> ASCIZ "This is 16 bytes"
> @end smallexample
>
> +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 includes spaces it must be enclosed in double
> +quotes.
By requiring quotation, moving this 2nd argument into the parentheses
ought to be possible?
> The string may contain '\n', '\r', '\t' and octal numbers.
> +Hex numbers are not supported.
> +
> +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.
This aspect in particular makes ASCII as the keyword misleading. If you
want to avoid overloading ASCIZ (as doing so would risk backwards
compatibility issues with unquoted strings used there, when those
were enclosed in parentheses), I think it would want to be ASCIIZ.
Jan
More information about the Binutils
mailing list