/external/llvm-project/llvm/tools/llvm-objcopy/ELF/ |
D | ELFObjcopy.cpp | 53 using SectionPred = std::function<bool(const SectionBase &Sec)>; 55 static bool isDebugSection(const SectionBase &Sec) { in isDebugSection() argument 56 return StringRef(Sec.Name).startswith(".debug") || in isDebugSection() 57 StringRef(Sec.Name).startswith(".zdebug") || Sec.Name == ".gdb_index"; in isDebugSection() 60 static bool isDWOSection(const SectionBase &Sec) { in isDWOSection() argument 61 return StringRef(Sec.Name).endswith(".dwo"); in isDWOSection() 64 static bool onlyKeepDWOPred(const Object &Obj, const SectionBase &Sec) { in onlyKeepDWOPred() argument 66 if (&Sec == Obj.SectionNames) in onlyKeepDWOPred() 70 return !isDWOSection(Sec); in onlyKeepDWOPred() 102 static void setSectionFlagsAndType(SectionBase &Sec, SectionFlag Flags) { in setSectionFlagsAndType() argument [all …]
|
D | Object.cpp | 69 template <class ELFT> void ELFWriter<ELFT>::writeShdr(const SectionBase &Sec) { in writeShdr() argument 70 uint8_t *B = Buf.getBufferStart() + Sec.HeaderOffset; in writeShdr() 72 Shdr.sh_name = Sec.NameIndex; in writeShdr() 73 Shdr.sh_type = Sec.Type; in writeShdr() 74 Shdr.sh_flags = Sec.Flags; in writeShdr() 75 Shdr.sh_addr = Sec.Addr; in writeShdr() 76 Shdr.sh_offset = Sec.Offset; in writeShdr() 77 Shdr.sh_size = Sec.Size; in writeShdr() 78 Shdr.sh_link = Sec.Link; in writeShdr() 79 Shdr.sh_info = Sec.Info; in writeShdr() [all …]
|
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 …]
|
/external/llvm-project/llvm/tools/llvm-objcopy/COFF/ |
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 …]
|
D | Object.cpp | 62 for (const Section &Sec : Sections) { in markSymbols() local 63 for (const Relocation &R : Sec.Relocs) { in markSymbols() 100 auto RemoveAssociated = [&AssociatedSections](const Section &Sec) { in removeSections() argument 101 return AssociatedSections.count(Sec.UniqueId) == 1; in removeSections() 107 [ToRemove, &RemovedSections](const Section &Sec) { in removeSections() argument 108 bool Remove = ToRemove(Sec); in removeSections() 110 RemovedSections.insert(Sec.UniqueId); in removeSections() 137 for (Section &Sec : Sections) { in truncateSections() 138 if (ToTruncate(Sec)) { in truncateSections() 139 Sec.clearContents(); in truncateSections() [all …]
|
/external/llvm-project/llvm/tools/llvm-objcopy/MachO/ |
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 …]
|
D | MachOWriter.cpp | 177 for (const std::unique_ptr<Section> &Sec : LC.Sections) in writeLoadCommands() local 178 writeSectionInLoadCommand<MachO::section>(*Sec, Begin); in writeLoadCommands() 187 for (const std::unique_ptr<Section> &Sec : LC.Sections) in writeLoadCommands() local 188 writeSectionInLoadCommand<MachO::section_64>(*Sec, Begin); in writeLoadCommands() 224 void MachOWriter::writeSectionInLoadCommand(const Section &Sec, uint8_t *&Out) { in writeSectionInLoadCommand() argument 226 assert(Sec.Segname.size() <= sizeof(Temp.segname) && "too long segment name"); in writeSectionInLoadCommand() 227 assert(Sec.Sectname.size() <= sizeof(Temp.sectname) && in writeSectionInLoadCommand() 230 memcpy(Temp.segname, Sec.Segname.data(), Sec.Segname.size()); in writeSectionInLoadCommand() 231 memcpy(Temp.sectname, Sec.Sectname.data(), Sec.Sectname.size()); in writeSectionInLoadCommand() 232 Temp.addr = Sec.Addr; in writeSectionInLoadCommand() [all …]
|
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 …]
|
/external/llvm-project/llvm/include/llvm/Object/ |
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; 245 SectionRef toSectionRef(const Elf_Shdr *Sec) const { in toSectionRef() argument 246 return SectionRef(toDRI(Sec), this); in toSectionRef() 286 void moveSectionNext(DataRefImpl &Sec) const override; 287 Expected<StringRef> getSectionName(DataRefImpl Sec) const override; 288 uint64_t getSectionAddress(DataRefImpl Sec) const override; 289 uint64_t getSectionIndex(DataRefImpl Sec) const override; 290 uint64_t getSectionSize(DataRefImpl Sec) const override; [all …]
|
/external/llvm/include/llvm/MC/ |
D | MCFragment.h | 137 explicit MCDummyFragment(MCSection *Sec) 138 : MCFragment(FT_Dummy, false, 0, Sec){}; 148 MCSection *Sec) 149 : MCFragment(FType, HasInstructions, 0, Sec) {} 175 MCSection *Sec) 176 : MCEncodedFragment(FType, HasInstructions, Sec) {} 196 MCSection *Sec) 198 Sec) {} 224 MCDataFragment(MCSection *Sec = nullptr) 225 : MCEncodedFragmentWithFixups<32, 4>(FT_Data, false, Sec) {} [all …]
|
/external/swiftshader/third_party/llvm-10.0/llvm/include/llvm/MC/ |
D | MCFragment.h | 105 explicit MCDummyFragment(MCSection *Sec) : MCFragment(FT_Dummy, false, Sec) {} in MCDummyFragment() argument 121 MCSection *Sec) in MCEncodedFragment() argument 122 : MCFragment(FType, HasInstructions, Sec) {} in MCEncodedFragment() 180 MCSection *Sec) in MCEncodedFragmentWithContents() argument 181 : MCEncodedFragment(FType, HasInstructions, Sec) {} in MCEncodedFragmentWithContents() 201 MCSection *Sec) in MCEncodedFragmentWithFixups() argument 203 Sec) {} in MCEncodedFragmentWithFixups() 231 MCDataFragment(MCSection *Sec = nullptr) 232 : MCEncodedFragmentWithFixups<32, 4>(FT_Data, false, Sec) {} 246 MCCompactEncodedInstFragment(MCSection *Sec = nullptr) [all …]
|
/external/llvm-project/llvm/include/llvm/MC/ |
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() 191 MCSection *Sec) in MCEncodedFragmentWithContents() argument 192 : MCEncodedFragment(FType, HasInstructions, Sec) {} in MCEncodedFragmentWithContents() 212 MCSection *Sec) in MCEncodedFragmentWithFixups() argument 214 Sec) {} in MCEncodedFragmentWithFixups() 242 MCDataFragment(MCSection *Sec = nullptr) 243 : MCEncodedFragmentWithFixups<32, 4>(FT_Data, false, Sec) {} 257 MCCompactEncodedInstFragment(MCSection *Sec = nullptr) [all …]
|
/external/swiftshader/third_party/llvm-10.0/llvm/include/llvm/Object/ |
D | ELFObjectFile.h | 62 virtual uint32_t getSectionType(DataRefImpl Sec) const = 0; 63 virtual uint64_t getSectionFlags(DataRefImpl Sec) const = 0; 64 virtual uint64_t getSectionOffset(DataRefImpl Sec) const = 0; 242 SectionRef toSectionRef(const Elf_Shdr *Sec) const { in toSectionRef() argument 243 return SectionRef(toDRI(Sec), this); in toSectionRef() 273 void moveSectionNext(DataRefImpl &Sec) const override; 274 Expected<StringRef> getSectionName(DataRefImpl Sec) const override; 275 uint64_t getSectionAddress(DataRefImpl Sec) const override; 276 uint64_t getSectionIndex(DataRefImpl Sec) const override; 277 uint64_t getSectionSize(DataRefImpl Sec) const override; [all …]
|
/external/swiftshader/third_party/llvm-10.0/llvm/lib/Object/ |
D | XCOFFObjectFile.cpp | 230 void XCOFFObjectFile::moveSectionNext(DataRefImpl &Sec) const { in moveSectionNext() 231 const char *Ptr = reinterpret_cast<const char *>(Sec.p); in moveSectionNext() 232 Sec.p = reinterpret_cast<uintptr_t>(Ptr + getSectionHeaderSize()); in moveSectionNext() 235 Expected<StringRef> XCOFFObjectFile::getSectionName(DataRefImpl Sec) const { in getSectionName() 236 return generateXCOFFFixedNameStringRef(getSectionNameInternal(Sec)); in getSectionName() 239 uint64_t XCOFFObjectFile::getSectionAddress(DataRefImpl Sec) const { in getSectionAddress() 243 return toSection64(Sec)->VirtualAddress; in getSectionAddress() 245 return toSection32(Sec)->VirtualAddress; in getSectionAddress() 248 uint64_t XCOFFObjectFile::getSectionIndex(DataRefImpl Sec) const { in getSectionIndex() 252 return toSection64(Sec) - sectionHeaderTable64() + 1; in getSectionIndex() [all …]
|
/external/llvm/include/llvm/Object/ |
D | ELFObjectFile.h | 60 virtual uint32_t getSectionType(DataRefImpl Sec) const = 0; 61 virtual uint64_t getSectionFlags(DataRefImpl Sec) const = 0; 222 void moveSectionNext(DataRefImpl &Sec) const override; 223 std::error_code getSectionName(DataRefImpl Sec, 225 uint64_t getSectionAddress(DataRefImpl Sec) const override; 226 uint64_t getSectionSize(DataRefImpl Sec) const override; 227 std::error_code getSectionContents(DataRefImpl Sec, 229 uint64_t getSectionAlignment(DataRefImpl Sec) const override; 230 bool isSectionCompressed(DataRefImpl Sec) const override; 231 bool isSectionText(DataRefImpl Sec) const override; [all …]
|
D | ELF.h | 114 const Elf_Sym *symbol_begin(const Elf_Shdr *Sec) const { in symbol_begin() argument 115 if (!Sec) in symbol_begin() 117 if (Sec->sh_entsize != sizeof(Elf_Sym)) in symbol_begin() 119 return reinterpret_cast<const Elf_Sym *>(base() + Sec->sh_offset); in symbol_begin() 121 const Elf_Sym *symbol_end(const Elf_Shdr *Sec) const { in symbol_end() argument 122 if (!Sec) in symbol_end() 124 uint64_t Size = Sec->sh_size; in symbol_end() 127 return symbol_begin(Sec) + Size / sizeof(Elf_Sym); in symbol_end() 129 Elf_Sym_Range symbols(const Elf_Shdr *Sec) const { in symbols() argument 130 return makeArrayRef(symbol_begin(Sec), symbol_end(Sec)); in symbols() [all …]
|
/external/llvm-project/llvm/tools/llvm-readobj/ |
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() 443 void XCOFFDumper::printOverflowSectionHeader(T &Sec) const { in printOverflowSectionHeader() 451 W.printString("Name", Sec.getName()); in printOverflowSectionHeader() 452 W.printNumber("NumberOfRelocations", Sec.PhysicalAddress); in printOverflowSectionHeader() [all …]
|
/external/llvm-project/llvm/lib/Object/ |
D | XCOFFObjectFile.cpp | 237 void XCOFFObjectFile::moveSectionNext(DataRefImpl &Sec) const { in moveSectionNext() 238 const char *Ptr = reinterpret_cast<const char *>(Sec.p); in moveSectionNext() 239 Sec.p = reinterpret_cast<uintptr_t>(Ptr + getSectionHeaderSize()); in moveSectionNext() 242 Expected<StringRef> XCOFFObjectFile::getSectionName(DataRefImpl Sec) const { in getSectionName() 243 return generateXCOFFFixedNameStringRef(getSectionNameInternal(Sec)); in getSectionName() 246 uint64_t XCOFFObjectFile::getSectionAddress(DataRefImpl Sec) const { in getSectionAddress() 250 return toSection64(Sec)->VirtualAddress; in getSectionAddress() 252 return toSection32(Sec)->VirtualAddress; in getSectionAddress() 255 uint64_t XCOFFObjectFile::getSectionIndex(DataRefImpl Sec) const { in getSectionIndex() 259 return toSection64(Sec) - sectionHeaderTable64() + 1; in getSectionIndex() [all …]
|
/external/llvm-project/llvm/tools/llvm-jitlink/ |
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 …]
|
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 …]
|
/external/swiftshader/third_party/llvm-10.0/llvm/lib/ObjectYAML/ |
D | MachOEmitter.cpp | 91 SectionType constructSection(MachOYAML::Section Sec) { in constructSection() argument 93 memcpy(reinterpret_cast<void *>(&TempSec.sectname[0]), &Sec.sectname[0], 16); in constructSection() 94 memcpy(reinterpret_cast<void *>(&TempSec.segname[0]), &Sec.segname[0], 16); in constructSection() 95 TempSec.addr = Sec.addr; in constructSection() 96 TempSec.size = Sec.size; in constructSection() 97 TempSec.offset = Sec.offset; in constructSection() 98 TempSec.align = Sec.align; in constructSection() 99 TempSec.reloff = Sec.reloff; in constructSection() 100 TempSec.nreloc = Sec.nreloc; in constructSection() 101 TempSec.flags = Sec.flags; in constructSection() [all …]
|
/external/llvm-project/llvm/lib/MC/ |
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 …]
|
/external/llvm/lib/Target/Mips/MCTargetDesc/ |
D | MipsOptionRecord.cpp | 31 MCSectionELF *Sec = in EmitMipsOptionRecord() local 34 MCA.registerSection(*Sec); in EmitMipsOptionRecord() 35 Sec->setAlignment(8); in EmitMipsOptionRecord() 36 Streamer->SwitchSection(Sec); in EmitMipsOptionRecord() 50 MCSectionELF *Sec = Context.getELFSection(".reginfo", ELF::SHT_MIPS_REGINFO, in EmitMipsOptionRecord() local 52 MCA.registerSection(*Sec); in EmitMipsOptionRecord() 53 Sec->setAlignment(MTS->getABI().IsN32() ? 8 : 4); in EmitMipsOptionRecord() 54 Streamer->SwitchSection(Sec); in EmitMipsOptionRecord()
|
/external/swiftshader/third_party/llvm-10.0/llvm/lib/Target/Mips/MCTargetDesc/ |
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()
|
/external/llvm-project/llvm/lib/Target/Mips/MCTargetDesc/ |
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()
|