[PATCH] MIPS/Gas: Support .L/$ as the mark of local symbol
Maciej W. Rozycki
macro@orcam.me.uk
Wed Feb 21 13:32:48 GMT 2024
On Mon, 5 Feb 2024, YunQiang Su wrote:
> In as.texi, there are lines:
> A local symbol is any symbol beginning with certain local
> label prefixes. By default, the local label prefix is
> @samp{.L} for ELF systems or @samp{L} for traditional a.out
> systems, but each target may have its own set of local
> label prefixes.
>
> Let's support it for MIPS:
> 1) For OldABI, GCC uses "$" to mark local symbols, and
> for NewABI, ".L" is used. So let's support both for
> OldABI, and ".L" only for NewABI.
> 2) Emit an fatal error, if a local symbol is used, while
> not defined, just like LLVM does.
I gather you want to avoid a case of an undefined reference making it to
output for a symbol whose name suggests its a local label, right?
But that seems like material for the generic part of GAS rather than the
MIPS backend only (and then specifically SVR4 PIC only and not non-PIC or
VxWorks, according to your code as submitted), so that all targets behave
consistently, and I can't see e.g. i386 GAS doing it.
So a question raises: what problem are you trying to solve? Can you give
us a piece of code that you think is handled incorrectly by GAS, and why?
Maciej
More information about the Binutils
mailing list