mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-13 08:25:27 +00:00
Object: add getSectionAlignment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141581 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -60,6 +60,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;
|
||||
@@ -481,6 +482,20 @@ error_code MachOObjectFile::getSectionContents(DataRefImpl DRI,
|
||||
return object_error::success;
|
||||
}
|
||||
|
||||
error_code MachOObjectFile::getSectionAlignment(DataRefImpl DRI,
|
||||
uint64_t &Result) const {
|
||||
if (is64BitLoadCommand(MachOObj, DRI)) {
|
||||
InMemoryStruct<macho::Section64> Sect;
|
||||
getSection64(DRI, Sect);
|
||||
Result = 1 << Sect->Align;
|
||||
} else {
|
||||
InMemoryStruct<macho::Section> Sect;
|
||||
getSection(DRI, Sect);
|
||||
Result = 1 << Sect->Align;
|
||||
}
|
||||
return object_error::success;
|
||||
}
|
||||
|
||||
error_code MachOObjectFile::isSectionText(DataRefImpl DRI,
|
||||
bool &Result) const {
|
||||
if (is64BitLoadCommand(MachOObj, DRI)) {
|
||||
|
Reference in New Issue
Block a user