continue;
assert(addrSigSection->subsections.size() == 1);
- Subsection *subSection = &addrSigSection->subsections[0];
- ArrayRef<unsigned char> &contents = subSection->isec->data;
-
- 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;
+ const InputSection *isec = addrSigSection->subsections[0].isec;
+
+ for (const Reloc &r : isec->relocs) {
+ if (auto *sym = r.referent.dyn_cast<Symbol *>())
+ markSymAsAddrSig(sym);
+ else
+ error(toString(isec) + ": unexpected section relocation");
}
}
}