Lines Matching +full:function +full:- +full:off

1 //===- Relocations.cpp ----------------------------------------------------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
27 return d->isec(); in getReferentInputSection()
36 const RelocAttrs &relocAttrs = target->getRelocAttrs(r.type); in validateSymbolRelocation()
40 return (isec->getLocation(r.offset) + ": " + relocAttrs.name + in validateSymbolRelocation()
45 if (relocAttrs.hasAttr(RelocAttrBits::TLV) != sym->isTlv()) in validateSymbolRelocation()
46 error(message(Twine("requires that symbol ") + sym->getName() + " " + in validateSymbolRelocation()
47 (sym->isTlv() ? "not " : "") + "be thread-local")); in validateSymbolRelocation()
57 // However, many of our relocation-handling methods do not take the InputSection
59 // methods, this function allows us to emit better errors without threading an
64 // function should be called only on error paths, so some overhead is fine.
65 InputSection *macho::offsetToInputSection(uint64_t *off) { in offsetToInputSection() argument
67 if (*off < seg->fileOff || *off >= seg->fileOff + seg->fileSize) in offsetToInputSection()
70 const std::vector<OutputSection *> &sections = seg->getSections(); in offsetToInputSection()
73 if (*off < sections[osecIdx]->fileOff) in offsetToInputSection()
76 // We should be only calling this function on offsets that belong to in offsetToInputSection()
78 auto *osec = cast<ConcatOutputSection>(sections[osecIdx - 1]); in offsetToInputSection()
79 *off -= osec->fileOff; in offsetToInputSection()
82 for (; isecIdx < osec->inputs.size(); ++isecIdx) { in offsetToInputSection()
83 const ConcatInputSection *isec = osec->inputs[isecIdx]; in offsetToInputSection()
84 if (*off < isec->outSecOff) in offsetToInputSection()
88 ConcatInputSection *isec = osec->inputs[isecIdx - 1]; in offsetToInputSection()
89 *off -= isec->outSecOff; in offsetToInputSection()
98 uint64_t off = reinterpret_cast<const uint8_t *>(loc) - in.bufferStart; in reportRangeError() local
99 const InputSection *isec = offsetToInputSection(&off); in reportRangeError()
100 std::string locStr = isec ? isec->getLocation(off) : "(invalid location)"; in reportRangeError()
103 error(locStr + ": relocation " + target->getRelocAttrs(r.type).name + in reportRangeError()