-
Notifications
You must be signed in to change notification settings - Fork 182
Unknown relocation type #24
Comments
This is a bug because I am unable to find a R_X86_64_PC64 in my binary. Still digging to give more information to debug this. |
I ran into the same problem one more time but with perf2bolt. |
Does |
Yes, I see a R_X86_64_PC64 relocation corresponding to openssl code. I am wondering how this got in. But then, shouldn't this relocation be handled? |
Interesting, I wonder what they use it for. Sure, let me reproduce it, and then it should be trivial to add the support for it. |
https://github.com/google/boringssl/blob/master/util/fipstools/delocate.go#L1402 This code will produce the relocation: 00000000046b5446 <OPENSSL_ia32cap_addr_delta>: |
The main problem with openssl code is that it has data objects embedded in code. |
BOLT fails with the following stack trace:
Breakpoint 1, llvm::bolt::Relocation::isPCRelative (Type=24) at llvm/tools/llvm-bolt/src/Relocation.cpp:235
235 llvm_unreachable("Unknown relocation type");
gdb) bt
#0 llvm::bolt::Relocation::isPCRelative (Type=24) at llvm/tools/llvm-bolt/src/Relocation.cpp:235
#1 0x0000555555a72a65 in llvm::bolt::RewriteInstance::analyzeRelocation (this=0x7fffffffd620, Rel=..., RelocatedSection=..., SymbolName="", SymbolAddress=@0x7fffffffbfb8: 654552064,
Addend=@0x7fffffffbfb0: -4, ExtractedValue=@0x7fffffffbfa8: 304121793) at lvm/tools/llvm-bolt/src/RewriteInstance.cpp:1853
#2 0x0000555555a752c4 in llvm::bolt::RewriteInstance::readRelocations (this=0x7fffffffd620, Section=...)
at lvm/tools/llvm-bolt/src/RewriteInstance.cpp:2055
#3 0x0000555555a70535 in llvm::bolt::RewriteInstance::discoverFileObjects (this=0x7fffffffd620)
at llvm/tools/llvm-bolt/src/RewriteInstance.cpp:1471
#4 0x0000555555a6c866 in llvm::bolt::RewriteInstance::<lambda(const std::set<long unsigned int, std::less, std::allocator >&)>::operator()(const std::set<unsigned long, std::less, std::allocator > &) const (__closure=0x7fffffffd208, NonSimpleFunctions=std::set with 0 elements)
at llvm/tools/llvm-bolt/src/RewriteInstance.cpp:970
#5 0x0000555555a6cbe3 in llvm::bolt::RewriteInstance::run (this=0x7fffffffd620) at llvm/tools/llvm-bolt/src/RewriteInstance.cpp:1003
#6 0x00005555559170be in main (argc=4, argv=0x7fffffffde78) at llvm/tools/llvm-bolt/src/llvm-bolt.cpp:270
The relocation type 24 corresponds to ELF::R_X86_64_PC64.
The text was updated successfully, but these errors were encountered: