forked from OSchip/llvm-project
[lld-macho] Read in new addrsig format
The new format uses symbol relocations, as described in {D127637}. Reviewed By: #lld-macho, alx32 Differential Revision: https://reviews.llvm.org/D128938
This commit is contained in:
parent
2e2737cdf9
commit
2d889a87fb
|
@ -384,18 +384,13 @@ void macho::markAddrSigSymbols() {
|
|||
continue;
|
||||
assert(addrSigSection->subsections.size() == 1);
|
||||
|
||||
Subsection *subSection = &addrSigSection->subsections[0];
|
||||
ArrayRef<unsigned char> &contents = subSection->isec->data;
|
||||
const InputSection *isec = addrSigSection->subsections[0].isec;
|
||||
|
||||
const uint8_t *pData = contents.begin();
|
||||
while (pData != contents.end()) {
|
||||
unsigned size;
|
||||
const char *err;
|
||||
uint32_t symIndex = decodeULEB128(pData, &size, contents.end(), &err);
|
||||
if (err)
|
||||
fatal(toString(file) + ": could not decode addrsig section: " + err);
|
||||
markSymAsAddrSig(obj->symbols[symIndex]);
|
||||
pData += size;
|
||||
for (const Reloc &r : isec->relocs) {
|
||||
if (auto *sym = r.referent.dyn_cast<Symbol *>())
|
||||
markSymAsAddrSig(sym);
|
||||
else
|
||||
error(toString(isec) + ": unexpected section relocation");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue