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

Jan Beulich jbeulich@suse.com
Mon May 18 05:57:37 GMT 2026


On 17.05.2026 13:35, Will Hawkins wrote:
> On Sunday, May 17, 2026, Will Hawkins <hawkinsw@obs.cr> wrote:
>> On Sunday, May 17, 2026, Jan Beulich <jbeulich@suse.com> wrote:
>>> 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
>>> ...
>>
>>
>>
>> In obj-elf.c, I saw
>>
>> else if (c == '@' || c == '%')
>>
>> which I must have misinterpreted?
> 
> I guess that they are only treated equivalently in code on platforms where
> the @ and % do not have implications for the code in earlier processing
> before reaching obj_elf_section.

Correct, comments are being removed much earlier. (If they were fully
equivalent, in that testcase of yours you also wouldn't have had to
switch from @ to %.)

Jan


More information about the Binutils mailing list