Re: [PATCH v7 05/28] x86/asm/entry: annotate THUNKs

From: Borislav Petkov
Date: Tue Feb 12 2019 - 07:13:57 EST


On Tue, Feb 12, 2019 at 12:51:08PM +0100, Jiri Slaby wrote:
> And what if the LOCAL macros prepend .L automatically? The references
> would need to be via macro or by manually adding .L. I mean:
>
> SYM_CODE_START_LOCAL(function)
> ret
> SYM_CODE_END(function)
>
> And then used as:
> call .Lfunction
> or
> call SYM_LOCAL(function)
>
> Is that too ugly?

I'd prefer SYM_LOCAL because not everyone is aware of the fact that the
GNU toolchain makes .L-prepended symbols local.

However:

"Local Symbol Names

A local symbol is any symbol beginning with certain local label
prefixes. By default, the local label prefix is `.L' for ELF systems or
`L' for traditional a.out systems, but each target may have its own set
of local label prefixes. On the HPPA local symbols begin with `L$'."

Now if you make those macros arch-independent, you need to have the
correct local symbol definition for those arches and targets(!) which
differ.

If you don't macroize the local symbols stuff, OTOH, then that's one
less problem you have.

--
Regards/Gruss,
Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.