[PATCH v2 4/7] ld.texi: Add ASCII to info file

Jan Beulich jbeulich@suse.com
Mon Jul 8 06:23:57 GMT 2024


On 05.07.2024 18:22, 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}''

I couldn't really spot anywhere you would say what has changed from the
earlier version, so I'm unsure: Are, as per above, parentheses still
required here, or ...

> @@ -5691,6 +5692,28 @@ 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 and a string
> +separated by a comma.  The string is stored at the current
> +value of the location counter. If the string is shorted than the allocated
> +size, NUL character 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.  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.
> +
> +If the expression evaluates to zero then the directive will be treated
> +as if it were @code{ASCIZ} instead.
> +
> +Example: This is string of 16 characters and will create a 16 byte
> +area, not zero-terminated.
> +@smallexample
> +  ASCII 16, "This is 16 bytes"
> +@end smallexample

... are they not anymore, as per this and the cover letter?

Jan


More information about the Binutils mailing list