| /freebsd/contrib/llvm-project/llvm/lib/ObjCopy/wasm/ |
| H A D | WasmObjcopy.cpp | 22 using SectionPred = std::function<bool(const Section &Sec)>; 24 static bool isDebugSection(const Section &Sec) { in isDebugSection() argument 25 return Sec.Name.starts_with(".debug") || Sec.Name.starts_with("reloc..debug"); in isDebugSection() 28 static bool isLinkerSection(const Section &Sec) { in isLinkerSection() argument 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 36 static bool isCommentSection(const Section &Sec) { in isCommentSection() argument 37 return Sec.Name == "producers"; in isCommentSection() 42 for (const Section &Sec : Obj.Sections) { in dumpSectionToFile() local 43 if (Sec.Name == SecName) { in dumpSectionToFile() [all …]
|
| H A D | WasmObject.cpp | 30 for (auto &Sec : Sections) { in removeSections() local 31 if (ToRemove(Sec)) { in removeSections() 32 Sec.Name = ".objcopy.removed"; in removeSections() 33 Sec.SectionType = wasm::WASM_SEC_CUSTOM; in removeSections() 34 Sec.Contents = {}; in removeSections() 35 Sec.HeaderSecSizeEncodingLen = std::nullopt; in removeSections()
|
| /freebsd/contrib/llvm-project/llvm/lib/ObjCopy/ELF/ |
| H A D | ELFObject.cpp | 66 template <class ELFT> void ELFWriter<ELFT>::writeShdr(const SectionBase &Sec) { in writeShdr() argument 68 reinterpret_cast<uint8_t *>(Buf->getBufferStart()) + Sec.HeaderOffset; in writeShdr() 70 Shdr.sh_name = Sec.NameIndex; in writeShdr() 71 Shdr.sh_type = Sec.Type; in writeShdr() 72 Shdr.sh_flags = Sec.Flags; in writeShdr() 73 Shdr.sh_addr = Sec.Addr; in writeShdr() 74 Shdr.sh_offset = Sec.Offset; in writeShdr() 75 Shdr.sh_size = Sec.Size; in writeShdr() 76 Shdr.sh_link = Sec.Link; in writeShdr() 77 Shdr.sh_info = Sec.Info; in writeShdr() [all …]
|
| H A D | ELFObjcopy.cpp | 47 using SectionPred = std::function<bool(const SectionBase &Sec)>; 49 static bool isDebugSection(const SectionBase &Sec) { in isDebugSection() argument 50 return StringRef(Sec.Name).starts_with(".debug") || Sec.Name == ".gdb_index"; in isDebugSection() 53 static bool isDWOSection(const SectionBase &Sec) { in isDWOSection() argument 54 return StringRef(Sec.Name).ends_with(".dwo"); in isDWOSection() 57 static bool onlyKeepDWOPred(const Object &Obj, const SectionBase &Sec) { in onlyKeepDWOPred() argument 59 if (&Sec == Obj.SectionNames) in onlyKeepDWOPred() 63 return !isDWOSection(Sec); in onlyKeepDWOPred() 105 static void setSectionType(SectionBase &Sec, uint64_t Type) { in setSectionType() argument 108 if (Sec.Type == ELF::SHT_NOBITS && Type != ELF::SHT_NOBITS) in setSectionType() [all …]
|
| H A D | ELFObject.h | 77 virtual Error visit(const Section &Sec) = 0; 78 virtual Error visit(const OwnedDataSection &Sec) = 0; 79 virtual Error visit(const StringTableSection &Sec) = 0; 80 virtual Error visit(const SymbolTableSection &Sec) = 0; 81 virtual Error visit(const RelocationSection &Sec) = 0; 82 virtual Error visit(const DynamicRelocationSection &Sec) = 0; 83 virtual Error visit(const GnuDebugLinkSection &Sec) = 0; 84 virtual Error visit(const GroupSection &Sec) = 0; 85 virtual Error visit(const SectionIndexSection &Sec) = 0; 86 virtual Error visit(const CompressedSection &Sec) = 0; [all …]
|
| /freebsd/contrib/llvm-project/llvm/lib/ExecutionEngine/Orc/ |
| H A D | DebuggerSupportPlugin.cpp | |
| /freebsd/contrib/llvm-project/llvm/include/llvm/Object/ |
| H A D | GOFFObjectFile.h | 73 bool isSectionNoLoad(DataRefImpl Sec) const; 74 bool isSectionReadOnlyData(DataRefImpl Sec) const; 75 bool isSectionZeroInit(DataRefImpl Sec) const; 93 void moveSectionNext(DataRefImpl &Sec) const override; 94 virtual Expected<StringRef> getSectionName(DataRefImpl Sec) const override; 95 uint64_t getSectionAddress(DataRefImpl Sec) const override; 96 uint64_t getSectionSize(DataRefImpl Sec) const override; 98 getSectionContents(DataRefImpl Sec) const override; 99 uint64_t getSectionIndex(DataRefImpl Sec) const override { return Sec.d.a; } in getSectionIndex() argument 100 uint64_t getSectionAlignment(DataRefImpl Sec) const override; [all …]
|
| H A D | ELF.h | 132 const typename ELFT::Shdr &Sec) { in getSecIndexForError() argument 135 return "[index " + std::to_string(&Sec - &TableOrErr->front()) + "]"; in getSecIndexForError() 146 const typename ELFT::Shdr &Sec) { in describe() argument 147 unsigned SecNdx = &Sec - &cantFail(Obj.sections()).front(); in describe() 149 Sec.sh_type) + in describe() 171 const typename ELFT::Shdr &Sec) { in checkSectionOffsets() argument 173 if (Sec.sh_type == ELF::SHT_NOBITS) in checkSectionOffsets() 176 if (Sec.sh_offset < Phdr.p_offset) in checkSectionOffsets() 180 if (Sec.sh_size == 0) in checkSectionOffsets() 181 return (Sec.sh_offset + 1 <= Phdr.p_offset + Phdr.p_filesz); in checkSectionOffsets() [all …]
|
| H A D | ELFObjectFile.h | 82 virtual uint32_t getSectionType(DataRefImpl Sec) const = 0; 83 virtual uint64_t getSectionFlags(DataRefImpl Sec) const = 0; 84 virtual uint64_t getSectionOffset(DataRefImpl Sec) const = 0; 130 StringRef getCrelDecodeProblem(SectionRef Sec) const; 277 SectionRef toSectionRef(const Elf_Shdr *Sec) const { in LLVM_ELF_IMPORT_TYPES_ELFT() 278 return SectionRef(toDRI(Sec), this); in LLVM_ELF_IMPORT_TYPES_ELFT() 322 void moveSectionNext(DataRefImpl &Sec) const override; 323 Expected<StringRef> getSectionName(DataRefImpl Sec) const override; 324 uint64_t getSectionAddress(DataRefImpl Sec) const override; 325 uint64_t getSectionIndex(DataRefImpl Sec) const override; [all …]
|
| /freebsd/contrib/llvm-project/llvm/lib/ObjCopy/COFF/ |
| H A D | COFFObjcopy.cpp | 31 static bool isDebugSection(const Section &Sec) { in isDebugSection() argument 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() 70 Sec.Header.VirtualAddress = NeedVA ? getNextRVA(Obj) : 0u; in addSection() 71 Sec.Header.SizeOfRawData = in addSection() 72 NeedVA ? alignTo(Sec.Header.VirtualSize, in addSection() 74 : Sec.getContents().size(); in addSection() [all …]
|
| H A D | COFFObject.cpp | 57 for (const Section &Sec : Sections) { in markSymbols() local 58 for (const Relocation &R : Sec.Relocs) { in markSymbols() 92 auto RemoveAssociated = [&AssociatedSections](const Section &Sec) { in removeSections() argument 93 return AssociatedSections.contains(Sec.UniqueId); in removeSections() 97 llvm::erase_if(Sections, [ToRemove, &RemovedSections](const Section &Sec) { in removeSections() argument 98 bool Remove = ToRemove(Sec); in removeSections() 100 RemovedSections.insert(Sec.UniqueId); in removeSections() 122 for (Section &Sec : Sections) { in truncateSections() 123 if (ToTruncate(Sec)) { in truncateSections() 124 Sec.clearContents(); in truncateSections() [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 return SectionRanges.try_emplace(&Sec, Sec).first->second; in getSectionRange() 116 if (auto *Sec = G.findSectionByName( in identifyELFSectionStartAndEndSymbols() local 118 return {*Sec, true}; in identifyELFSectionStartAndEndSymbols() 120 if (auto *Sec = in identifyELFSectionStartAndEndSymbols() local [all …]
|
| H A D | MachO.cpp | 90 static Expected<Block &> createLocalHeaderBlock(LinkGraph &G, Section &Sec) { in createLocalHeaderBlock() argument 91 auto &B = G.createMutableContentBlock(Sec, sizeof(MachOHeaderType), in createLocalHeaderBlock() 115 Section *Sec = G.findSectionByName(LocalHeaderSectionName); in getOrCreateLocalMachOHeader() local 116 if (Sec) { in getOrCreateLocalMachOHeader() 117 assert(Sec->blocks_size() == 1 && "Unexpected number of blocks"); in getOrCreateLocalMachOHeader() 118 assert(Sec->symbols_size() == 1 && "Unexpected number of symbols"); in getOrCreateLocalMachOHeader() 119 auto &Sym = **Sec->symbols().begin(); in getOrCreateLocalMachOHeader() 126 for (auto &Sec : G.sections()) in getOrCreateLocalMachOHeader() local 127 Sec.setOrdinal(Sec.getOrdinal() + 1); in getOrCreateLocalMachOHeader() 129 Sec = &G.createSection(LocalHeaderSectionName, orc::MemProt::Read); in getOrCreateLocalMachOHeader() [all …]
|
| H A D | COFFLinkGraphBuilder.cpp | 47 const object::coff_section *Sec) { in getSectionSize() argument 51 return std::min(Sec->VirtualSize, Sec->SizeOfRawData); in getSectionSize() 52 return Sec->SizeOfRawData; in getSectionSize() 91 const object::coff_section *Sec, in getCOFFSectionName() argument 108 if (Expected<StringRef> SecNameOrErr = Obj.getSectionName(Sec)) in getCOFFSectionName() 123 Expected<const object::coff_section *> Sec = Obj.getSection(SecIndex); in graphifySections() local 124 if (!Sec) in graphifySections() 125 return Sec.takeError(); in graphifySections() 128 if (Expected<StringRef> SecNameOrErr = Obj.getSectionName(*Sec)) in graphifySections() 147 if ((*Sec)->Characteristics & COFF::IMAGE_SCN_MEM_EXECUTE) in graphifySections() [all …]
|
| /freebsd/contrib/llvm-project/llvm/lib/Object/ |
| H A D | GOFFObjectFile.cpp | 338 DataRefImpl Sec; in getSymbolSection() local 341 return section_iterator(SectionRef(Sec, this)); in getSymbolSection() 359 Sec.d.a = I; in getSymbolSection() 360 return section_iterator(SectionRef(Sec, this)); in getSymbolSection() 376 const uint8_t *GOFFObjectFile::getSectionEdEsdRecord(DataRefImpl &Sec) const { in getSectionEdEsdRecord() 377 SectionEntryImpl EsdIds = SectionList[Sec.d.a]; in getSectionEdEsdRecord() 382 const uint8_t *GOFFObjectFile::getSectionPrEsdRecord(DataRefImpl &Sec) const { in getSectionPrEsdRecord() 383 SectionEntryImpl EsdIds = SectionList[Sec.d.a]; in getSectionPrEsdRecord() 392 DataRefImpl Sec; in getSectionEdEsdRecord() local 393 Sec.d.a = SectionIndex; in getSectionEdEsdRecord() [all …]
|
| H A D | XCOFFObjectFile.cpp | 372 void XCOFFObjectFile::moveSectionNext(DataRefImpl &Sec) const { in moveSectionNext() 373 const char *Ptr = reinterpret_cast<const char *>(Sec.p); in moveSectionNext() 374 Sec.p = reinterpret_cast<uintptr_t>(Ptr + getSectionHeaderSize()); in moveSectionNext() 377 Expected<StringRef> XCOFFObjectFile::getSectionName(DataRefImpl Sec) const { in getSectionName() 378 return generateXCOFFFixedNameStringRef(getSectionNameInternal(Sec)); in getSectionName() 381 uint64_t XCOFFObjectFile::getSectionAddress(DataRefImpl Sec) const { in getSectionAddress() 385 return toSection64(Sec)->VirtualAddress; in getSectionAddress() 387 return toSection32(Sec)->VirtualAddress; in getSectionAddress() 390 uint64_t XCOFFObjectFile::getSectionIndex(DataRefImpl Sec) const { in getSectionIndex() 394 return toSection64(Sec) - sectionHeaderTable64() + 1; in getSectionIndex() [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 in hasDebugInfo() argument [all...] |
| /freebsd/contrib/llvm-project/llvm/lib/ExecutionEngine/Orc/Debugging/ |
| H A D | DebugInfoSupport.cpp | 33 static void preserveDWARFSection(LinkGraph &G, Section &Sec) { in preserveDWARFSection() argument 35 for (auto Sym : Sec.symbols()) { in preserveDWARFSection() 40 for (auto Block : Sec.blocks()) { in preserveDWARFSection() 49 static SmallVector<char, 0> getSectionData(Section &Sec) { in getSectionData() argument 51 SmallVector<Block *, 8> SecBlocks(Sec.blocks().begin(), Sec.blocks().end()); in getSectionData() 83 for (auto &Sec : G.sections()) { in preserveDebugSections() local 84 if (DWARFSectionNames.count(Sec.getName())) { in preserveDebugSections() 85 LLVM_DEBUG(dbgs() << "Preserving DWARF section " << Sec.getName() in preserveDebugSections() 87 preserveDWARFSection(G, Sec); in preserveDebugSections() 102 for (auto &Sec : G.sections()) { in createDWARFContext() local [all …]
|
| /freebsd/contrib/llvm-project/llvm/lib/ObjCopy/MachO/ |
| H A D | MachOReader.cpp | 31 static Section constructSectionCommon(const SectionType &Sec, uint32_t Index) { in constructSectionCommon() argument 32 StringRef SegName(Sec.segname, strnlen(Sec.segname, sizeof(Sec.segname))); in constructSectionCommon() 33 StringRef SectName(Sec.sectname, strnlen(Sec.sectname, sizeof(Sec.sectname))); in constructSectionCommon() 36 S.Addr = Sec.addr; in constructSectionCommon() 37 S.Size = Sec.size; in constructSectionCommon() 38 S.OriginalOffset = Sec.offset; in constructSectionCommon() 39 S.Align = Sec.align; in constructSectionCommon() 40 S.RelOff = Sec.reloff; in constructSectionCommon() 41 S.NReloc = Sec.nreloc; in constructSectionCommon() 42 S.Flags = Sec.flags; in constructSectionCommon() [all …]
|
| H A D | MachOObjcopy.cpp | 32 using SectionPred = std::function<bool(const std::unique_ptr<Section> &Sec)>; 61 RemovePred = [&Config, RemovePred](const std::unique_ptr<Section> &Sec) { in removeSections() argument 62 return Config.ToRemove.matches(Sec->CanonicalName); in removeSections() 68 RemovePred = [RemovePred](const std::unique_ptr<Section> &Sec) { in removeSections() argument 69 if (Sec->Segname == "__DWARF") in removeSections() 72 return RemovePred(Sec); in removeSections() 78 RemovePred = [&Config](const std::unique_ptr<Section> &Sec) { in removeSections() argument 79 return !Config.OnlySection.matches(Sec->CanonicalName); in removeSections() 311 for (const std::unique_ptr<Section> &Sec : LC.Sections) { in dumpSectionToFile() local 312 if (Sec->CanonicalName == SecName) { in dumpSectionToFile() [all …]
|
| H A D | MachOWriter.cpp | 167 for (const std::unique_ptr<Section> &Sec : LC.Sections) in writeLoadCommands() local 168 writeSectionInLoadCommand<MachO::section>(*Sec, Begin); in writeLoadCommands() 177 for (const std::unique_ptr<Section> &Sec : LC.Sections) in writeLoadCommands() local 178 writeSectionInLoadCommand<MachO::section_64>(*Sec, Begin); in writeLoadCommands() 214 void MachOWriter::writeSectionInLoadCommand(const Section &Sec, uint8_t *&Out) { in writeSectionInLoadCommand() argument 216 assert(Sec.Segname.size() <= sizeof(Temp.segname) && "too long segment name"); in writeSectionInLoadCommand() 217 assert(Sec.Sectname.size() <= sizeof(Temp.sectname) && in writeSectionInLoadCommand() 220 memcpy(Temp.segname, Sec.Segname.data(), Sec.Segname.size()); in writeSectionInLoadCommand() 221 memcpy(Temp.sectname, Sec.Sectname.data(), Sec.Sectname.size()); in writeSectionInLoadCommand() 222 Temp.addr = Sec.Addr; in writeSectionInLoadCommand() [all …]
|
| /freebsd/contrib/llvm-project/llvm/include/llvm/ExecutionEngine/Orc/ |
| H A D | MachOBuilder.h | 285 for (auto &Sec : Sections) 286 Offset = writeMachOStruct(Buf, Offset, Sec->rawStruct(), SwapStruct); 361 for (auto &Sec : Seg.Sections) { 362 Offset = alignTo(Offset, 1ULL << Sec->align); 363 if (Sec->Content.Size) 364 Sec->offset = Offset; 365 Sec->size = Sec->Content.Size; 366 Sec->addr = SegVMAddr + Sec->offset - Seg.fileoff; 367 Offset += Sec->Content.Size; 386 for (auto &Sec : Seg.Sections) { [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 = llvm::copy(Sec.Contents, 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/MC/ |
| H A D | WinCOFFObjectWriter.cpp | 174 void defineSection(MCSectionCOFF const &Sec); 191 void writeSection(const COFFSection &Sec); 213 static bool isDwoSection(const MCSection &Sec) { in isDwoSection() argument 214 return Sec.getName().ends_with(".dwo"); in isDwoSection() 259 static uint32_t getAlignment(const MCSectionCOFF &Sec) { in getAlignment() argument 260 switch (Sec.getAlign().value()) { in getAlignment() 373 COFFSection *Sec = nullptr; in defineSymbol() local 377 Sec = SectionMap[MCSec]; in defineSymbol() 393 if (!Sec) in defineSymbol() 396 WeakDefault->Section = Sec; in defineSymbol() [all …]
|
| /freebsd/contrib/llvm-project/llvm/tools/llvm-objdump/ |
| H A D | ELFDump.cpp | 40 void printSymbolVersionDependency(const typename ELFT::Shdr &Sec); 88 for (const typename ELFT::Shdr &Sec : *SectionsOrError) { in getDynamicStrTab() 89 if (Sec.sh_type == ELF::SHT_DYNAMIC) in getDynamicStrTab() 90 return Elf.getLinkAsStrtab(Sec); in getDynamicStrTab() 187 const object::ELFSectionRef &Sec) { in getSectionLMA() argument 197 Phdr, *cast<const ELFObjectFile<ELFT>>(Sec.getObject()) in getSectionLMA() 198 ->getSection(Sec.getRawDataRefImpl())))) in getSectionLMA() 199 return Sec.getAddress() - Phdr.p_vaddr + Phdr.p_paddr; in getSectionLMA() 202 return Sec.getAddress(); in getSectionLMA() 205 uint64_t objdump::getELFSectionLMA(const object::ELFSectionRef &Sec) { in getELFSectionLMA() argument [all …]
|