forked from OSchip/llvm-project
[lldb] Declare extern template instantiation to fix linking issues.
NativeProcessELF::GetELFImageInfoAddress<...>() is declared in NativeProcessELF.h, but only defined in NativeProcessELF.cpp. Via some optimized builds (e.g. thinlto), this instantiation may be removed when it is used in a different TU (NativeProcessELFTest.cpp).
This commit is contained in:
parent
57f2a789ca
commit
fbef6c55bc
|
@ -107,6 +107,11 @@ lldb::addr_t NativeProcessELF::GetELFImageInfoAddress() {
|
|||
return LLDB_INVALID_ADDRESS;
|
||||
}
|
||||
|
||||
template lldb::addr_t NativeProcessELF::GetELFImageInfoAddress<
|
||||
llvm::ELF::Elf32_Ehdr, llvm::ELF::Elf32_Phdr, llvm::ELF::Elf32_Dyn>();
|
||||
template lldb::addr_t NativeProcessELF::GetELFImageInfoAddress<
|
||||
llvm::ELF::Elf64_Ehdr, llvm::ELF::Elf64_Phdr, llvm::ELF::Elf64_Dyn>();
|
||||
|
||||
template <typename T>
|
||||
llvm::Expected<SVR4LibraryInfo>
|
||||
NativeProcessELF::ReadSVR4LibraryInfo(lldb::addr_t link_map_addr) {
|
||||
|
|
|
@ -48,6 +48,14 @@ protected:
|
|||
llvm::Optional<lldb::addr_t> m_shared_library_info_addr;
|
||||
};
|
||||
|
||||
// Explicitly declare the two 32/64 bit templates that NativeProcessELF.cpp will
|
||||
// define. This allows us to keep the template definition here and usable
|
||||
// elsewhere.
|
||||
extern template lldb::addr_t NativeProcessELF::GetELFImageInfoAddress<
|
||||
llvm::ELF::Elf32_Ehdr, llvm::ELF::Elf32_Phdr, llvm::ELF::Elf32_Dyn>();
|
||||
extern template lldb::addr_t NativeProcessELF::GetELFImageInfoAddress<
|
||||
llvm::ELF::Elf64_Ehdr, llvm::ELF::Elf64_Phdr, llvm::ELF::Elf64_Dyn>();
|
||||
|
||||
} // namespace lldb_private
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue