/freebsd/contrib/llvm-project/llvm/lib/ObjCopy/wasm/ |
H A D | WasmObjcopy.cpp | 25 return Sec.Name.starts_with(".debug"); in isDebugSection() 29 return Sec.Name.starts_with("reloc.") || Sec.Name == "linking"; in isLinkerSection() 32 static bool isNameSection(const Section &Sec) { return Sec.Name == "name"; } in isNameSection() argument 37 return Sec.Name == "producers"; in isCommentSection() 43 if (Sec.Name == SecName) { in dumpSectionToFile() 72 return RemovePred(Sec) || isDebugSection(Sec); in removeSections() 78 return RemovePred(Sec) || isDebugSection(Sec) || isLinkerSection(Sec) || in removeSections() 79 isNameSection(Sec) || isCommentSection(Sec); in removeSections() 87 return Config.ToRemove.matches(Sec.Name) || !isDebugSection(Sec); in removeSections() 105 return RemovePred(Sec); in removeSections() [all …]
|
/freebsd/contrib/llvm-project/llvm/lib/ObjCopy/ELF/ |
H A D | ELFObjcopy.cpp | 114 Sec.Offset = alignTo(Sec.Offset, std::max(Sec.Align, uint64_t(1))); in setSectionType() 115 Sec.Type = Type; in setSectionType() 204 std::copy(Sec.OriginalData.begin(), Sec.OriginalData.end(), in dumpSectionToFile() 398 return isDWOSection(Sec) || RemovePred(Sec); in replaceAndRemoveSections() 403 return onlyKeepDWOPred(Obj, Sec) || RemovePred(Sec); in replaceAndRemoveSections() 426 return RemovePred(Sec) || Sec.ParentSegment == nullptr; in replaceAndRemoveSections() 432 return RemovePred(Sec) || isDebugSection(Sec); in replaceAndRemoveSections() 470 return (Sec.Flags & SHF_ALLOC) != 0 && !Sec.ParentSegment; in replaceAndRemoveSections() 550 uint64_t Value = Sec ? Sec->Addr + SymInfo.Value : SymInfo.Value; in addSymbol() 658 if (Sec.Flags & SHF_ALLOC && Sec.Type != SHT_NOTE) in handleArgs() [all …]
|
H A D | ELFObject.cpp | 103 Sec.Size = Sec.Symbols.size() * Sec.EntrySize; in visit() 112 Sec.Size = Sec.Relocations.size() * Sec.EntrySize; in visit() 385 writeSection(&Sec, Sec.Contents); in visit() 390 writeSection(&Sec, Sec.Data); in visit() 396 assert(Sec.Size == Sec.StrTabBuilder.getSize()); in visit() 405 writeSection(&Sec, Sec.Contents); in visit() 417 assert(Sec.Size == Sec.StrTabBuilder.getSize()); in visit() 1198 uint64_t SecSize = Sec.Size ? Sec.Size : 1; in sectionWithinSegment() 1786 Sec->OriginalIndex = Sec->Index; in readSectionHeaders() 2685 Sec.Offset - Sec.ParentSegment->Offset + Sec.ParentSegment->PAddr; in finalize() [all …]
|
H A D | ELFObject.h | 94 virtual Error visit(Section &Sec) = 0; 158 Error visit(Section &Sec) override; 480 void removeSection(const SectionBase *Sec) { Sections.erase(Sec); } in removeSection() argument 481 void addSection(const SectionBase *Sec) { Sections.insert(Sec); } in addSection() argument 576 : SectionBase(Sec), ChType(Sec.getChType()) { in DecompressedSection() 577 Size = Sec.getDecompressedSize(); in DecompressedSection() 763 void setSection(SectionBase *Sec) { SecToApplyRel = Sec; } in setSection() argument 836 void addMember(SectionBase *Sec) { GroupMembers.push_back(Sec); } in addMember() argument 1040 return Sec.Flags & ELF::SHF_ALLOC; in sectionIsAlloc() 1088 find_if(Sections, [&](const SecPtr &Sec) { return Sec->Name == Name; }); in findSection() [all …]
|
/freebsd/contrib/llvm-project/llvm/lib/ObjCopy/COFF/ |
H A D | COFFObjcopy.cpp | 32 return Sec.Name.starts_with(".debug"); in isDebugSection() 66 Section Sec; in addSection() local 67 Sec.setOwnedContents(Contents); in addSection() 68 Sec.Name = Name; in addSection() 69 Sec.Header.VirtualSize = NeedVA ? Sec.getContents().size() : 0u; in addSection() 71 Sec.Header.SizeOfRawData = in addSection() 79 Sec.Header.NumberOfLinenumbers = 0; in addSection() 82 Obj.addSections(Sec); in addSection() 174 if (isDebugSection(Sec) && in handleArgs() 189 return !isDebugSection(Sec) && Sec.Name != ".buildid" && in handleArgs() [all …]
|
H A D | COFFObject.cpp | 56 for (const Section &Sec : Sections) { in markSymbols() local 57 for (const Relocation &R : Sec.Relocs) { in markSymbols() 91 auto RemoveAssociated = [&AssociatedSections](const Section &Sec) { in removeSections() argument 92 return AssociatedSections.contains(Sec.UniqueId); in removeSections() 97 bool Remove = ToRemove(Sec); in removeSections() 99 RemovedSections.insert(Sec.UniqueId); in removeSections() 121 for (Section &Sec : Sections) { in truncateSections() 122 if (ToTruncate(Sec)) { in truncateSections() 123 Sec.clearContents(); in truncateSections() 124 Sec.Relocs.clear(); in truncateSections() [all …]
|
/freebsd/contrib/llvm-project/llvm/include/llvm/Object/ |
H A D | GOFFObjectFile.h | 84 void moveSectionNext(DataRefImpl &Sec) const override {} in moveSectionNext() argument 89 uint64_t getSectionSize(DataRefImpl Sec) const override { return 0; } in getSectionSize() argument 91 getSectionContents(DataRefImpl Sec) const override { in getSectionContents() argument 97 bool isSectionText(DataRefImpl Sec) const override { return false; } in isSectionText() argument 98 bool isSectionData(DataRefImpl Sec) const override { return false; } in isSectionData() argument 99 bool isSectionBSS(DataRefImpl Sec) const override { return false; } in isSectionBSS() argument 102 return relocation_iterator(RelocationRef(Sec, this)); in section_rel_begin() 104 relocation_iterator section_rel_end(DataRefImpl Sec) const override { in section_rel_end() argument 105 return relocation_iterator(RelocationRef(Sec, this)); in section_rel_end() 108 const uint8_t *getSectionEdEsdRecord(DataRefImpl &Sec) const; [all …]
|
H A D | ELF.h | 177 if (Sec.sh_size == 0) in checkSectionOffsets() 179 return Sec.sh_offset + Sec.sh_size <= Phdr.p_offset + Phdr.p_filesz; in checkSectionOffsets() 190 if (Sec.sh_addr < Phdr.p_vaddr) in checkSectionVMA() 194 (Sec.sh_type == ELF::SHT_NOBITS) && ((Sec.sh_flags & ELF::SHF_TLS) != 0); in checkSectionVMA() 200 return Sec.sh_addr + Sec.sh_size <= Phdr.p_vaddr + Phdr.p_memsz; in checkSectionVMA() 247 const Elf_Shdr &Sec, 305 if (!Sec) in symbols() 574 uintX_t Size = Sec.sh_size; in getSectionContentsAsArray() 783 if (Sec.sh_size % Sec.sh_entsize != 0) { in getDynSymtabSize() 789 return Sec.sh_size / Sec.sh_entsize; in getDynSymtabSize() [all …]
|
H A D | ELFObjectFile.h | 495 switch (Sec.sh_type) { in initContent() 498 DotDynSymSec = &Sec; in initContent() 503 DotSymtabSec = &Sec; in initContent() 508 DotSymtabShndxSec = &Sec; in initContent() 550 return getSection(Sec)->sh_flags; in getSectionFlags() 555 return getSection(Sec)->sh_type; in getSectionType() 833 DataRefImpl Sec; in getSymbolSection() local 854 Sec = toDRI(++ESec); in moveSectionNext() 864 return getSection(Sec)->sh_addr; in getSectionAddress() 875 return getSection(Sec) - First; in getSectionIndex() [all …]
|
/freebsd/contrib/llvm-project/llvm/include/llvm/MC/ |
H A D | MCFragment.h | 117 explicit MCDummyFragment(MCSection *Sec) : MCFragment(FT_Dummy, false, Sec) {} in MCDummyFragment() argument 133 MCSection *Sec) in MCEncodedFragment() argument 134 : MCFragment(FType, HasInstructions, Sec) {} in MCEncodedFragment() 193 MCSection *Sec) in MCEncodedFragmentWithContents() argument 214 MCSection *Sec) in MCEncodedFragmentWithFixups() argument 244 MCDataFragment(MCSection *Sec = nullptr) 283 MCSection *Sec = nullptr) 359 SMLoc Loc, MCSection *Sec = nullptr) 416 MCSection *Sec = nullptr) 468 MCSection *Sec = nullptr) [all …]
|
/freebsd/contrib/llvm-project/llvm/lib/ExecutionEngine/Orc/Debugging/ |
H A D | DebugInfoSupport.cpp | 35 for (auto Sym : Sec.symbols()) { in preserveDWARFSection() 41 for (auto Block : Sec.blocks()) { in preserveDWARFSection() 50 static SmallVector<char, 0> getSectionData(Section &Sec) { in getSectionData() argument 52 SmallVector<Block *, 8> SecBlocks(Sec.blocks().begin(), Sec.blocks().end()); in getSectionData() 84 for (auto &Sec : G.sections()) { in preserveDebugSections() local 85 if (DWARFSectionNames.count(Sec.getName())) { in preserveDebugSections() 88 preserveDWARFSection(G, Sec); in preserveDebugSections() 103 for (auto &Sec : G.sections()) { in createDWARFContext() local 104 if (DWARFSectionNames.count(Sec.getName())) { in createDWARFContext() 105 auto SecData = getSectionData(Sec); in createDWARFContext() [all …]
|
/freebsd/contrib/llvm-project/llvm/lib/ObjCopy/MachO/ |
H A D | MachOReader.cpp | 33 StringRef SegName(Sec.segname, strnlen(Sec.segname, sizeof(Sec.segname))); in constructSectionCommon() 34 StringRef SectName(Sec.sectname, strnlen(Sec.sectname, sizeof(Sec.sectname))); in constructSectionCommon() 37 S.Addr = Sec.addr; in constructSectionCommon() 38 S.Size = Sec.size; in constructSectionCommon() 40 S.Align = Sec.align; in constructSectionCommon() 41 S.RelOff = Sec.reloff; in constructSectionCommon() 42 S.NReloc = Sec.nreloc; in constructSectionCommon() 43 S.Flags = Sec.flags; in constructSectionCommon() 44 S.Reserved1 = Sec.reserved1; in constructSectionCommon() 70 SectionType Sec; in extractSections() local [all …]
|
H A D | MachOObjcopy.cpp | 62 return Config.ToRemove.matches(Sec->CanonicalName); in removeSections() 69 if (Sec->Segname == "__DWARF") in removeSections() 72 return RemovePred(Sec); in removeSections() 293 if (Sec->CanonicalName == SecName) { in dumpSectionToFile() 314 Section Sec(TargetSegName, Pair.second); in addSection() local 315 Sec.Content = in addSection() 317 Sec.Size = Sec.Content.size(); in addSection() 370 Section &Sec = *SecToUpdateOrErr; in updateSection() local 377 Sec.Size = Sec.Content.size(); in updateSection() 425 for (std::unique_ptr<Section> &Sec : LC.Sections) in handleArgs() [all …]
|
H A D | MachOWriter.cpp | 221 memcpy(Temp.segname, Sec.Segname.data(), Sec.Segname.size()); in writeSectionInLoadCommand() 222 memcpy(Temp.sectname, Sec.Sectname.data(), Sec.Sectname.size()); in writeSectionInLoadCommand() 223 Temp.addr = Sec.Addr; in writeSectionInLoadCommand() 224 Temp.size = Sec.Size; in writeSectionInLoadCommand() 225 Temp.offset = Sec.Offset; in writeSectionInLoadCommand() 226 Temp.align = Sec.Align; in writeSectionInLoadCommand() 227 Temp.reloff = Sec.RelOff; in writeSectionInLoadCommand() 229 Temp.flags = Sec.Flags; in writeSectionInLoadCommand() 244 assert((Sec->isVirtualSection() || Sec->Size == 0) && in writeSections() 250 assert((Sec->Size == Sec->Content.size()) && "Incorrect section size"); in writeSections() [all …]
|
/freebsd/contrib/llvm-project/llvm/lib/ObjCopy/XCOFF/ |
H A D | XCOFFWriter.cpp | 28 for (const Section &Sec : Obj.Sections) { in finalizeSections() local 30 FileSize += Sec.Contents.size(); in finalizeSections() 33 Sec.SectionHeader.NumberOfRelocations * sizeof(XCOFFRelocation32); in finalizeSections() 67 for (const Section &Sec : Obj.Sections) { in writeHeaders() local 68 memcpy(Ptr, &Sec.SectionHeader, sizeof(XCOFFSectionHeader32)); in writeHeaders() 75 for (const Section &Sec : Obj.Sections) { in writeSections() local 77 Sec.SectionHeader.FileOffsetToRawData; in writeSections() 78 Ptr = std::copy(Sec.Contents.begin(), Sec.Contents.end(), Ptr); in writeSections() 82 for (const Section &Sec : Obj.Sections) { in writeSections() local 84 Sec.SectionHeader.FileOffsetToRelocationInfo; in writeSections() [all …]
|
/freebsd/contrib/llvm-project/llvm/lib/ExecutionEngine/JITLink/ |
H A D | DefineExternalSectionStartAndEndSymbols.h | 28 SectionRangeSymbolDesc(Section &Sec, bool IsStart) in SectionRangeSymbolDesc() 29 : Sec(&Sec), IsStart(IsStart) {} in SectionRangeSymbolDesc() 30 Section *Sec = nullptr; member 51 if (D.Sec) { in operator() 52 auto &SR = getSectionRange(*D.Sec); in operator() 73 SectionRange &getSectionRange(Section &Sec) { in getSectionRange() argument 74 auto I = SectionRanges.find(&Sec); in getSectionRange() 76 I = SectionRanges.insert(std::make_pair(&Sec, SectionRange(Sec))).first; in getSectionRange()
|
H A D | COFFLinkGraphBuilder.cpp | 57 return std::min(Sec->VirtualSize, Sec->SizeOfRawData); in getSectionSize() 58 return Sec->SizeOfRawData; in getSectionSize() 130 if (!Sec) in graphifySections() 131 return Sec.takeError(); in graphifySections() 173 *GraphSec, getSectionSize(Obj, *Sec), in graphifySections() 174 orc::ExecutorAddr(getSectionAddress(Obj, *Sec)), in graphifySections() 175 (*Sec)->getAlignment(), 0); in graphifySections() 178 if (auto Err = Obj.getSectionContents(*Sec, Data)) in graphifySections() 191 (*Sec)->getAlignment(), 0); in graphifySections() 219 const object::coff_section *Sec = nullptr; in graphifySymbols() local [all …]
|
/freebsd/contrib/llvm-project/llvm/include/llvm/ExecutionEngine/Orc/ |
H A D | MachOBuilder.h | 290 for (auto &Sec : Sections) 368 if (Sec->Content.Size) 369 Sec->offset = Offset; 370 Sec->size = Sec->Content.Size; 371 Sec->addr = SegVMAddr + Sec->offset - Seg.fileoff; 399 Sym.n_value += Sec->addr; 408 if (!Sec->Relocs.empty()) { 413 Sec->reloff = Offset; 414 Sec->nreloc = Sec->Relocs.size(); 492 if (!Sec->Content.Data) { [all …]
|
/freebsd/contrib/llvm-project/llvm/lib/MC/ |
H A D | MCFragment.cpp | 34 for (MCSection &Sec : Asm) in MCAsmLayout() 35 if (!Sec.isVirtualSection()) in MCAsmLayout() 36 SectionOrder.push_back(&Sec); in MCAsmLayout() 37 for (MCSection &Sec : Asm) in MCAsmLayout() 38 if (Sec.isVirtualSection()) in MCAsmLayout() 39 SectionOrder.push_back(&Sec); in MCAsmLayout() 52 MCSection *Sec = F->getParent(); in canGetFragmentOffset() local 60 I = Sec->begin(); in canGetFragmentOffset() 81 MCSection *Sec = F->getParent(); in ensureValid() local 86 I = Sec->begin(); in ensureValid() [all …]
|
H A D | WinCOFFObjectWriter.cpp | 290 switch (Sec.getAlign().value()) { in getAlignment() 406 COFFSection *Sec = nullptr; in DefineSymbol() local 422 if (!Sec) in DefineSymbol() 425 WeakDefault->Section = Sec; in DefineSymbol() 443 Sym->Section = Sec; in DefineSymbol() 626 if (Sec.Number == -1) in writeSection() 644 if (Sec.Relocations.empty()) { in writeSection() 776 if (!Sec || Sec->Number == -1) in assignFileOffsets() 781 if (IsPhysicalSection(Sec)) { in assignFileOffsets() 786 if (!Sec->Relocations.empty()) { in assignFileOffsets() [all …]
|
/freebsd/contrib/llvm-project/llvm/lib/Target/Mips/MCTargetDesc/ |
H A D | MipsOptionRecord.cpp | 36 MCSectionELF *Sec = in EmitMipsOptionRecord() local 39 MCA.registerSection(*Sec); in EmitMipsOptionRecord() 40 Sec->setAlignment(Align(8)); in EmitMipsOptionRecord() 41 Streamer->switchSection(Sec); in EmitMipsOptionRecord() 55 MCSectionELF *Sec = Context.getELFSection(".reginfo", ELF::SHT_MIPS_REGINFO, in EmitMipsOptionRecord() local 57 MCA.registerSection(*Sec); in EmitMipsOptionRecord() 58 Sec->setAlignment(MTS->getABI().IsN32() ? Align(8) : Align(4)); in EmitMipsOptionRecord() 59 Streamer->switchSection(Sec); in EmitMipsOptionRecord()
|
/freebsd/contrib/llvm-project/llvm/lib/Object/ |
H A D | XCOFFObjectFile.cpp | 396 return toSection64(Sec)->SectionSize; in getSectionSize() 398 return toSection32(Sec)->SectionSize; in getSectionSize() 403 if (isSectionVirtual(Sec)) in getSectionContents() 493 uint32_t Flags = getSectionFlags(Sec); in isSectionData() 498 uint32_t Flags = getSectionFlags(Sec); in isSectionBSS() 503 uint32_t Flags = getSectionFlags(Sec); in isDebugSection() 801 for (const auto &Sec : Sections) in getSectionByType() local 956 return is64Bit() ? toSection64(Sec)->Name : toSection32(Sec)->Name; in getSectionNameInternal() 964 return is64Bit() ? toSection64(Sec)->Flags : toSection32(Sec)->Flags; in getSectionFlags() 1000 for (const auto &Sec : sections32()) { in getNumberOfRelocationEntries() local [all …]
|
H A D | ObjectFile.cpp | 79 bool ObjectFile::isSectionBitcode(DataRefImpl Sec) const { in isSectionBitcode() 80 Expected<StringRef> NameOrErr = getSectionName(Sec); in isSectionBitcode() 87 bool ObjectFile::isSectionStripped(DataRefImpl Sec) const { return false; } in isSectionStripped() 89 bool ObjectFile::isBerkeleyText(DataRefImpl Sec) const { in isBerkeleyText() 90 return isSectionText(Sec); in isBerkeleyText() 93 bool ObjectFile::isBerkeleyData(DataRefImpl Sec) const { in isBerkeleyData() 94 return isSectionData(Sec); in isBerkeleyData() 97 bool ObjectFile::isDebugSection(DataRefImpl Sec) const { return false; } in isDebugSection() 101 [](SectionRef Sec) { return Sec.isDebugSection(); }); in hasDebugInfo() argument 105 ObjectFile::getRelocatedSection(DataRefImpl Sec) const { in getRelocatedSection() [all …]
|
/freebsd/contrib/llvm-project/llvm/lib/ObjectYAML/ |
H A D | MachOEmitter.cpp | 113 TempSec.addr = Sec.addr; in constructSection() 114 TempSec.size = Sec.size; in constructSection() 115 TempSec.offset = Sec.offset; in constructSection() 116 TempSec.align = Sec.align; in constructSection() 117 TempSec.reloff = Sec.reloff; in constructSection() 119 TempSec.flags = Sec.flags; in constructSection() 317 if (OS.tell() - fileStart > Sec.offset && Sec.offset != (uint32_t)0) in writeSectionData() 324 Sec.sectname, Sec.segname, OS.tell(), fileStart, in writeSectionData() 328 strnlen(Sec.sectname, sizeof(Sec.sectname))); in writeSectionData() 332 if (Sec.content) in writeSectionData() [all …]
|
/freebsd/contrib/llvm-project/llvm/tools/llvm-objdump/ |
H A D | ELFDump.cpp | 81 for (const typename ELFT::Shdr &Sec : *SectionsOrError) { in getDynamicStrTab() 82 if (Sec.sh_type == ELF::SHT_DYNSYM) in getDynamicStrTab() 83 return Elf.getStringTableForSymtab(Sec); in getDynamicStrTab() 188 return Sec.getAddress() - Phdr.p_vaddr + Phdr.p_paddr; in getSectionLMA() 191 return Sec.getAddress(); in getSectionLMA() 196 return getSectionLMA(ELFObj->getELFFile(), Sec); in getELFSectionLMA() 198 return getSectionLMA(ELFObj->getELFFile(), Sec); in getELFSectionLMA() 200 return getSectionLMA(ELFObj->getELFFile(), Sec); in getELFSectionLMA() 202 return getSectionLMA(ELFObj->getELFFile(), Sec); in getELFSectionLMA() 326 return Sec.getType() == ELF::SHT_DYNAMIC; in printDynamicRelocations() [all …]
|