[PATCH] gas: Document @ and % as interchangeable for type argument in .section

Jan Beulich jbeulich@suse.com
Sun May 17 06:50:26 GMT 2026


On 16.05.2026 02:38, Will Hawkins wrote:
> In the .section Assembler Directive for the ELF format, both the % and
> the @ can be used when writing the type argument.

That's not exactly true (the two aren't fully interchangeable), and hence ...

> Clarify the documentation.
> 
> Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
> ---
>  gas/doc/as.texi | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/gas/doc/as.texi b/gas/doc/as.texi
> index 3e1d2d0e254..201d9c26b7d 100644
> --- a/gas/doc/as.texi
> +++ b/gas/doc/as.texi
> @@ -7118,13 +7118,12 @@ a numeric value to be set as the ELF section header's type field.
>  some targets extend this list with their own types
>  @end table
>  
> +Note - the @code{%} character may be used instead of the @code{@@} character
> +when writing the @var{type} argument constant.
> +
>  Many targets only support the first three section types.  The type may be
>  enclosed in double quotes if necessary.
>  
> -Note on targets where the @code{@@} character is the start of a comment (eg
> -ARM) then another character is used instead.  For example the ARM port uses the
> -@code{%} character.

... removing this paragraph loses information. I'd suggest adding something like
"For example the Arm port uses @code{@@} as comment character." to the new paragraph
you add. (MMIX is the other way around, using % as comment char.)

Jan


More information about the Binutils mailing list