Object: add getSectionAlignment.
llvm-svn: 141581
This commit is contained in:
@@ -337,6 +337,7 @@ protected:
|
||||
virtual error_code getSectionAddress(DataRefImpl Sec, uint64_t &Res) const;
|
||||
virtual error_code getSectionSize(DataRefImpl Sec, uint64_t &Res) const;
|
||||
virtual error_code getSectionContents(DataRefImpl Sec, StringRef &Res) const;
|
||||
virtual error_code getSectionAlignment(DataRefImpl Sec, uint64_t &Res) const;
|
||||
virtual error_code isSectionText(DataRefImpl Sec, bool &Res) const;
|
||||
virtual error_code isSectionData(DataRefImpl Sec, bool &Res) const;
|
||||
virtual error_code isSectionBSS(DataRefImpl Sec, bool &Res) const;
|
||||
@@ -671,6 +672,15 @@ error_code ELFObjectFile<target_endianness, is64Bits>
|
||||
return object_error::success;
|
||||
}
|
||||
|
||||
template<support::endianness target_endianness, bool is64Bits>
|
||||
error_code ELFObjectFile<target_endianness, is64Bits>
|
||||
::getSectionAlignment(DataRefImpl Sec,
|
||||
uint64_t &Result) const {
|
||||
const Elf_Shdr *sec = reinterpret_cast<const Elf_Shdr *>(Sec.p);
|
||||
Result = sec->sh_addralign;
|
||||
return object_error::success;
|
||||
}
|
||||
|
||||
template<support::endianness target_endianness, bool is64Bits>
|
||||
error_code ELFObjectFile<target_endianness, is64Bits>
|
||||
::isSectionText(DataRefImpl Sec,
|
||||
|
||||
Reference in New Issue
Block a user