On Tue, Mar 03, 2026 at 10:47:07AM +0000, Richard Earnshaw (foss) wrote:
> I expect the problem to be non-gas assemblers. Specifically Sparc/solaris.
>
> I'd code this as minimally as possible, perhaps something like
>
> #ifdef __ELF__
> #ifdef __sparc__ // For Solaris assembler -- Check spelling (of __sparc__)
> here
> #define TYPE_PFX "@"
Actually, the prefix for SPARC is "#" rather than "@".
> #else
> #define TYPE_PFX "%%"
> #endif
And % is only used on arm/aarch64. So I think it should be something like:
#ifdef __sparc__
#define TYPE_PFX "#"
#elif defined (__arm__) || defined (__aarch64__)
#define TYPE_PFX "%%"
#else
#define TYPE_PFX "@"
#endif
That will match what GCC actually emits itself.
Jakub