[cfe-users] Bug? -fno-plt has no effect
Mitch Lindgren via cfe-users
cfe-users at lists.llvm.org
Mon Apr 5 17:42:59 PDT 2021
Hi,
I'm developing a shared object module for which I need to ensure there is not PLT section. Some background on why I have this requirement is available in this Stack Overflow question<https://stackoverflow.com/questions/66810305/how-to-reverse-r-x86-64-jump-slot-relocations>. In gcc, I can accomplish this with -fno-plt. Clang appears to have added support for this option in 2017<https://reviews.llvm.org/D39079>. However, setting this flag when compiling my module with Clang has no effect, and the module ends up still having a PLT. I'm using CMake as my build system and I added the -fno-plt flag at the top level of my project via add_compile_options(-fno-plt). When building, I can see that the flag gets applied to each compiled source file. I also tried adding it explicitly to the linker options (target_link_options in CMake) and again I can see that it is applied at link time, but it still has no effect. I've tried with both Clang 10 and 11.
It's possible I'm doing something wrong, but the flag works as expected with gcc, using the same compilation process, so right now my assumption is that this is a bug.
Thanks,
Mitch Lindgren
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-users/attachments/20210406/b9e3ca1e/attachment.html>
More information about the cfe-users
mailing list