[llvm] IPRA:Fix crash and verification failures for PLT calls (PR #196917)

via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 6 02:09:04 PDT 2026


vigbalu wrote:

> @MaskRay, to double down on what @lenary was saying, is it expected that `isDefinitionExact` can still allow the function to be preempted? That sounds wrong to me but maybe there's a reason for that or maybe we mischaracterized the bug/fix?

Hi @qcolombet , @MaskRay, @arsenm , @lenary 
I dug a bit deeper to understand the purpose of "isDefinitionExact" and its relationship with "interposability". Here's what I found:

"isDefinitionExact" determines "interposability" by leveraging the API "isInterposable". However, it only treats a non-DSOLocal function as interposable if the "-fsemantic-interposition" flag is explicitly enabled.

For non-DSOLocal functions utilizing the PLT (Procedure Linkage Table), "isDefinitionExact" may treat them as non-interposable. This behavior is the root cause of the issue.

I referred to @MaskRay's  article, which discusses how LLVM’s decision diverges from GCC’s default behavior. In GCC, "-fsemantic-interposition" is enabled by default, whereas LLVM requires it to be explicitly specified.
https://zhuanlan.zhihu.com/p/370993887
https://maskray.me/blog/2021-05-09-fno-semantic-interposition

>From my understanding, this is not a bug per se but rather a mismatch in default flag configurations between GCC and LLVM. The solution is straightforward: explicitly pass the "-fsemantic-interposition" flag to resolve the issue.

TL;DR: The issue can be resolved by using the "-fsemantic-interposition" flag. LLVM requires this flag to be set explicitly, while GCC enables it by default.

Let me know your thoughts!

https://github.com/llvm/llvm-project/pull/196917


More information about the llvm-commits mailing list