Describe the BugLLVMGetSymbolSize gets the common symbol size, which requires that the symbol be a common symbol.
To Reproduce
Please provide a simple sample of code which reproduces the issue on your machine.
$ cargo test --features=llvm10-0 test_object_file::test_symbol_iterator
test test_object_file::test_symbol_iterator ... all-0b042a69785d4445: ../include/llvm/Object/ObjectFile.h:295: uint64_t llvm::object::ObjectFile::getCommonSymbolSize(llvm::object::DataRefImpl) const: Assertion `getSymbolFlags(Symb) & SymbolRef::SF_Common' failed.
Expected Behavior
I don't see any way with the C API to check whether the type of the symbol (in C++ this is getSymbolFlags(Symbol)). If that's right, we might just have to remove size from the API, or mark it unsafe with a comment that explains the situation.
LLVM Version (please complete the following information):
Describe the Bug
LLVMGetSymbolSize
gets the common symbol size, which requires that the symbol be a common symbol.To Reproduce Please provide a simple sample of code which reproduces the issue on your machine.
Expected Behavior I don't see any way with the C API to check whether the type of the symbol (in C++ this is
getSymbolFlags(Symbol)
). If that's right, we might just have to remove size from the API, or mark itunsafe
with a comment that explains the situation.LLVM Version (please complete the following information):