Lines Matching defs:Sec
250 Expected<const coff_section *> Sec = getSection(Symb.getSectionNumber());
251 if (!Sec)
252 return Sec.takeError();
254 Ret.p = reinterpret_cast<uintptr_t>(*Sec);
264 const coff_section *Sec = toSec(Ref);
265 Sec += 1;
266 Ref.p = reinterpret_cast<uintptr_t>(Sec);
270 const coff_section *Sec = toSec(Ref);
271 return getSectionName(Sec);
275 const coff_section *Sec = toSec(Ref);
276 uint64_t Result = Sec->VirtualAddress;
284 uint64_t COFFObjectFile::getSectionIndex(DataRefImpl Sec) const {
285 return toSec(Sec) - SectionTable;
294 const coff_section *Sec = toSec(Ref);
296 if (Error E = getSectionContents(Sec, Res))
302 const coff_section *Sec = toSec(Ref);
303 return Sec->getAlignment();
306 bool COFFObjectFile::isSectionCompressed(DataRefImpl Sec) const {
311 const coff_section *Sec = toSec(Ref);
312 return Sec->Characteristics & COFF::IMAGE_SCN_CNT_CODE;
316 const coff_section *Sec = toSec(Ref);
317 return Sec->Characteristics & COFF::IMAGE_SCN_CNT_INITIALIZED_DATA;
321 const coff_section *Sec = toSec(Ref);
325 return (Sec->Characteristics & BssFlags) == BssFlags;
341 unsigned COFFObjectFile::getSectionID(SectionRef Sec) const {
343 Sec.getRawDataRefImpl().p - reinterpret_cast<uintptr_t>(SectionTable);
349 const coff_section *Sec = toSec(Ref);
352 return Sec->PointerToRawData == 0;
355 static uint32_t getNumberOfRelocations(const coff_section *Sec,
361 if (Sec->hasExtendedRelocations()) {
365 base + Sec->PointerToRelocations))) {
372 return Sec->NumberOfRelocations;
376 getFirstReloc(const coff_section *Sec, MemoryBufferRef M, const uint8_t *Base) {
377 uint64_t NumRelocs = getNumberOfRelocations(Sec, M, Base);
381 Base + Sec->PointerToRelocations);
382 if (Sec->hasExtendedRelocations()) {
396 const coff_section *Sec = toSec(Ref);
397 const coff_relocation *begin = getFirstReloc(Sec, Data, base());
398 if (begin && Sec->VirtualAddress != 0)
406 const coff_section *Sec = toSec(Ref);
407 const coff_relocation *I = getFirstReloc(Sec, Data, base());
409 I += getNumberOfRelocations(Sec, Data, base());
1188 COFFObjectFile::getSectionName(const coff_section *Sec) const {
1189 StringRef Name = StringRef(Sec->Name, COFF::NameSize).split('\0').first;
1209 uint64_t COFFObjectFile::getSectionSize(const coff_section *Sec) const {
1221 return std::min(Sec->VirtualSize, Sec->SizeOfRawData);
1222 return Sec->SizeOfRawData;
1225 Error COFFObjectFile::getSectionContents(const coff_section *Sec,
1229 if (Sec->PointerToRawData == 0)
1235 reinterpret_cast<uintptr_t>(base()) + Sec->PointerToRawData;
1236 uint32_t SectionSize = getSectionSize(Sec);
1299 COFFObjectFile::getRelocations(const coff_section *Sec) const {
1300 return {getFirstReloc(Sec, Data, base()),
1301 getNumberOfRelocations(Sec, Data, base())};