mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-04 05:31:51 +00:00
Remove last use of InMemoryStruct in llvm-objdump.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178979 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f0e3ca012b
commit
196abbffe9
@ -113,6 +113,13 @@ namespace MachOFormat {
|
|||||||
support::ulittle32_t NumSections;
|
support::ulittle32_t NumSections;
|
||||||
support::ulittle32_t Flags;
|
support::ulittle32_t Flags;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct LinkeditDataLoadCommand {
|
||||||
|
support::ulittle32_t Type;
|
||||||
|
support::ulittle32_t Size;
|
||||||
|
support::ulittle32_t DataOffset;
|
||||||
|
support::ulittle32_t DataSize;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef MachOObject::LoadCommandInfo LoadCommandInfo;
|
typedef MachOObject::LoadCommandInfo LoadCommandInfo;
|
||||||
@ -145,6 +152,9 @@ public:
|
|||||||
ArrayRef<char> getSectionRawName(DataRefImpl Sec) const;
|
ArrayRef<char> getSectionRawName(DataRefImpl Sec) const;
|
||||||
ArrayRef<char>getSectionRawFinalSegmentName(DataRefImpl Sec) const;
|
ArrayRef<char>getSectionRawFinalSegmentName(DataRefImpl Sec) const;
|
||||||
|
|
||||||
|
const MachOFormat::LinkeditDataLoadCommand *
|
||||||
|
getLinkeditDataLoadCommand(LoadCommandInfo LCI) const;
|
||||||
|
|
||||||
MachOObject *getObject() { return MachOObj.get(); }
|
MachOObject *getObject() { return MachOObj.get(); }
|
||||||
|
|
||||||
static inline bool classof(const Binary *v) {
|
static inline bool classof(const Binary *v) {
|
||||||
|
@ -75,6 +75,14 @@ MachOObjectFile::getSegmentLoadCommand(LoadCommandInfo LCI) const {
|
|||||||
return reinterpret_cast<const MachOFormat::SegmentLoadCommand*>(Data.data());
|
return reinterpret_cast<const MachOFormat::SegmentLoadCommand*>(Data.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const MachOFormat::LinkeditDataLoadCommand *
|
||||||
|
MachOObjectFile::getLinkeditDataLoadCommand(LoadCommandInfo LCI) const {
|
||||||
|
StringRef Data = MachOObj->getData(LCI.Offset,
|
||||||
|
sizeof(MachOFormat::LinkeditDataLoadCommand));
|
||||||
|
return
|
||||||
|
reinterpret_cast<const MachOFormat::LinkeditDataLoadCommand*>(Data.data());
|
||||||
|
}
|
||||||
|
|
||||||
const MachOFormat::Segment64LoadCommand *
|
const MachOFormat::Segment64LoadCommand *
|
||||||
MachOObjectFile::getSegment64LoadCommand(LoadCommandInfo LCI) const {
|
MachOObjectFile::getSegment64LoadCommand(LoadCommandInfo LCI) const {
|
||||||
StringRef Data = MachOObj->getData(LCI.Offset,
|
StringRef Data = MachOObj->getData(LCI.Offset,
|
||||||
|
@ -223,8 +223,8 @@ static void getSectionsAndSymbols(const macho::Header &Header,
|
|||||||
if (LCI.Command.Type == macho::LCT_FunctionStarts) {
|
if (LCI.Command.Type == macho::LCT_FunctionStarts) {
|
||||||
// We found a function starts segment, parse the addresses for later
|
// We found a function starts segment, parse the addresses for later
|
||||||
// consumption.
|
// consumption.
|
||||||
InMemoryStruct<macho::LinkeditDataLoadCommand> LLC;
|
const MachOFormat::LinkeditDataLoadCommand *LLC =
|
||||||
MachOObj->getObject()->ReadLinkeditDataLoadCommand(LCI, LLC);
|
MachOObj->getLinkeditDataLoadCommand(LCI);
|
||||||
|
|
||||||
MachOObj->getObject()->ReadULEB128s(LLC->DataOffset, FoundFns);
|
MachOObj->getObject()->ReadULEB128s(LLC->DataOffset, FoundFns);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user