| /netbsd-src/external/apache2/llvm/dist/llvm/tools/llvm-objcopy/ELF/ |
| H A D | ELFObjcopy.cpp | 54 using SectionPred = std::function<bool(const SectionBase &Sec)>; 56 static bool isDebugSection(const SectionBase &Sec) { in isDebugSection() argument 57 return StringRef(Sec.Name).startswith(".debug") || in isDebugSection() 58 StringRef(Sec.Name).startswith(".zdebug") || Sec.Name == ".gdb_index"; in isDebugSection() 61 static bool isDWOSection(const SectionBase &Sec) { in isDWOSection() argument 62 return StringRef(Sec.Name).endswith(".dwo"); in isDWOSection() 65 static bool onlyKeepDWOPred(const Object &Obj, const SectionBase &Sec) { in onlyKeepDWOPred() argument 67 if (&Sec == Obj.SectionNames) in onlyKeepDWOPred() 71 return !isDWOSection(Sec); in onlyKeepDWOPred() 103 static void setSectionFlagsAndType(SectionBase &Sec, SectionFlag Flags) { in setSectionFlagsAndType() argument [all …]
|
| H A D | Object.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 | Object.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 …]
|
| /netbsd-src/external/apache2/llvm/dist/llvm/tools/llvm-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 | Object.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 …]
|
| /netbsd-src/external/apache2/llvm/dist/llvm/tools/llvm-objcopy/MachO/ |
| H A D | MachOReader.cpp | 31 Section constructSectionCommon(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 | MachOWriter.cpp | 178 for (const std::unique_ptr<Section> &Sec : LC.Sections) in writeLoadCommands() local 179 writeSectionInLoadCommand<MachO::section>(*Sec, Begin); in writeLoadCommands() 188 for (const std::unique_ptr<Section> &Sec : LC.Sections) in writeLoadCommands() local 189 writeSectionInLoadCommand<MachO::section_64>(*Sec, Begin); in writeLoadCommands() 225 void MachOWriter::writeSectionInLoadCommand(const Section &Sec, uint8_t *&Out) { in writeSectionInLoadCommand() argument 227 assert(Sec.Segname.size() <= sizeof(Temp.segname) && "too long segment name"); in writeSectionInLoadCommand() 228 assert(Sec.Sectname.size() <= sizeof(Temp.sectname) && in writeSectionInLoadCommand() 231 memcpy(Temp.segname, Sec.Segname.data(), Sec.Segname.size()); in writeSectionInLoadCommand() 232 memcpy(Temp.sectname, Sec.Sectname.data(), Sec.Sectname.size()); in writeSectionInLoadCommand() 233 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->Size; in layoutSegments() 169 if (!Sec->hasValidOffset()) { in layoutSegments() [all …]
|
| H A D | MachOObjcopy.cpp | 29 using SectionPred = std::function<bool(const std::unique_ptr<Section> &Sec)>; 58 RemovePred = [&Config, RemovePred](const std::unique_ptr<Section> &Sec) { in removeSections() argument 59 return Config.ToRemove.matches(Sec->CanonicalName); in removeSections() 65 RemovePred = [RemovePred](const std::unique_ptr<Section> &Sec) { in removeSections() argument 66 if (Sec->Segname == "__DWARF") in removeSections() 69 return RemovePred(Sec); in removeSections() 75 RemovePred = [&Config](const std::unique_ptr<Section> &Sec) { in removeSections() argument 76 return !Config.OnlySection.matches(Sec->CanonicalName); in removeSections() 258 for (const std::unique_ptr<Section> &Sec : LC.Sections) { in dumpSectionToFile() local 259 if (Sec->CanonicalName == SecName) { in dumpSectionToFile() [all …]
|
| /netbsd-src/external/apache2/llvm/dist/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 194 : MCEncodedFragment(FType, HasInstructions, Sec) {} in MCEncodedFragmentWithContents() 214 MCSection *Sec) in MCEncodedFragmentWithFixups() argument 216 Sec) {} in MCEncodedFragmentWithFixups() 244 MCDataFragment(MCSection *Sec = nullptr) 245 : MCEncodedFragmentWithFixups<32, 4>(FT_Data, false, Sec) {} 259 MCCompactEncodedInstFragment(MCSection *Sec = nullptr) [all …]
|
| /netbsd-src/external/apache2/llvm/dist/llvm/include/llvm/Object/ |
| H A D | ELFObjectFile.h | 68 virtual uint32_t getSectionType(DataRefImpl Sec) const = 0; 69 virtual uint64_t getSectionFlags(DataRefImpl Sec) const = 0; 70 virtual uint64_t getSectionOffset(DataRefImpl Sec) const = 0; 236 SectionRef toSectionRef(const Elf_Shdr *Sec) const { in LLVM_ELF_IMPORT_TYPES_ELFT() 237 return SectionRef(toDRI(Sec), this); in LLVM_ELF_IMPORT_TYPES_ELFT() 277 void moveSectionNext(DataRefImpl &Sec) const override; 278 Expected<StringRef> getSectionName(DataRefImpl Sec) const override; 279 uint64_t getSectionAddress(DataRefImpl Sec) const override; 280 uint64_t getSectionIndex(DataRefImpl Sec) const override; 281 uint64_t getSectionSize(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() 202 getVersionDefinitions(const Elf_Shdr &Sec) const; 204 const Elf_Shdr &Sec, 217 Expected<StringRef> getLinkAsStrtab(const typename ELFT::Shdr &Sec) const; 261 Expected<Elf_Sym_Range> symbols(const Elf_Shdr *Sec) const { in symbols() argument 262 if (!Sec) in symbols() [all …]
|
| H A D | ObjectFile.h | 259 virtual void moveSectionNext(DataRefImpl &Sec) const = 0; 260 virtual Expected<StringRef> getSectionName(DataRefImpl Sec) const = 0; 261 virtual uint64_t getSectionAddress(DataRefImpl Sec) const = 0; 262 virtual uint64_t getSectionIndex(DataRefImpl Sec) const = 0; 263 virtual uint64_t getSectionSize(DataRefImpl Sec) const = 0; 265 getSectionContents(DataRefImpl Sec) const = 0; 266 virtual uint64_t getSectionAlignment(DataRefImpl Sec) const = 0; 267 virtual bool isSectionCompressed(DataRefImpl Sec) const = 0; 268 virtual bool isSectionText(DataRefImpl Sec) const = 0; 269 virtual bool isSectionData(DataRefImpl Sec) const = 0; [all …]
|
| /netbsd-src/external/apache2/llvm/dist/llvm/tools/llvm-readobj/ |
| H A D | XCOFFDumper.cpp | 40 template <typename T> void printGenericSectionHeader(T &Sec) const; 41 template <typename T> void printOverflowSectionHeader(T &Sec) const; 130 for (const auto &Sec : Sections) { in printRelocations() local 133 if (Sec.Flags != XCOFF::STYP_TEXT && Sec.Flags != XCOFF::STYP_DATA && in printRelocations() 134 Sec.Flags != XCOFF::STYP_TDATA && Sec.Flags != XCOFF::STYP_DWARF) in printRelocations() 136 auto Relocations = unwrapOrError(Obj.getFileName(), Obj.relocations(Sec)); in printRelocations() 140 W.startLine() << "Section (index: " << Index << ") " << Sec.getName() in printRelocations() 442 void XCOFFDumper::printOverflowSectionHeader(T &Sec) const { in printOverflowSectionHeader() 450 W.printString("Name", Sec.getName()); in printOverflowSectionHeader() 451 W.printNumber("NumberOfRelocations", Sec.PhysicalAddress); in printOverflowSectionHeader() [all …]
|
| H A D | ELFDumper.cpp | 221 std::string describe(const Elf_Shdr &Sec) const; 258 virtual void printVersionSymbolSection(const Elf_Shdr *Sec) = 0; 259 virtual void printVersionDefinitionSection(const Elf_Shdr *Sec) = 0; 260 virtual void printVersionDependencySection(const Elf_Shdr *Sec) = 0; 272 const Elf_Shdr &Sec, const Elf_Shdr *SymTab); 275 void printRelocationsHelper(const Elf_Shdr &Sec); 277 const Elf_Shdr &Sec, bool RawRelr, 295 getVersionTable(const Elf_Shdr &Sec, ArrayRef<Elf_Sym> *SymTab, 297 StringRef getPrintableSectionName(const Elf_Shdr &Sec) const; 386 std::string ELFDumper<ELFT>::describe(const Elf_Shdr &Sec) const { in describe() [all …]
|
| /netbsd-src/external/apache2/llvm/dist/llvm/lib/Object/ |
| H A D | XCOFFObjectFile.cpp | 238 void XCOFFObjectFile::moveSectionNext(DataRefImpl &Sec) const { in moveSectionNext() 239 const char *Ptr = reinterpret_cast<const char *>(Sec.p); in moveSectionNext() 240 Sec.p = reinterpret_cast<uintptr_t>(Ptr + getSectionHeaderSize()); in moveSectionNext() 243 Expected<StringRef> XCOFFObjectFile::getSectionName(DataRefImpl Sec) const { in getSectionName() 244 return generateXCOFFFixedNameStringRef(getSectionNameInternal(Sec)); in getSectionName() 247 uint64_t XCOFFObjectFile::getSectionAddress(DataRefImpl Sec) const { in getSectionAddress() 251 return toSection64(Sec)->VirtualAddress; in getSectionAddress() 253 return toSection32(Sec)->VirtualAddress; in getSectionAddress() 256 uint64_t XCOFFObjectFile::getSectionIndex(DataRefImpl Sec) const { in getSectionIndex() 260 return toSection64(Sec) - sectionHeaderTable64() + 1; in getSectionIndex() [all …]
|
| H A D | COFFObjectFile.cpp | 251 Expected<const coff_section *> Sec = getSection(Symb.getSectionNumber()); in getSymbolSection() local 252 if (!Sec) in getSymbolSection() 253 return Sec.takeError(); in getSymbolSection() 255 Ret.p = reinterpret_cast<uintptr_t>(*Sec); in getSymbolSection() 265 const coff_section *Sec = toSec(Ref); in moveSectionNext() local 266 Sec += 1; in moveSectionNext() 267 Ref.p = reinterpret_cast<uintptr_t>(Sec); in moveSectionNext() 271 const coff_section *Sec = toSec(Ref); in getSectionName() local 272 return getSectionName(Sec); in getSectionName() 276 const coff_section *Sec = toSec(Ref); in getSectionAddress() local [all …]
|
| /netbsd-src/external/apache2/llvm/dist/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()
|
| /netbsd-src/external/apache2/llvm/dist/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 << (llvm::empty(Sec.symbols()) ? "empty. skipping." in registerELFGraphInfo() 91 if (llvm::empty(Sec.symbols())) in registerELFGraphInfo() 94 if (FileInfo.SectionInfos.count(Sec.getName())) in registerELFGraphInfo() 96 Sec.getName() + "\" in \"" + FileName + in registerELFGraphInfo() 100 bool isGOTSection = isELFGOTSection(Sec); in registerELFGraphInfo() 101 bool isStubsSection = isELFStubsSection(Sec); in registerELFGraphInfo() 106 auto *FirstSym = *Sec.symbols().begin(); in registerELFGraphInfo() 108 for (auto *Sym : Sec.symbols()) { in registerELFGraphInfo() [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 << (llvm::empty(Sec.symbols()) ? "empty. skipping." in registerMachOGraphInfo() 93 if (llvm::empty(Sec.symbols())) in registerMachOGraphInfo() 96 if (FileInfo.SectionInfos.count(Sec.getName())) in registerMachOGraphInfo() 98 Sec.getName() + "\" in \"" + FileName + in registerMachOGraphInfo() 102 bool isGOTSection = isMachOGOTSection(Sec); in registerMachOGraphInfo() 103 bool isStubsSection = isMachOStubsSection(Sec); in registerMachOGraphInfo() 108 auto *FirstSym = *Sec.symbols().begin(); in registerMachOGraphInfo() 110 for (auto *Sym : Sec.symbols()) { in registerMachOGraphInfo() [all …]
|
| /netbsd-src/external/apache2/llvm/dist/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 …]
|
| H A D | WinCOFFObjectWriter.cpp | 177 void defineSection(MCSectionCOFF const &Sec); 198 const COFFSection &Sec, const MCSection &MCSec); 266 static uint32_t getAlignment(const MCSectionCOFF &Sec) { in getAlignment() argument 267 switch (Sec.getAlignment()) { in getAlignment() 369 COFFSection *Sec = nullptr; in DefineSymbol() local 371 Sec = SectionMap[Base->getFragment()->getParent()]; in DefineSymbol() 372 if (Sym->Section && Sym->Section != Sec) in DefineSymbol() 385 if (!Sec) in DefineSymbol() 388 WeakDefault->Section = Sec; in DefineSymbol() 406 Sym->Section = Sec; in DefineSymbol() [all …]
|
| /netbsd-src/external/apache2/llvm/dist/llvm/lib/ObjectYAML/ |
| H A D | MachOEmitter.cpp | 102 SectionType constructSection(MachOYAML::Section Sec) { in constructSection() argument 104 memcpy(reinterpret_cast<void *>(&TempSec.sectname[0]), &Sec.sectname[0], 16); in constructSection() 105 memcpy(reinterpret_cast<void *>(&TempSec.segname[0]), &Sec.segname[0], 16); in constructSection() 106 TempSec.addr = Sec.addr; in constructSection() 107 TempSec.size = Sec.size; in constructSection() 108 TempSec.offset = Sec.offset; in constructSection() 109 TempSec.align = Sec.align; in constructSection() 110 TempSec.reloff = Sec.reloff; in constructSection() 111 TempSec.nreloc = Sec.nreloc; in constructSection() 112 TempSec.flags = Sec.flags; in constructSection() [all …]
|
| /netbsd-src/external/apache2/llvm/dist/llvm/tools/llvm-objcopy/wasm/ |
| H A D | WasmObjcopy.cpp | 25 for (const Section &Sec : Obj.Sections) { in dumpSectionToFile() local 26 if (Sec.Name == SecName) { in dumpSectionToFile() 27 ArrayRef<uint8_t> Contents = Sec.Contents; in dumpSectionToFile() 52 Obj.removeSections([&Config](const Section &Sec) { in handleArgs() argument 53 if (Config.ToRemove.matches(Sec.Name)) in handleArgs() 65 Section Sec; in handleArgs() local 66 Sec.SectionType = llvm::wasm::WASM_SEC_CUSTOM; in handleArgs() 67 Sec.Name = SecName; in handleArgs() 69 Sec.Contents = makeArrayRef<uint8_t>( in handleArgs() 72 Obj.addSectionWithOwnedContents(Sec, std::move(Buf)); in handleArgs()
|
| /netbsd-src/external/apache2/llvm/dist/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()
|