[llvm-dev] [RFC][LLVM] New Constant type for representing function PLT entries

Leonard Chan via llvm-dev llvm-dev at lists.llvm.org
Thu Aug 20 12:45:46 PDT 2020

> Hi, Leonard,
> What are the motivating use cases?
>  -Hal
The immediate use case for us specifically would be a way to explicitly
request static PLT relocations. We rolled out a new relocation for AArch64 (
R_AARCH64_PLT32 <https://reviews.llvm.org/D81184>) which takes the offset
between the PLT entry for a function and some other symbol. In IR, we can
then explicitly request this relocation with `pltentry(@function) -
@global` and distinguish it from `@function - @global` which may or may not
lower to R_AARCH64_PREL32 if both symbols are dso_local. This is especially
useful for the relative vtables ABI <https://reviews.llvm.org/D72959> where
we can benefit in size by not having to emit dso_local stubs for some

In the general case, this just adds a way for semantically representing PLT
entries for functions and would ideally add more "correctness". From an IR
perspective, users won't need to second-guess "what will this function be
lowered to".
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200820/f18e5352/attachment.html>

More information about the llvm-dev mailing list