| /freebsd-13.1/contrib/llvm-project/llvm/tools/llvm-objcopy/ELF/ |
| H A D | ELFObjcopy.cpp | 104 Sec.Flags = getSectionFlagsPreserveMask(Sec.Flags, getNewShfFlags(Flags)); in setSectionFlagsAndType() 190 std::copy(Sec.OriginalData.begin(), Sec.OriginalData.end(), in dumpSectionToFile() 235 return ShouldReplace(Sec) || RemovePred(Sec); in replaceDebugSections() 354 return isDWOSection(Sec) || RemovePred(Sec); in replaceAndRemoveSections() 359 return onlyKeepDWOPred(Obj, Sec) || RemovePred(Sec); in replaceAndRemoveSections() 382 return RemovePred(Sec) || Sec.ParentSegment == nullptr; in replaceAndRemoveSections() 388 return RemovePred(Sec) || isDebugSection(Sec); in replaceAndRemoveSections() 426 return (Sec.Flags & SHF_ALLOC) != 0 && !Sec.ParentSegment; in replaceAndRemoveSections() 507 uint64_t Value = Sec ? Sec->Addr + SymInfo.Value : SymInfo.Value; in addSymbol() 615 Sec.Name = (Config.AllocSectionsPrefix + Sec.Name).str(); in handleArgs() [all …]
|
| H A D | Object.cpp | 103 Sec.Size = Sec.Symbols.size() * Sec.EntrySize; in visit() 112 Sec.Size = Sec.Relocations.size() * Sec.EntrySize; in visit() 385 writeSection(&Sec, Sec.Contents); in visit() 390 writeSection(&Sec, Sec.Data); in visit() 396 assert(Sec.Size == Sec.StrTabBuilder.getSize()); in visit() 405 writeSection(&Sec, Sec.Contents); in visit() 417 assert(Sec.Size == Sec.StrTabBuilder.getSize()); in visit() 1210 uint64_t SecSize = Sec.Size ? Sec.Size : 1; in sectionWithinSegment() 1791 Sec->OriginalIndex = Sec->Index; in readSectionHeaders() 2583 Sec.Offset - Sec.ParentSegment->Offset + Sec.ParentSegment->PAddr; in finalize() [all …]
|
| H A D | Object.h | 94 virtual Error visit(Section &Sec) = 0; 158 Error visit(Section &Sec) override; 474 void removeSection(const SectionBase *Sec) { Sections.erase(Sec); } in removeSection() argument 475 void addSection(const SectionBase *Sec) { Sections.insert(Sec); } in addSection() argument 564 : SectionBase(Sec) { in DecompressedSection() 565 Size = Sec.getDecompressedSize(); in DecompressedSection() 746 void setSection(SectionBase *Sec) { SecToApplyRel = Sec; } in setSection() argument 814 void addMember(SectionBase *Sec) { GroupMembers.push_back(Sec); } in addMember() argument 1021 return Sec.Flags & ELF::SHF_ALLOC; in sectionIsAlloc() 1071 find_if(Sections, [&](const SecPtr &Sec) { return Sec->Name == Name; }); in findSection() [all …]
|
| /freebsd-13.1/contrib/llvm-project/llvm/tools/llvm-objcopy/wasm/ |
| H A D | WasmObjcopy.cpp | 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 37 return Sec.Name == "producers"; in isCommentSection() 43 if (Sec.Name == SecName) { in dumpSectionToFile() 72 return RemovePred(Sec) || isDebugSection(Sec); in removeSections() 78 return RemovePred(Sec) || isDebugSection(Sec) || isLinkerSection(Sec) || in removeSections() 79 isNameSection(Sec) || isCommentSection(Sec); in removeSections() 87 return Config.ToRemove.matches(Sec.Name) || !isDebugSection(Sec); in removeSections() 105 return RemovePred(Sec); in removeSections() 131 Section Sec; in handleArgs() local [all …]
|
| /freebsd-13.1/contrib/llvm-project/llvm/tools/llvm-objcopy/COFF/ |
| H A D | COFFObjcopy.cpp | 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() 70 Sec.Header.SizeOfRawData = in addSection() 78 Sec.Header.NumberOfLinenumbers = 0; in addSection() 81 Obj.addSections(Sec); in addSection() 144 if (isDebugSection(Sec) && in handleArgs() 159 return !isDebugSection(Sec) && Sec.Name != ".buildid" && in handleArgs() [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() 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() 124 Sec.Relocs.clear(); in truncateSections() [all …]
|
| /freebsd-13.1/contrib/llvm-project/llvm/tools/llvm-objcopy/MachO/ |
| H A D | MachOReader.cpp | 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() 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() 43 S.Reserved1 = Sec.reserved1; in constructSectionCommon() 69 SectionType Sec; in extractSections() local [all …]
|
| H A D | MachOWriter.cpp | 240 memcpy(Temp.segname, Sec.Segname.data(), Sec.Segname.size()); in writeSectionInLoadCommand() 241 memcpy(Temp.sectname, Sec.Sectname.data(), Sec.Sectname.size()); in writeSectionInLoadCommand() 242 Temp.addr = Sec.Addr; in writeSectionInLoadCommand() 243 Temp.size = Sec.Size; in writeSectionInLoadCommand() 244 Temp.offset = Sec.Offset; in writeSectionInLoadCommand() 245 Temp.align = Sec.Align; in writeSectionInLoadCommand() 246 Temp.reloff = Sec.RelOff; in writeSectionInLoadCommand() 248 Temp.flags = Sec.Flags; in writeSectionInLoadCommand() 263 assert((Sec->isVirtualSection() || Sec->Size == 0) && in writeSections() 269 assert((Sec->Size == Sec->Content.size()) && "Incorrect section size"); in writeSections() [all …]
|
| H A D | MachOLayoutBuilder.cpp | 154 assert(SegmentVmAddr <= Sec->Addr && in layoutSegments() 158 if (!Sec->hasValidOffset()) { in layoutSegments() 159 Sec->Offset = 0; in layoutSegments() 164 Sec->Size = Sec->Content.size(); in layoutSegments() 165 SegFileSize += PaddingSize + Sec->Size; in layoutSegments() 168 if (!Sec->hasValidOffset()) { in layoutSegments() 169 Sec->Offset = 0; in layoutSegments() 171 Sec->Offset = SegOffset + SectOffset; in layoutSegments() 172 Sec->Size = Sec->Content.size(); in layoutSegments() 217 Sec->RelOff = Sec->Relocations.empty() ? 0 : Offset; in layoutRelocations() [all …]
|
| /freebsd-13.1/contrib/llvm-project/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 214 MCSection *Sec) in MCEncodedFragmentWithFixups() argument 244 MCDataFragment(MCSection *Sec = nullptr) 280 MCSection *Sec = nullptr) 348 SMLoc Loc, MCSection *Sec = nullptr) 374 MCSection *Sec = nullptr) 400 MCSection *Sec = nullptr) [all …]
|
| /freebsd-13.1/contrib/llvm-project/llvm/include/llvm/Object/ |
| H A D | ELFObjectFile.h | 465 switch (Sec.sh_type) { in initContent() 468 DotDynSymSec = &Sec; in initContent() 473 DotSymtabSec = &Sec; in initContent() 478 DotSymtabShndxSec = &Sec; in initContent() 520 return getSection(Sec)->sh_flags; in getSectionFlags() 525 return getSection(Sec)->sh_type; in getSectionType() 788 DataRefImpl Sec; in getSymbolSection() local 809 Sec = toDRI(++ESec); in moveSectionNext() 819 return getSection(Sec)->sh_addr; in getSectionAddress() 830 return getSection(Sec) - First; in getSectionIndex() [all …]
|
| H A D | ELF.h | 204 const Elf_Shdr &Sec, 262 if (!Sec) in symbols() 396 decodeBBAddrMap(const Elf_Shdr &Sec) const; 473 auto SymsOrErr = symbols(Sec); in getSymbol() 494 uintX_t Offset = Sec.sh_offset; in getSectionContentsAsArray() 495 uintX_t Size = Sec.sh_size; in getSectionContentsAsArray() 700 if (Sec.sh_type == ELF::SHT_DYNSYM) { in getDynSymtabSize() 701 if (Sec.sh_size % Sec.sh_entsize != 0) { in getDynSymtabSize() 707 return Sec.sh_size / Sec.sh_entsize; in getDynSymtabSize() 1132 if (Sec.sh_type != ELF::SHT_SYMTAB && Sec.sh_type != ELF::SHT_DYNSYM) in getStringTableForSymtab() [all …]
|
| H A D | ObjectFile.h | 262 virtual void moveSectionNext(DataRefImpl &Sec) const = 0; 268 getSectionContents(DataRefImpl Sec) const = 0; 271 virtual bool isSectionText(DataRefImpl Sec) const = 0; 272 virtual bool isSectionData(DataRefImpl Sec) const = 0; 273 virtual bool isSectionBSS(DataRefImpl Sec) const = 0; 276 virtual bool isSectionBitcode(DataRefImpl Sec) const; 277 virtual bool isSectionStripped(DataRefImpl Sec) const; 278 virtual bool isBerkeleyText(DataRefImpl Sec) const; 279 virtual bool isBerkeleyData(DataRefImpl Sec) const; 280 virtual bool isDebugSection(DataRefImpl Sec) const; [all …]
|
| /freebsd-13.1/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()
|
| H A D | ELFLinkGraphBuilder.h | 84 GraphSections[SecIndex] = &Sec; in setGraphSection() 216 for (auto &Sec : Sections) in prepare() 217 if (Sec.sh_type == ELF::SHT_SYMTAB) { in prepare() 219 SymTabSec = &Sec; in prepare() 234 auto &Sec = Sections[SecIndex]; in graphifySections() local 253 if (!(Sec.sh_flags & ELF::SHF_ALLOC)) { in graphifySections() 269 if (Sec.sh_flags & ELF::SHF_EXECINSTR) in graphifySections() 278 if (Sec.sh_size == 0) in graphifySections() 282 if (Sec.sh_type != ELF::SHT_NOBITS) { in graphifySections() 287 G->createContentBlock(GraphSec, *Data, Sec.sh_addr, Sec.sh_addralign, 0); in graphifySections() [all …]
|
| /freebsd-13.1/contrib/llvm-project/llvm/lib/Object/ |
| H A D | XCOFFObjectFile.cpp | 270 return toSection64(Sec)->SectionSize; in getSectionSize() 272 return toSection32(Sec)->SectionSize; in getSectionSize() 277 if (isSectionVirtual(Sec)) in getSectionContents() 309 uint32_t Flags = getSectionFlags(Sec); in isSectionData() 314 uint32_t Flags = getSectionFlags(Sec); in isSectionBSS() 319 uint32_t Flags = getSectionFlags(Sec); in isDebugSection() 627 return is64Bit() ? toSection64(Sec)->Name : toSection32(Sec)->Name; in getSectionNameInternal() 635 return is64Bit() ? toSection64(Sec)->Flags : toSection32(Sec)->Flags; in getSectionFlags() 667 return Sec.NumberOfRelocations; in getLogicalNumberOfRelocationEntries() 668 for (const auto &Sec : sections32()) { in getLogicalNumberOfRelocationEntries() local [all …]
|
| H A D | SymbolSize.cpp | 29 static unsigned getSectionID(const ObjectFile &O, SectionRef Sec) { in getSectionID() argument 31 return M->getSectionID(Sec); in getSectionID() 33 return Sec.getIndex(); in getSectionID() 35 return Sec.getIndex(); in getSectionID() 36 return cast<COFFObjectFile>(O).getSectionID(Sec); in getSectionID() 75 for (SectionRef Sec : O.sections()) { in computeSymbolSizes() local 76 uint64_t Address = Sec.getAddress(); in computeSymbolSizes() 77 uint64_t Size = Sec.getSize(); in computeSymbolSizes() 79 {O.symbol_end(), Address + Size, 0, getSectionID(O, Sec)}); in computeSymbolSizes()
|
| 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() 100 ObjectFile::getRelocatedSection(DataRefImpl Sec) const { in getRelocatedSection() 101 return section_iterator(SectionRef(Sec, this)); in getRelocatedSection()
|
| /freebsd-13.1/contrib/llvm-project/llvm/tools/llvm-readobj/ |
| H A D | XCOFFDumper.cpp | 131 for (const auto &Sec : Sections) { in printRelocations() local 134 if (Sec.Flags != XCOFF::STYP_TEXT && Sec.Flags != XCOFF::STYP_DATA && in printRelocations() 135 Sec.Flags != XCOFF::STYP_TDATA && Sec.Flags != XCOFF::STYP_DWARF) in printRelocations() 502 W.printString("Name", Sec.getName()); in printOverflowSectionHeader() 505 W.printHex("Size", Sec.SectionSize); in printOverflowSectionHeader() 515 W.printString("Name", Sec.getName()); in printGenericSectionHeader() 518 W.printHex("Size", Sec.SectionSize); in printGenericSectionHeader() 531 for (const T &Sec : Sections) { in printSectionHeaders() local 538 printOverflowSectionHeader(Sec); in printSectionHeaders() 548 printGenericSectionHeader(Sec); in printSectionHeaders() [all …]
|
| H A D | ELFDumper.cpp | 1799 createDRI(Sec.sh_offset, Sec.sh_size, Sec.sh_entsize); in ELFDumper() 3493 return Sec.sh_type == ELF::SHT_REL || Sec.sh_type == ELF::SHT_RELA || in isRelocationSec() 4111 return Sec.sh_offset + Sec.sh_size <= Phdr.p_offset + Phdr.p_filesz; in checkOffsets() 4132 return Sec.sh_addr + Sec.sh_size <= Phdr.p_vaddr + Phdr.p_memsz; in checkVMA() 4450 if (!Sec) in printVersionSymbolSection() 4535 if (!Sec) in printVersionDefinitionSection() 4562 if (!Sec) in printVersionDependencySection() 5925 if (Sec.sh_type != ELF::SHT_RELA && Sec.sh_type != ELF::SHT_REL) in getSectionAndRelocations() 6627 if (!Sec) in printVersionSymbolSection() 6661 if (!Sec) in printVersionDefinitionSection() [all …]
|
| /freebsd-13.1/contrib/llvm-project/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() 52 MCSection *Sec = F->getParent(); in canGetFragmentOffset() local 60 I = Sec->begin(); in canGetFragmentOffset() 81 MCSection *Sec = F->getParent(); in ensureValid() local 86 I = Sec->begin(); in ensureValid() [all …]
|
| H A D | WinCOFFObjectWriter.cpp | 267 switch (Sec.getAlignment()) { in getAlignment() 369 COFFSection *Sec = nullptr; in DefineSymbol() local 385 if (!Sec) in DefineSymbol() 388 WeakDefault->Section = Sec; in DefineSymbol() 406 Sym->Section = Sec; in DefineSymbol() 627 if (Sec.Number == -1) in writeSection() 646 if (Sec.Relocations.empty()) { in writeSection() 966 if (Sec->Number == -1) in assignFileOffsets() 971 if (IsPhysicalSection(Sec)) { in assignFileOffsets() 976 if (!Sec->Relocations.empty()) { in assignFileOffsets() [all …]
|
| /freebsd-13.1/contrib/llvm-project/llvm/lib/ObjectYAML/ |
| H A D | XCOFFYAML.cpp | 131 MappingNormalization<NSectionFlags, uint32_t> NC(IO, Sec.Flags); in mapping() 132 IO.mapOptional("Name", Sec.SectionName); in mapping() 133 IO.mapOptional("Address", Sec.Address); in mapping() 134 IO.mapOptional("Size", Sec.Size); in mapping() 135 IO.mapOptional("FileOffsetToData", Sec.FileOffsetToData); in mapping() 136 IO.mapOptional("FileOffsetToRelocations", Sec.FileOffsetToRelocations); in mapping() 137 IO.mapOptional("FileOffsetToLineNumbers", Sec.FileOffsetToLineNumbers); in mapping() 138 IO.mapOptional("NumberOfRelocations", Sec.NumberOfRelocations); in mapping() 139 IO.mapOptional("NumberOfLineNumbers", Sec.NumberOfLineNumbers); in mapping() 141 IO.mapOptional("SectionData", Sec.SectionData); in mapping() [all …]
|
| H A D | MachOEmitter.cpp | 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() 282 if (OS.tell() - fileStart > Sec.offset && Sec.offset != (uint32_t)0) in writeSectionData() 288 strnlen(Sec.sectname, sizeof(Sec.sectname))); in writeSectionData() 292 if (Sec.content) in writeSectionData() [all …]
|
| /freebsd-13.1/contrib/llvm-project/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()
|