| /openbsd-src/gnu/llvm/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.startswith(".debug"); in isDebugSection() 28 static bool isLinkerSection(const Section &Sec) { in isLinkerSection() argument 29 return Sec.Name.startswith("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 …]
|
| /openbsd-src/gnu/llvm/llvm/lib/ObjCopy/ELF/ |
| H A D | ELFObjcopy.cpp | 52 using SectionPred = std::function<bool(const SectionBase &Sec)>; 54 static bool isDebugSection(const SectionBase &Sec) { in isDebugSection() argument 55 return StringRef(Sec.Name).startswith(".debug") || Sec.Name == ".gdb_index"; in isDebugSection() 58 static bool isDWOSection(const SectionBase &Sec) { in isDWOSection() argument 59 return StringRef(Sec.Name).endswith(".dwo"); in isDWOSection() 62 static bool onlyKeepDWOPred(const Object &Obj, const SectionBase &Sec) { in onlyKeepDWOPred() argument 64 if (&Sec == Obj.SectionNames) in onlyKeepDWOPred() 68 return !isDWOSection(Sec); in onlyKeepDWOPred() 100 static void setSectionFlagsAndType(SectionBase &Sec, SectionFlag Flags) { in setSectionFlagsAndType() argument 101 Sec.Flags = getSectionFlagsPreserveMask(Sec.Flags, getNewShfFlags(Flags)); in setSectionFlagsAndType() [all …]
|
| H A D | ELFObject.cpp | 67 template <class ELFT> void ELFWriter<ELFT>::writeShdr(const SectionBase &Sec) { in writeShdr() argument 69 reinterpret_cast<uint8_t *>(Buf->getBufferStart()) + Sec.HeaderOffset; in writeShdr() 71 Shdr.sh_name = Sec.NameIndex; in writeShdr() 72 Shdr.sh_type = Sec.Type; in writeShdr() 73 Shdr.sh_flags = Sec.Flags; in writeShdr() 74 Shdr.sh_addr = Sec.Addr; in writeShdr() 75 Shdr.sh_offset = Sec.Offset; in writeShdr() 76 Shdr.sh_size = Sec.Size; in writeShdr() 77 Shdr.sh_link = Sec.Link; in writeShdr() 78 Shdr.sh_info = Sec.Info; in writeShdr() [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 …]
|
| /openbsd-src/gnu/llvm/llvm/lib/ExecutionEngine/Orc/ |
| H A D | DebuggerSupportPlugin.cpp | 45 static bool isDebugSection(Section &Sec) { in isDebugSection() argument 46 return Sec.getName().startswith("__DWARF,"); in isDebugSection() 67 for (auto &Sec : G.sections()) { in preserveDebugSections() local 68 if (!isDebugSection(Sec)) in preserveDebugSections() 74 dbgs() << " Preserving debug section " << Sec.getName() << "\n"; in preserveDebugSections() 77 for (auto *Sym : Sec.symbols()) { in preserveDebugSections() 83 for (auto *B : Sec.blocks()) in preserveDebugSections() 129 Section *Sec = nullptr; in startSynthesis() member 139 for (auto &Sec : G.sections()) { in startSynthesis() local 140 if (Sec.blocks().empty()) in startSynthesis() [all …]
|
| H A D | ObjectFileInterface.cpp | 80 for (auto &Sec : Obj.sections()) { in getMachOObjectFileSymbolInfo() local 81 auto SecType = Obj.getSectionType(Sec); in getMachOObjectFileSymbolInfo() 86 auto SegName = Obj.getSectionFinalSegmentName(Sec.getRawDataRefImpl()); in getMachOObjectFileSymbolInfo() 87 auto SecName = cantFail(Obj.getSectionName(Sec.getRawDataRefImpl())); in getMachOObjectFileSymbolInfo() 139 for (auto &Sec : Obj.sections()) { in getELFObjectFileSymbolInfo() local 140 if (auto SecName = Sec.getName()) { in getELFObjectFileSymbolInfo() 167 auto Sec = Obj.getSection(COFFSym.getSectionNumber()); in getCOFFObjectFileSymbolInfo() local 168 if (!Sec) in getCOFFObjectFileSymbolInfo() 169 return Sec.takeError(); in getCOFFObjectFileSymbolInfo() 170 if (((*Sec)->Characteristics & COFF::IMAGE_SCN_LNK_COMDAT) && in getCOFFObjectFileSymbolInfo() [all …]
|
| /openbsd-src/gnu/llvm/llvm/lib/ObjCopy/COFF/ |
| H A D | COFFObjcopy.cpp | 30 static bool isDebugSection(const Section &Sec) { in isDebugSection() argument 31 return Sec.Name.startswith(".debug"); in isDebugSection() 65 Section Sec; in addSection() local 66 Sec.setOwnedContents(Contents); in addSection() 67 Sec.Name = Name; in addSection() 68 Sec.Header.VirtualSize = NeedVA ? Sec.getContents().size() : 0u; in addSection() 69 Sec.Header.VirtualAddress = NeedVA ? getNextRVA(Obj) : 0u; in addSection() 70 Sec.Header.SizeOfRawData = in addSection() 71 NeedVA ? alignTo(Sec.Header.VirtualSize, in addSection() 73 : Sec.getContents().size(); in addSection() [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() 96 llvm::erase_if(Sections, [ToRemove, &RemovedSections](const Section &Sec) { in removeSections() argument 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() [all …]
|
| /openbsd-src/gnu/llvm/llvm/include/llvm/MC/ |
| H A D | MCFragment.h | 116 explicit MCDummyFragment(MCSection *Sec) : MCFragment(FT_Dummy, false, Sec) {} in MCDummyFragment() argument 132 MCSection *Sec) in MCEncodedFragment() argument 133 : MCFragment(FType, HasInstructions, Sec) {} in MCEncodedFragment() 192 MCSection *Sec) in MCEncodedFragmentWithContents() argument 193 : MCEncodedFragment(FType, HasInstructions, Sec) {} in MCEncodedFragmentWithContents() 213 MCSection *Sec) in MCEncodedFragmentWithFixups() argument 215 Sec) {} in MCEncodedFragmentWithFixups() 243 MCDataFragment(MCSection *Sec = nullptr) 244 : MCEncodedFragmentWithFixups<32, 4>(FT_Data, false, Sec) {} 258 MCCompactEncodedInstFragment(MCSection *Sec = nullptr) [all …]
|
| /openbsd-src/gnu/llvm/llvm/include/llvm/Object/ |
| H A D | ELFObjectFile.h | 71 virtual uint32_t getSectionType(DataRefImpl Sec) const = 0; 72 virtual uint64_t getSectionFlags(DataRefImpl Sec) const = 0; 73 virtual uint64_t getSectionOffset(DataRefImpl Sec) const = 0; 249 SectionRef toSectionRef(const Elf_Shdr *Sec) const { in LLVM_ELF_IMPORT_TYPES_ELFT() 250 return SectionRef(toDRI(Sec), this); in LLVM_ELF_IMPORT_TYPES_ELFT() 290 void moveSectionNext(DataRefImpl &Sec) const override; 291 Expected<StringRef> getSectionName(DataRefImpl Sec) const override; 292 uint64_t getSectionAddress(DataRefImpl Sec) const override; 293 uint64_t getSectionIndex(DataRefImpl Sec) const override; 294 uint64_t getSectionSize(DataRefImpl Sec) const override; [all …]
|
| H A D | ELF.h | 129 const typename ELFT::Shdr &Sec) { in getSecIndexForError() argument 132 return "[index " + std::to_string(&Sec - &TableOrErr->front()) + "]"; in getSecIndexForError() 143 const typename ELFT::Shdr &Sec) { in describe() argument 144 unsigned SecNdx = &Sec - &cantFail(Obj.sections()).front(); in describe() 146 Sec.sh_type) + in describe() 201 getVersionDefinitions(const Elf_Shdr &Sec) const; 203 const Elf_Shdr &Sec, 216 Expected<StringRef> getLinkAsStrtab(const typename ELFT::Shdr &Sec) const; 260 Expected<Elf_Sym_Range> symbols(const Elf_Shdr *Sec) const { in symbols() argument 261 if (!Sec) in symbols() [all …]
|
| /openbsd-src/gnu/llvm/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() 281 for (const std::unique_ptr<Section> &Sec : LC.Sections) { in dumpSectionToFile() local 282 if (Sec->CanonicalName == SecName) { in dumpSectionToFile() [all …]
|
| H A D | MachOWriter.cpp | 168 for (const std::unique_ptr<Section> &Sec : LC.Sections) in writeLoadCommands() local 169 writeSectionInLoadCommand<MachO::section>(*Sec, Begin); in writeLoadCommands() 178 for (const std::unique_ptr<Section> &Sec : LC.Sections) in writeLoadCommands() local 179 writeSectionInLoadCommand<MachO::section_64>(*Sec, Begin); in writeLoadCommands() 215 void MachOWriter::writeSectionInLoadCommand(const Section &Sec, uint8_t *&Out) { in writeSectionInLoadCommand() argument 217 assert(Sec.Segname.size() <= sizeof(Temp.segname) && "too long segment name"); in writeSectionInLoadCommand() 218 assert(Sec.Sectname.size() <= sizeof(Temp.sectname) && in writeSectionInLoadCommand() 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() [all …]
|
| /openbsd-src/gnu/llvm/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 …]
|
| /openbsd-src/gnu/llvm/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 | 53 const object::coff_section *Sec) { in getSectionSize() argument 57 return std::min(Sec->VirtualSize, Sec->SizeOfRawData); in getSectionSize() 58 return Sec->SizeOfRawData; in getSectionSize() 97 const object::coff_section *Sec, in getCOFFSectionName() argument 114 if (Expected<StringRef> SecNameOrErr = Obj.getSectionName(Sec)) in getCOFFSectionName() 129 Expected<const object::coff_section *> Sec = Obj.getSection(SecIndex); in graphifySections() local 130 if (!Sec) in graphifySections() 131 return Sec.takeError(); in graphifySections() 134 if (Expected<StringRef> SecNameOrErr = Obj.getSectionName(*Sec)) in graphifySections() 146 if ((*Sec)->Characteristics & COFF::IMAGE_SCN_MEM_EXECUTE) in graphifySections() [all …]
|
| /openbsd-src/gnu/llvm/llvm/tools/llvm-jitlink/ |
| H A D | llvm-jitlink-elf.cpp | 82 for (auto &Sec : G.sections()) { in registerELFGraphInfo() local 84 dbgs() << " Section \"" << Sec.getName() << "\": " in registerELFGraphInfo() 85 << (Sec.symbols().empty() ? "empty. skipping." : "processing...") in registerELFGraphInfo() 90 if (Sec.symbols().empty()) in registerELFGraphInfo() 93 if (FileInfo.SectionInfos.count(Sec.getName())) in registerELFGraphInfo() 95 Sec.getName() + "\" in \"" + FileName + in registerELFGraphInfo() 99 bool isGOTSection = isELFGOTSection(Sec); in registerELFGraphInfo() 100 bool isStubsSection = isELFStubsSection(Sec); in registerELFGraphInfo() 105 auto *FirstSym = *Sec.symbols().begin(); in registerELFGraphInfo() 107 for (auto *Sym : Sec.symbols()) { in registerELFGraphInfo() [all …]
|
| H A D | llvm-jitlink-coff.cpp | 80 for (auto &Sec : G.sections()) { in registerCOFFGraphInfo() local 82 dbgs() << " Section \"" << Sec.getName() << "\": " in registerCOFFGraphInfo() 83 << (Sec.symbols().empty() ? "empty. skipping." : "processing...") in registerCOFFGraphInfo() 88 if (Sec.symbols().empty()) in registerCOFFGraphInfo() 91 if (FileInfo.SectionInfos.count(Sec.getName())) in registerCOFFGraphInfo() 93 Sec.getName() + "\" in \"" + FileName + in registerCOFFGraphInfo() 97 bool isGOTSection = isCOFFGOTSection(Sec); in registerCOFFGraphInfo() 98 bool isStubsSection = isCOFFStubsSection(Sec); in registerCOFFGraphInfo() 103 auto *FirstSym = *Sec.symbols().begin(); in registerCOFFGraphInfo() 105 for (auto *Sym : Sec.symbols()) { in registerCOFFGraphInfo() [all …]
|
| H A D | llvm-jitlink-macho.cpp | 84 for (auto &Sec : G.sections()) { in registerMachOGraphInfo() local 86 dbgs() << " Section \"" << Sec.getName() << "\": " in registerMachOGraphInfo() 87 << (Sec.symbols().empty() ? "empty. skipping." : "processing...") in registerMachOGraphInfo() 92 if (Sec.symbols().empty()) in registerMachOGraphInfo() 95 if (FileInfo.SectionInfos.count(Sec.getName())) in registerMachOGraphInfo() 97 Sec.getName() + "\" in \"" + FileName + in registerMachOGraphInfo() 101 bool isGOTSection = isMachOGOTSection(Sec); in registerMachOGraphInfo() 102 bool isStubsSection = isMachOStubsSection(Sec); in registerMachOGraphInfo() 107 auto *FirstSym = *Sec.symbols().begin(); in registerMachOGraphInfo() 109 for (auto *Sym : Sec.symbols()) { in registerMachOGraphInfo() [all …]
|
| /openbsd-src/gnu/llvm/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() 43 const MCSection *Sec = F->getParent(); in isFragmentValid() local 44 const MCFragment *LastValid = LastValidFragment.lookup(Sec); in isFragmentValid() 47 assert(LastValid->getParent() == Sec); in isFragmentValid() 52 MCSection *Sec = F->getParent(); in canGetFragmentOffset() local [all …]
|
| /openbsd-src/gnu/llvm/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()
|
| /openbsd-src/gnu/llvm/llvm/lib/Object/ |
| H A D | XCOFFObjectFile.cpp | 361 void XCOFFObjectFile::moveSectionNext(DataRefImpl &Sec) const { in moveSectionNext() 362 const char *Ptr = reinterpret_cast<const char *>(Sec.p); in moveSectionNext() 363 Sec.p = reinterpret_cast<uintptr_t>(Ptr + getSectionHeaderSize()); in moveSectionNext() 366 Expected<StringRef> XCOFFObjectFile::getSectionName(DataRefImpl Sec) const { in getSectionName() 367 return generateXCOFFFixedNameStringRef(getSectionNameInternal(Sec)); in getSectionName() 370 uint64_t XCOFFObjectFile::getSectionAddress(DataRefImpl Sec) const { in getSectionAddress() 374 return toSection64(Sec)->VirtualAddress; in getSectionAddress() 376 return toSection32(Sec)->VirtualAddress; in getSectionAddress() 379 uint64_t XCOFFObjectFile::getSectionIndex(DataRefImpl Sec) const { in getSectionIndex() 383 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.isDebugSection(); }); in hasDebugInfo() argument 105 ObjectFile::getRelocatedSection(DataRefImpl Sec) const { in getRelocatedSection() [all …]
|
| /openbsd-src/gnu/llvm/llvm/lib/ObjectYAML/ |
| H A D | MachOEmitter.cpp | 108 SectionType constructSection(MachOYAML::Section Sec) { in constructSection() argument 110 memcpy(reinterpret_cast<void *>(&TempSec.sectname[0]), &Sec.sectname[0], 16); in constructSection() 111 memcpy(reinterpret_cast<void *>(&TempSec.segname[0]), &Sec.segname[0], 16); in constructSection() 112 TempSec.addr = Sec.addr; in constructSection() 113 TempSec.size = Sec.size; in constructSection() 114 TempSec.offset = Sec.offset; in constructSection() 115 TempSec.align = Sec.align; in constructSection() 116 TempSec.reloff = Sec.reloff; in constructSection() 117 TempSec.nreloc = Sec.nreloc; in constructSection() 118 TempSec.flags = Sec.flags; in constructSection() [all …]
|