| /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"); 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 in isCommentSection() 42 for (const Section &Sec : Obj.Sections) { dumpSectionToFile() local 65 __anon88e350ca0202(const Section &Sec) removeSections() argument 71 __anon88e350ca0302(const Section &Sec) removeSections() argument 77 __anon88e350ca0402(const Section &Sec) removeSections() argument 84 __anon88e350ca0502(const Section &Sec) removeSections() argument 92 __anon88e350ca0602(const Section &Sec) removeSections() argument 100 __anon88e350ca0702(const Section &Sec) removeSections() argument 125 Section Sec; handleArgs() local [all...] |
| /freebsd/contrib/llvm-project/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).starts_with(".debug") || Sec.Name == ".gdb_index"; in isDebugSection() 58 static bool isDWOSection(const SectionBase &Sec) { in isDWOSection() argument 59 return StringRef(Sec.Name).ends_with(".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() 110 static void setSectionType(SectionBase &Sec, uint64_t Type) { in setSectionType() argument 113 if (Sec.Type == ELF::SHT_NOBITS && Type != ELF::SHT_NOBITS) in setSectionType() [all …]
|
| H A D | ELFObject.cpp | 69 template <class ELFT> void ELFWriter<ELFT>::writeShdr(const SectionBase &Sec) { in writeShdr() argument 71 reinterpret_cast<uint8_t *>(Buf->getBufferStart()) + Sec.HeaderOffset; in writeShdr() 73 Shdr.sh_name = Sec.NameIndex; in writeShdr() 74 Shdr.sh_type = Sec.Type; in writeShdr() 75 Shdr.sh_flags = Sec.Flags; in writeShdr() 76 Shdr.sh_addr = Sec.Addr; in writeShdr() 77 Shdr.sh_offset = Sec.Offset; in writeShdr() 78 Shdr.sh_size = Sec.Size; in writeShdr() 79 Shdr.sh_link = Sec.Link; in writeShdr() 80 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 …]
|
| /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 | 72 bool isSectionNoLoad(DataRefImpl Sec) const; 73 bool isSectionReadOnlyData(DataRefImpl Sec) const; 74 bool isSectionZeroInit(DataRefImpl Sec) const; 92 void moveSectionNext(DataRefImpl &Sec) const override; 93 virtual Expected<StringRef> getSectionName(DataRefImpl Sec) const override; 94 uint64_t getSectionAddress(DataRefImpl Sec) const override; 95 uint64_t getSectionSize(DataRefImpl Sec) const override; 97 getSectionContents(DataRefImpl Sec) const override; 98 uint64_t getSectionIndex(DataRefImpl Sec) const override { return Sec.d.a; } in getSectionIndex() argument 99 uint64_t getSectionAlignment(DataRefImpl Sec) const override; [all …]
|
| H A D | ELF.h | 131 const typename ELFT::Shdr &Sec) { in getSecIndexForError() argument 134 return "[index " + std::to_string(&Sec - &TableOrErr->front()) + "]"; in getSecIndexForError() 145 const typename ELFT::Shdr &Sec) { in describe() argument 146 unsigned SecNdx = &Sec - &cantFail(Obj.sections()).front(); in describe() 148 Sec.sh_type) + in describe() 170 const typename ELFT::Shdr &Sec) { in checkSectionOffsets() argument 172 if (Sec.sh_type == ELF::SHT_NOBITS) in checkSectionOffsets() 175 if (Sec.sh_offset < Phdr.p_offset) in checkSectionOffsets() 179 if (Sec.sh_size == 0) in checkSectionOffsets() 180 return (Sec.sh_offset + 1 <= Phdr.p_offset + Phdr.p_filesz); in checkSectionOffsets() [all …]
|
| H A D | ELFObjectFile.h | 79 virtual uint32_t getSectionType(DataRefImpl Sec) const = 0; 80 virtual uint64_t getSectionFlags(DataRefImpl Sec) const = 0; 81 virtual uint64_t getSectionOffset(DataRefImpl Sec) const = 0; 127 StringRef getCrelDecodeProblem(SectionRef Sec) const; 274 SectionRef toSectionRef(const Elf_Shdr *Sec) const { in LLVM_ELF_IMPORT_TYPES_ELFT() 275 return SectionRef(toDRI(Sec), this); in LLVM_ELF_IMPORT_TYPES_ELFT() 319 void moveSectionNext(DataRefImpl &Sec) const override; 320 Expected<StringRef> getSectionName(DataRefImpl Sec) const override; 321 uint64_t getSectionAddress(DataRefImpl Sec) const override; 322 uint64_t getSectionIndex(DataRefImpl Sec) const override; [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() 119 if (auto *Sec = in identifyELFSectionStartAndEndSymbols() local 121 return {*Sec, true}; in identifyELFSectionStartAndEndSymbols() [all …]
|
| H A D | COFFLinkGraphBuilder.cpp | 53 const object::coff_section *Sec) { in getSectionSize() 57 return std::min(Sec->VirtualSize, Sec->SizeOfRawData); in getSectionSize() 58 return Sec->SizeOfRawData; in getSectionSize() 97 const object::coff_section *Sec, in getCOFFSectionName() 114 if (Expected<StringRef> SecNameOrErr = Obj.getSectionName(Sec)) in getCOFFSectionName() 129 Expected<const object::coff_section *> Sec = Obj.getSection(SecIndex); in graphifySections() 130 if (!Sec) in graphifySections() 131 return Sec.takeError(); in graphifySections() 134 if (Expected<StringRef> SecNameOrErr = Obj.getSectionName(*Sec)) in graphifySections() 52 getSectionSize(const object::COFFObjectFile & Obj,const object::coff_section * Sec) getSectionSize() argument 96 getCOFFSectionName(COFFSectionIndex SectionIndex,const object::coff_section * Sec,object::COFFSymbolRef Sym) getCOFFSectionName() argument 128 Expected<const object::coff_section *> Sec = Obj.getSection(SecIndex); graphifySections() local 218 const object::coff_section *Sec = nullptr; graphifySymbols() local [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 in addSection() 166 __anon139cc0b60102(const Section &Sec) handleArgs() argument 188 __anon139cc0b60202(const Section &Sec) handleArgs() argument 279 __anon139cc0b60402(auto &Sec) handleArgs() argument [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 …]
|
| /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 | 371 void XCOFFObjectFile::moveSectionNext(DataRefImpl &Sec) const { in moveSectionNext() 372 const char *Ptr = reinterpret_cast<const char *>(Sec.p); in moveSectionNext() 373 Sec.p = reinterpret_cast<uintptr_t>(Ptr + getSectionHeaderSize()); in moveSectionNext() 376 Expected<StringRef> XCOFFObjectFile::getSectionName(DataRefImpl Sec) const { in getSectionName() 377 return generateXCOFFFixedNameStringRef(getSectionNameInternal(Sec)); in getSectionName() 380 uint64_t XCOFFObjectFile::getSectionAddress(DataRefImpl Sec) const { in getSectionAddress() 384 return toSection64(Sec)->VirtualAddress; in getSectionAddress() 386 return toSection32(Sec)->VirtualAddress; in getSectionAddress() 389 uint64_t XCOFFObjectFile::getSectionIndex(DataRefImpl Sec) const { in getSectionIndex() 393 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/ObjCopy/MachO/ |
| H A D | MachOReader.cpp | 32 static Section constructSectionCommon(const SectionType &Sec, uint32_t Index) { in constructSectionCommon() 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() 39 S.OriginalOffset = Sec in constructSectionCommon() 31 constructSectionCommon(const SectionType & Sec,uint32_t Index) constructSectionCommon() argument 49 constructSection(const MachO::section & Sec,uint32_t Index) constructSection() argument 53 constructSection(const MachO::section_64 & Sec,uint32_t Index) constructSection() argument 69 SectionType Sec; extractSections() local 350 for (const std::unique_ptr<Section> &Sec : LC.Sections) readSwiftVersion() local [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() 292 for (const std::unique_ptr<Section> &Sec : LC.Sections) { in dumpSectionToFile() 293 if (Sec in dumpSectionToFile() 284 for (const std::unique_ptr<Section> &Sec : LC.Sections) { dumpSectionToFile() local 306 Section Sec(TargetSegName, Pair.second); addSection() local 345 __anonb641b5aa0902(const std::unique_ptr<Section> &Sec) findSection() argument 362 Section &Sec = *SecToUpdateOrErr; updateSection() local [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 …]
|
| H A D | MachOLayoutBuilder.cpp | 154 for (std::unique_ptr<Section> &Sec : LC.Sections) { in layoutSegments() 155 assert(SegmentVmAddr <= Sec->Addr && in layoutSegments() 157 uint32_t SectOffset = Sec->Addr - SegmentVmAddr; in layoutSegments() 159 if (!Sec->hasValidOffset()) { in layoutSegments() 160 Sec->Offset = 0; in layoutSegments() 163 offsetToAlignment(SegFileSize, Align(1ull << Sec->Align)); in layoutSegments() 164 Sec->Offset = SegOffset + SegFileSize + PaddingSize; in layoutSegments() 165 Sec->Size = Sec->Content.size(); in layoutSegments() 166 SegFileSize += PaddingSize + Sec in layoutSegments() [all...] |
| /freebsd/contrib/llvm-project/llvm/include/llvm/ExecutionEngine/Orc/ |
| H A D | MachOBuilder.h | 290 for (auto &Sec : Sections) 291 Offset = writeMachOStruct(Buf, Offset, Sec->rawStruct(), SwapStruct); 366 for (auto &Sec : Seg.Sections) { 367 Offset = alignTo(Offset, 1ULL << Sec->align); 368 if (Sec->Content.Size) 369 Sec->offset = Offset; 370 Sec->size = Sec->Content.Size; 371 Sec->addr = SegVMAddr + Sec->offset - Seg.fileoff; 372 Offset += Sec->Content.Size; 391 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 = 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/MC/ |
| H A D | WinCOFFObjectWriter.cpp | 173 void defineSection(const MCAssembler &Asm, MCSectionCOFF const &Sec); 190 void writeSection(MCAssembler &Asm, const COFFSection &Sec); 212 static bool isDwoSection(const MCSection &Sec) { in isDwoSection() argument 213 return Sec.getName().ends_with(".dwo"); in isDwoSection() 258 static uint32_t getAlignment(const MCSectionCOFF &Sec) { in getAlignment() argument 259 switch (Sec.getAlign().value()) { in getAlignment() 374 COFFSection *Sec = nullptr; in defineSymbol() local 378 Sec = SectionMap[MCSec]; in defineSymbol() 394 if (!Sec) in defineSymbol() 397 WeakDefault->Section = Sec; in defineSymbol() [all …]
|
| H A D | MachObjectWriter.cpp | 134 const MCSection *Sec) const { in getPaddingSize() 135 uint64_t EndAddr = getSectionAddress(Sec) + Asm.getSectionAddressSize(*Sec); in getPaddingSize() 136 unsigned Next = cast<MCSectionMachO>(Sec)->getLayoutOrder() + 1; in getPaddingSize() 258 const MCSection &Sec, uint64_t VMAddr, in writeSection() argument 262 uint64_t SectionSize = Asm.getSectionAddressSize(Sec); in writeSection() 263 const MCSectionMachO &Section = cast<MCSectionMachO>(Sec); in writeSection() 267 assert(Asm.getSectionFileSize(Sec) == 0 && "Invalid file size!"); in writeSection() 295 W.write<uint32_t>(IndirectSymBase.lookup(&Sec)); // reserved1 in writeSection() 584 for (MCSection &Sec : Asm) in computeSymbolTable() 585 SectionIndexMap[&Sec] = Index++; in computeSymbolTable() [all …]
|
| /freebsd/contrib/llvm-project/llvm/lib/ObjectYAML/ |
| H A D | MachOEmitter.cpp | 109 SectionType constructSection(const MachOYAML::Section &Sec) { in constructSection() 111 memcpy(reinterpret_cast<void *>(&TempSec.sectname[0]), &Sec.sectname[0], 16); in constructSection() 112 memcpy(reinterpret_cast<void *>(&TempSec.segname[0]), &Sec.segname[0], 16); in constructSection() 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() 118 TempSec.nreloc = Sec.nreloc; in constructSection() 119 TempSec.flags = Sec in constructSection() 108 constructSection(const MachOYAML::Section & Sec) constructSection() argument 135 for (const auto &Sec : LC.Sections) { writeLoadCommandData() local 150 for (const auto &Sec : LC.Sections) { writeLoadCommandData() local 312 for (auto &Sec : LC.Sections) { writeSectionData() local 408 for (const MachOYAML::Section &Sec : LC.Sections) { writeRelocations() local [all...] |
| /freebsd/contrib/llvm-project/llvm/tools/llvm-objdump/ |
| H A D | ELFDump.cpp | 41 void printSymbolVersionDependency(const typename ELFT::Shdr &Sec); 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() 180 const object::ELFSectionRef &Sec) { in getSectionLMA() argument 190 Phdr, *cast<const ELFObjectFile<ELFT>>(Sec.getObject()) in getSectionLMA() 191 ->getSection(Sec.getRawDataRefImpl())))) in getSectionLMA() 192 return Sec.getAddress() - Phdr.p_vaddr + Phdr.p_paddr; in getSectionLMA() 195 return Sec.getAddress(); in getSectionLMA() 198 uint64_t objdump::getELFSectionLMA(const object::ELFSectionRef &Sec) { in getELFSectionLMA() argument [all …]
|