mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-15 05:24:01 +00:00
Add getSymbolAlignment to the ObjectFile interface.
For regular object files this is only meaningful for common symbols. An object file format with direct support for atoms should be able to provide alignment information for all symbols. This replaces getCommonSymbolAlignment and fixes test-common-symbols-alignment.ll on darwin. This also includes a fix to MachOObjectFile::getSymbolFlags. It was marking undefined symbols as common (already tested by existing mcjit tests now that it is used). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180736 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -217,6 +217,8 @@ public:
|
||||
/// mapped).
|
||||
error_code getAddress(uint64_t &Result) const;
|
||||
error_code getFileOffset(uint64_t &Result) const;
|
||||
/// @brief Get the alignment of this symbol as the actual value (not log 2).
|
||||
error_code getAlignment(uint32_t &Result) const;
|
||||
error_code getSize(uint64_t &Result) const;
|
||||
error_code getType(SymbolRef::Type &Result) const;
|
||||
|
||||
@ -292,6 +294,7 @@ protected:
|
||||
virtual error_code getSymbolName(DataRefImpl Symb, StringRef &Res) const = 0;
|
||||
virtual error_code getSymbolAddress(DataRefImpl Symb, uint64_t &Res) const = 0;
|
||||
virtual error_code getSymbolFileOffset(DataRefImpl Symb, uint64_t &Res)const=0;
|
||||
virtual error_code getSymbolAlignment(DataRefImpl Symb, uint32_t &Res) const;
|
||||
virtual error_code getSymbolSize(DataRefImpl Symb, uint64_t &Res) const = 0;
|
||||
virtual error_code getSymbolType(DataRefImpl Symb,
|
||||
SymbolRef::Type &Res) const = 0;
|
||||
@ -425,6 +428,10 @@ inline error_code SymbolRef::getFileOffset(uint64_t &Result) const {
|
||||
return OwningObject->getSymbolFileOffset(SymbolPimpl, Result);
|
||||
}
|
||||
|
||||
inline error_code SymbolRef::getAlignment(uint32_t &Result) const {
|
||||
return OwningObject->getSymbolAlignment(SymbolPimpl, Result);
|
||||
}
|
||||
|
||||
inline error_code SymbolRef::getSize(uint64_t &Result) const {
|
||||
return OwningObject->getSymbolSize(SymbolPimpl, Result);
|
||||
}
|
||||
|
Reference in New Issue
Block a user