sizeOfCmds += lc->getSize();
}
-size_t MachHeaderSection::getSize() const {
+uint64_t MachHeaderSection::getSize() const {
return sizeof(mach_header_64) + sizeOfCmds;
}
StubsSection::StubsSection()
: SyntheticSection(segment_names::text, "__stubs") {}
-size_t StubsSection::getSize() const {
+uint64_t StubsSection::getSize() const {
return entries.size() * target->stubSize;
}
StubHelperSection::StubHelperSection()
: SyntheticSection(segment_names::text, "__stub_helper") {}
-size_t StubHelperSection::getSize() const {
+uint64_t StubHelperSection::getSize() const {
return target->stubHelperHeaderSize +
in.stubs->getEntries().size() * target->stubHelperEntrySize;
}
flags = S_LAZY_SYMBOL_POINTERS;
}
-size_t LazyPointerSection::getSize() const {
+uint64_t LazyPointerSection::getSize() const {
return in.stubs->getEntries().size() * WordSize;
}
align = WordSize;
}
-size_t SymtabSection::getSize() const {
+uint64_t SymtabSection::getSize() const {
return symbols.size() * sizeof(structs::nlist_64);
}
MachHeaderSection();
void addLoadCommand(LoadCommand *);
bool isHidden() const override { return true; }
- size_t getSize() const override;
+ uint64_t getSize() const override;
void writeTo(uint8_t *buf) const override;
private:
public:
PageZeroSection();
bool isHidden() const override { return true; }
- size_t getSize() const override { return PageZeroSize; }
+ uint64_t getSize() const override { return PageZeroSize; }
uint64_t getFileSize() const override { return 0; }
void writeTo(uint8_t *buf) const override {}
};
bool isNeeded() const override { return !entries.empty(); }
- size_t getSize() const override { return entries.size() * WordSize; }
+ uint64_t getSize() const override { return entries.size() * WordSize; }
void writeTo(uint8_t *buf) const override {
// Nothing to write, GOT contains all zeros at link time; it's populated at
public:
BindingSection();
void finalizeContents();
- size_t getSize() const override { return contents.size(); }
+ uint64_t getSize() const override { return contents.size(); }
// Like other sections in __LINKEDIT, the binding section is special: its
// offsets are recorded in the LC_DYLD_INFO_ONLY load command, instead of in
// section headers.
class StubsSection : public SyntheticSection {
public:
StubsSection();
- size_t getSize() const override;
+ uint64_t getSize() const override;
bool isNeeded() const override { return !entries.empty(); }
void writeTo(uint8_t *buf) const override;
class StubHelperSection : public SyntheticSection {
public:
StubHelperSection();
- size_t getSize() const override;
+ uint64_t getSize() const override;
bool isNeeded() const override;
void writeTo(uint8_t *buf) const override;
class ImageLoaderCacheSection : public InputSection {
public:
ImageLoaderCacheSection();
- size_t getSize() const override { return WordSize; }
+ uint64_t getSize() const override { return WordSize; }
};
class LazyPointerSection : public SyntheticSection {
public:
LazyPointerSection();
- size_t getSize() const override;
+ uint64_t getSize() const override;
bool isNeeded() const override;
void writeTo(uint8_t *buf) const override;
};
public:
LazyBindingSection();
void finalizeContents();
- size_t getSize() const override { return contents.size(); }
+ uint64_t getSize() const override { return contents.size(); }
uint32_t encode(const DylibSymbol &);
// Like other sections in __LINKEDIT, the lazy binding section is special: its
// offsets are recorded in the LC_DYLD_INFO_ONLY load command, instead of in
public:
ExportSection();
void finalizeContents();
- size_t getSize() const override { return size; }
+ uint64_t getSize() const override { return size; }
// Like other sections in __LINKEDIT, the export section is special: its
// offsets are recorded in the LC_DYLD_INFO_ONLY load command, instead of in
// section headers.
StringTableSection();
// Returns the start offset of the added string.
uint32_t addString(StringRef);
- size_t getSize() const override { return size; }
+ uint64_t getSize() const override { return size; }
// Like other sections in __LINKEDIT, the string table section is special: its
// offsets are recorded in the LC_SYMTAB load command, instead of in section
// headers.
SymtabSection(StringTableSection &);
void finalizeContents();
size_t getNumSymbols() const { return symbols.size(); }
- size_t getSize() const override;
+ uint64_t getSize() const override;
// Like other sections in __LINKEDIT, the symtab section is special: its
// offsets are recorded in the LC_SYMTAB load command, instead of in section
// headers.