Re: [PATCH 02/14] x86/alternatives: Add nested alternatives macros
From: Uros Bizjak
Date: Fri May 31 2024 - 11:12:19 EST
Borislav Petkov je 31. 05. 24 ob 16:36 napisal:
On Fri, May 31, 2024 at 04:30:31PM +0200, Uros Bizjak wrote:
Please don't resurrect the %P modifier, use %c instead.
Btw, out of curiosity, is %P being phased out?
No ;)
I'm looking at
41cd2e1ee96e ("x86/asm: Use %c/%n instead of %P operand modifier in asm templates")
and yeah, %c is the generic one while %P is the x86-specific one but
phasing latter out is probably going to take a bunch of gcc releases...
The intention of '%P' operand modifier is primarily to be used with PIC,
where:
'P' If used for a function, print the PLT
suffix and generate PIC code. For
example, emit 'foo@PLT' instead of 'foo'
for the function foo(). If used for a
constant, drop all syntax-specific
prefixes and issue the bare constant. See
'p' above.
the fact that is handles constants is due to historic reasons.
The '%c' operand modifier will also check its operand that it is indeed
an immediate integer operand, so should be used with 'i' operand constraint:
'c' Require a constant operand and print the
constant expression with no punctuation.
Uros.