On 2026-03-02 15:42, Jakub Jelinek wrote:
On Mon, Mar 02, 2026 at 02:21:44PM +0000, Richard Earnshaw (foss) wrote:
gas for some time now has implemented the prefix char in .type as

   if (   *input_line_pointer == '#'
       || *input_line_pointer == '@'
       || *input_line_pointer == '"'
       || *input_line_pointer == '%')
     ++input_line_pointer;

That is, it just skips it if there.  Do we still use any ELF assemblers other 
than gas?

At least Solaris assembler and LLVM assembler (the latter form gcn target).


Would this be a better block?

#ifdef __ELF__
asm(".global %cc0\n\t.type %cc0, %%function\n%cc0:" :: ":" (asm_fn));
asm(".global %cc0\n\t.type %cc0, %%function\n%cc0:" :: ":" (asm_fn_used));
#else
asm(".global %cc0\n%cc0:" :: ":" (asm_fn));
asm(".global %cc0\n%cc0:" :: ":" (asm_fn_used));
#endif


I used % as that's what apparently is generated by GCC for arm-none-eabi.
For x86_64-pc-linux-gnu, @ is instead used.

I don't know if this will cause any problems for other targets...

Kind regards,
Torbjörn

Reply via email to