const OwningType *OwningObject;
public:
- DynRefImpl() : OwningObject(NULL) {
- std::memset(&DynPimpl, 0, sizeof(DynPimpl));
- }
+ DynRefImpl() : OwningObject(NULL) { }
DynRefImpl(DataRefImpl DynP, const OwningType *Owner);
relocation_iterator ELFObjectFile<target_endianness, is64Bits>
::getSectionRelBegin(DataRefImpl Sec) const {
DataRefImpl RelData;
- memset(&RelData, 0, sizeof(RelData));
const Elf_Shdr *sec = reinterpret_cast<const Elf_Shdr *>(Sec.p);
typename RelocMap_t::const_iterator ittr = SectionRelocMap.find(sec);
if (sec != 0 && ittr != SectionRelocMap.end()) {
relocation_iterator ELFObjectFile<target_endianness, is64Bits>
::getSectionRelEnd(DataRefImpl Sec) const {
DataRefImpl RelData;
- memset(&RelData, 0, sizeof(RelData));
const Elf_Shdr *sec = reinterpret_cast<const Elf_Shdr *>(Sec.p);
typename RelocMap_t::const_iterator ittr = SectionRelocMap.find(sec);
if (sec != 0 && ittr != SectionRelocMap.end()) {
symbol_iterator ELFObjectFile<target_endianness, is64Bits>
::begin_symbols() const {
DataRefImpl SymbolData;
- memset(&SymbolData, 0, sizeof(SymbolData));
if (SymbolTableSections.size() <= 1) {
SymbolData.d.a = std::numeric_limits<uint32_t>::max();
SymbolData.d.b = std::numeric_limits<uint32_t>::max();
symbol_iterator ELFObjectFile<target_endianness, is64Bits>
::end_symbols() const {
DataRefImpl SymbolData;
- memset(&SymbolData, 0, sizeof(SymbolData));
SymbolData.d.a = std::numeric_limits<uint32_t>::max();
SymbolData.d.b = std::numeric_limits<uint32_t>::max();
return symbol_iterator(SymbolRef(SymbolData, this));
symbol_iterator ELFObjectFile<target_endianness, is64Bits>
::begin_dynamic_symbols() const {
DataRefImpl SymbolData;
- memset(&SymbolData, 0, sizeof(SymbolData));
if (SymbolTableSections[0] == NULL) {
SymbolData.d.a = std::numeric_limits<uint32_t>::max();
SymbolData.d.b = std::numeric_limits<uint32_t>::max();
symbol_iterator ELFObjectFile<target_endianness, is64Bits>
::end_dynamic_symbols() const {
DataRefImpl SymbolData;
- memset(&SymbolData, 0, sizeof(SymbolData));
SymbolData.d.a = std::numeric_limits<uint32_t>::max();
SymbolData.d.b = std::numeric_limits<uint32_t>::max();
return symbol_iterator(SymbolRef(SymbolData, this));
section_iterator ELFObjectFile<target_endianness, is64Bits>
::begin_sections() const {
DataRefImpl ret;
- memset(&ret, 0, sizeof(DataRefImpl));
ret.p = reinterpret_cast<intptr_t>(base() + Header->e_shoff);
return section_iterator(SectionRef(ret, this));
}
section_iterator ELFObjectFile<target_endianness, is64Bits>
::end_sections() const {
DataRefImpl ret;
- memset(&ret, 0, sizeof(DataRefImpl));
ret.p = reinterpret_cast<intptr_t>(base()
+ Header->e_shoff
+ (Header->e_shentsize*getNumSections()));
typename ELFObjectFile<target_endianness, is64Bits>::dyn_iterator
ELFObjectFile<target_endianness, is64Bits>::begin_dynamic_table() const {
DataRefImpl DynData;
- memset(&DynData, 0, sizeof(DynData));
if (dot_dynamic_sec == NULL || dot_dynamic_sec->sh_size == 0) {
DynData.d.a = std::numeric_limits<uint32_t>::max();
} else {
ELFObjectFile<target_endianness, is64Bits>
::end_dynamic_table() const {
DataRefImpl DynData;
- memset(&DynData, 0, sizeof(DynData));
DynData.d.a = std::numeric_limits<uint32_t>::max();
return dyn_iterator(DynRef(DynData, this));
}
uint32_t a, b;
} d;
uintptr_t p;
+ DataRefImpl() {
+ std::memset(this, 0, sizeof(DataRefImpl));
+ }
};
template<class content_type>
const ObjectFile *OwningObject;
public:
- RelocationRef() : OwningObject(NULL) {
- std::memset(&RelocationPimpl, 0, sizeof(RelocationPimpl));
- }
+ RelocationRef() : OwningObject(NULL) { }
RelocationRef(DataRefImpl RelocationP, const ObjectFile *Owner);
const ObjectFile *OwningObject;
public:
- SectionRef() : OwningObject(NULL) {
- std::memset(&SectionPimpl, 0, sizeof(SectionPimpl));
- }
+ SectionRef() : OwningObject(NULL) { }
SectionRef(DataRefImpl SectionP, const ObjectFile *Owner);
const ObjectFile *OwningObject;
public:
- SymbolRef() : OwningObject(NULL) {
- std::memset(&SymbolPimpl, 0, sizeof(SymbolPimpl));
- }
+ SymbolRef() : OwningObject(NULL) { }
enum Type {
ST_Unknown, // Type not specified
const ObjectFile *OwningObject;
public:
- LibraryRef() : OwningObject(NULL) {
- std::memset(&LibraryPimpl, 0, sizeof(LibraryPimpl));
- }
+ LibraryRef() : OwningObject(NULL) { }
LibraryRef(DataRefImpl LibraryP, const ObjectFile *Owner);
const coff_section *sec = 0;
if (error_code ec = getSection(symb->SectionNumber, sec)) return ec;
DataRefImpl Sec;
- std::memset(&Sec, 0, sizeof(Sec));
Sec.p = reinterpret_cast<uintptr_t>(sec);
Result = section_iterator(SectionRef(Sec, this));
}
relocation_iterator COFFObjectFile::getSectionRelBegin(DataRefImpl Sec) const {
const coff_section *sec = toSec(Sec);
DataRefImpl ret;
- std::memset(&ret, 0, sizeof(ret));
if (sec->NumberOfRelocations == 0)
ret.p = 0;
else
relocation_iterator COFFObjectFile::getSectionRelEnd(DataRefImpl Sec) const {
const coff_section *sec = toSec(Sec);
DataRefImpl ret;
- std::memset(&ret, 0, sizeof(ret));
if (sec->NumberOfRelocations == 0)
ret.p = 0;
else
symbol_iterator COFFObjectFile::begin_symbols() const {
DataRefImpl ret;
- std::memset(&ret, 0, sizeof(DataRefImpl));
ret.p = reinterpret_cast<intptr_t>(SymbolTable);
return symbol_iterator(SymbolRef(ret, this));
}
symbol_iterator COFFObjectFile::end_symbols() const {
// The symbol table ends where the string table begins.
DataRefImpl ret;
- std::memset(&ret, 0, sizeof(DataRefImpl));
ret.p = reinterpret_cast<intptr_t>(StringTable);
return symbol_iterator(SymbolRef(ret, this));
}
section_iterator COFFObjectFile::begin_sections() const {
DataRefImpl ret;
- std::memset(&ret, 0, sizeof(DataRefImpl));
ret.p = reinterpret_cast<intptr_t>(SectionTable);
return section_iterator(SectionRef(ret, this));
}
section_iterator COFFObjectFile::end_sections() const {
DataRefImpl ret;
- std::memset(&ret, 0, sizeof(DataRefImpl));
ret.p = reinterpret_cast<intptr_t>(SectionTable + Header->NumberOfSections);
return section_iterator(SectionRef(ret, this));
}
SymbolRef &Res) const {
const coff_relocation* R = toRel(Rel);
DataRefImpl Symb;
- std::memset(&Symb, 0, sizeof(Symb));
Symb.p = reinterpret_cast<uintptr_t>(SymbolTable + R->SymbolTableIndex);
Res = SymbolRef(Symb, this);
return object_error::success;
const coff_symbol *symb = 0;
if (error_code ec = getSymbol(reloc->SymbolTableIndex, symb)) return ec;
DataRefImpl sym;
- ::memset(&sym, 0, sizeof(sym));
sym.p = reinterpret_cast<uintptr_t>(symb);
StringRef symname;
if (error_code ec = getSymbolName(sym, symname)) return ec;
MachOObj(MOO),
RegisteredStringTable(std::numeric_limits<uint32_t>::max()) {
DataRefImpl DRI;
- DRI.d.a = DRI.d.b = 0;
moveToNextSection(DRI);
uint32_t LoadCommandCount = MachOObj->getHeader().NumLoadCommands;
while (DRI.d.a < LoadCommandCount) {
symbol_iterator MachOObjectFile::begin_symbols() const {
// DRI.d.a = segment number; DRI.d.b = symbol index.
DataRefImpl DRI;
- DRI.d.a = DRI.d.b = 0;
moveToNextSymbol(DRI);
return symbol_iterator(SymbolRef(DRI, this));
}
symbol_iterator MachOObjectFile::end_symbols() const {
DataRefImpl DRI;
DRI.d.a = MachOObj->getHeader().NumLoadCommands;
- DRI.d.b = 0;
return symbol_iterator(SymbolRef(DRI, this));
}
relocation_iterator MachOObjectFile::getSectionRelBegin(DataRefImpl Sec) const {
DataRefImpl ret;
- ret.d.a = 0;
ret.d.b = getSectionIndex(Sec);
return relocation_iterator(RelocationRef(ret, this));
}
section_iterator MachOObjectFile::begin_sections() const {
DataRefImpl DRI;
- DRI.d.a = DRI.d.b = 0;
moveToNextSection(DRI);
return section_iterator(SectionRef(DRI, this));
}
section_iterator MachOObjectFile::end_sections() const {
DataRefImpl DRI;
DRI.d.a = MachOObj->getHeader().NumLoadCommands;
- DRI.d.b = 0;
return section_iterator(SectionRef(DRI, this));
}
bool isExtern = (RE->Word1 >> 27) & 1;
DataRefImpl Sym;
- Sym.d.a = Sym.d.b = 0;
moveToNextSymbol(Sym);
if (isExtern) {
for (unsigned i = 0; i < SymbolIdx; i++) {