[PATCH] powerpc: Define USE_PPC64_NOTOC iff compiler and linker also supports it
Bill Schmidt
wschmidt@linux.ibm.com
Tue Nov 16 22:46:39 GMT 2021
On 11/16/21 2:48 PM, Florian Weimer via Libc-alpha wrote:
> * Tulio Magno Quites Machado Filho via Libc-alpha:
>
>> Tulio Magno Quites Machado Filho via Libc-alpha <libc-alpha@sourceware.org> writes:
>>
>>> Alan Modra via Libc-alpha <libc-alpha@sourceware.org> writes:
>>>
>>>> I have a question about powerpc64/ppc-mcount.S. Why is the assembly
>>>> wrapper using ENTRY and a NOTOC call? By using ENTRY you are saying
>>>> that calls to _mcount must have r2 valid. Given that r2 is valid, why
>>>> then use NOTOC?
>>> I wouldn't be surprised if that was a misinterpretation of the ABI on my part.
>>>
>>> Looking at table 2.20 "Protocols for Local Function Calls", I think this is a
>>> scenario that falls to the last row of this table, where we have:
>> OK, I should be looking at table 2.19 because this is not a call within the
>> same compilation unit.
> I'm not entirely sure about that. I think “local” in this context means
> “the caller has complete information about the callee”, and this is true
> for most direct calls within libc.so.6. It's also necessary to make
> LTO-based calling convention optimizations effective.
See the text preceding these tables. "A local function call is one where the
callee is known and visible within the unit of code being compiled or assembled."
Some optimizations may occur when program portions are statically linked, but
this is the rule the compiler and/or assembly writer should follow.
Bill
>
> Thanks,
> Florian
>
More information about the Libc-alpha
mailing list