Home
last modified time | relevance | path

Searched refs:Sec (Results 1 – 25 of 161) sorted by relevance

1234567

/llvm-project-15.0.7/llvm/lib/ObjCopy/wasm/
H A DWasmObjcopy.cpp25 return Sec.Name.startswith(".debug"); in isDebugSection()
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()
[all …]
/llvm-project-15.0.7/llvm/lib/ObjCopy/ELF/
H A DELFObjcopy.cpp56 return StringRef(Sec.Name).startswith(".debug") || Sec.Name == ".gdb_index"; in isDebugSection()
102 Sec.Flags = getSectionFlagsPreserveMask(Sec.Flags, getNewShfFlags(Flags)); in setSectionFlagsAndType()
188 std::copy(Sec.OriginalData.begin(), Sec.OriginalData.end(), in dumpSectionToFile()
382 return isDWOSection(Sec) || RemovePred(Sec); in replaceAndRemoveSections()
387 return onlyKeepDWOPred(Obj, Sec) || RemovePred(Sec); in replaceAndRemoveSections()
410 return RemovePred(Sec) || Sec.ParentSegment == nullptr; in replaceAndRemoveSections()
416 return RemovePred(Sec) || isDebugSection(Sec); in replaceAndRemoveSections()
454 return (Sec.Flags & SHF_ALLOC) != 0 && !Sec.ParentSegment; in replaceAndRemoveSections()
534 uint64_t Value = Sec ? Sec->Addr + SymInfo.Value : SymInfo.Value; in addSymbol()
642 if (Sec.Flags & SHF_ALLOC && Sec.Type != SHT_NOTE) in handleArgs()
[all …]
H A DELFObject.cpp103 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()
1162 uint64_t SecSize = Sec.Size ? Sec.Size : 1; in sectionWithinSegment()
1746 Sec->OriginalIndex = Sec->Index; in readSectionHeaders()
2611 Sec.Addr = alignTo(Sec.Offset - Sec.ParentSegment->Offset + in finalize()
[all …]
H A DELFObject.h94 virtual Error visit(Section &Sec) = 0;
158 Error visit(Section &Sec) override;
475 void removeSection(const SectionBase *Sec) { Sections.erase(Sec); } in removeSection() argument
476 void addSection(const SectionBase *Sec) { Sections.insert(Sec); } in addSection() argument
566 : SectionBase(Sec) { in DecompressedSection()
567 Size = Sec.getDecompressedSize(); in DecompressedSection()
751 void setSection(SectionBase *Sec) { SecToApplyRel = Sec; } in setSection() argument
824 void addMember(SectionBase *Sec) { GroupMembers.push_back(Sec); } in addMember() argument
1028 return Sec.Flags & ELF::SHF_ALLOC; in sectionIsAlloc()
1075 find_if(Sections, [&](const SecPtr &Sec) { return Sec->Name == Name; }); in findSection()
[all …]
/llvm-project-15.0.7/llvm/lib/ExecutionEngine/Orc/
H A DDebuggerSupportPlugin.cpp68 if (!isDebugSection(Sec)) in preserveDebugSections()
129 Section *Sec = nullptr; in startSynthesis() member
155 DebugSecInfos.push_back({&Sec, Sec.getName().substr(0, SepPos), in startSynthesis()
164 SectionRange R(Sec); in startSynthesis()
221 SI.Sec = nullptr; in startSynthesis()
268 memset(&Sec, 0, sizeof(Sec)); in startSynthesis()
272 Sec.size = SI.Size; in startSynthesis()
275 Sec.reloff = 0; in startSynthesis()
276 Sec.nreloc = 0; in startSynthesis()
278 Writer.write(Sec); in startSynthesis()
[all …]
/llvm-project-15.0.7/llvm/lib/ObjCopy/COFF/
H A DCOFFObjcopy.cpp31 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 DCOFFObject.cpp56 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 …]
/llvm-project-15.0.7/llvm/include/llvm/MC/
H A DMCFragment.h116 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
213 MCSection *Sec) in MCEncodedFragmentWithFixups() argument
243 MCDataFragment(MCSection *Sec = nullptr)
279 MCSection *Sec = nullptr)
355 SMLoc Loc, MCSection *Sec = nullptr)
412 MCSection *Sec = nullptr)
467 MCSection *Sec = nullptr)
[all …]
/llvm-project-15.0.7/llvm/lib/ObjCopy/MachO/
H A DMachOReader.cpp32 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 DMachOObjcopy.cpp62 return Config.ToRemove.matches(Sec->CanonicalName); in removeSections()
69 if (Sec->Segname == "__DWARF") in removeSections()
72 return RemovePred(Sec); in removeSections()
282 if (Sec->CanonicalName == SecName) { in dumpSectionToFile()
303 Section Sec(TargetSegName, Pair.second); in addSection() local
304 Sec.Content = in addSection()
306 Sec.Size = Sec.Content.size(); in addSection()
359 Section &Sec = *SecToUpdateOrErr; in updateSection() local
366 Sec.Size = Sec.Content.size(); in updateSection()
414 for (std::unique_ptr<Section> &Sec : LC.Sections) in handleArgs()
[all …]
H A DMachOWriter.cpp220 memcpy(Temp.segname, Sec.Segname.data(), Sec.Segname.size()); in writeSectionInLoadCommand()
221 memcpy(Temp.sectname, Sec.Sectname.data(), Sec.Sectname.size()); in writeSectionInLoadCommand()
222 Temp.addr = Sec.Addr; in writeSectionInLoadCommand()
223 Temp.size = Sec.Size; in writeSectionInLoadCommand()
224 Temp.offset = Sec.Offset; in writeSectionInLoadCommand()
225 Temp.align = Sec.Align; in writeSectionInLoadCommand()
226 Temp.reloff = Sec.RelOff; in writeSectionInLoadCommand()
228 Temp.flags = Sec.Flags; in writeSectionInLoadCommand()
243 assert((Sec->isVirtualSection() || Sec->Size == 0) && in writeSections()
249 assert((Sec->Size == Sec->Content.size()) && "Incorrect section size"); in writeSections()
[all …]
H A DMachOLayoutBuilder.cpp154 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 …]
/llvm-project-15.0.7/llvm/include/llvm/Object/
H A DELFObjectFile.h480 switch (Sec.sh_type) { in initContent()
483 DotDynSymSec = &Sec; in initContent()
488 DotSymtabSec = &Sec; in initContent()
493 DotSymtabShndxSec = &Sec; in initContent()
535 return getSection(Sec)->sh_flags; in getSectionFlags()
540 return getSection(Sec)->sh_type; in getSectionType()
804 DataRefImpl Sec; in getSymbolSection() local
825 Sec = toDRI(++ESec); in moveSectionNext()
835 return getSection(Sec)->sh_addr; in getSectionAddress()
846 return getSection(Sec) - First; in getSectionIndex()
[all …]
H A DELF.h201 const Elf_Shdr &Sec,
259 if (!Sec) in symbols()
471 auto SymsOrErr = symbols(Sec); in getSymbol()
492 uintX_t Offset = Sec.sh_offset; in getSectionContentsAsArray()
493 uintX_t Size = Sec.sh_size; in getSectionContentsAsArray()
698 if (Sec.sh_type == ELF::SHT_DYNSYM) { in getDynSymtabSize()
699 if (Sec.sh_size % Sec.sh_entsize != 0) { in getDynSymtabSize()
705 return Sec.sh_size / Sec.sh_entsize; in getDynSymtabSize()
939 "invalid " + describe(*this, Sec) + in getVersionDefinitions()
1156 if (Sec.sh_type != ELF::SHT_SYMTAB && Sec.sh_type != ELF::SHT_DYNSYM) in getStringTableForSymtab()
[all …]
/llvm-project-15.0.7/llvm/lib/ObjCopy/XCOFF/
H A DXCOFFWriter.cpp28 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 …]
/llvm-project-15.0.7/llvm/lib/ExecutionEngine/JITLink/
H A DDefineExternalSectionStartAndEndSymbols.h28 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 DCOFFLinkGraphBuilder.cpp57 return std::min(Sec->VirtualSize, Sec->SizeOfRawData); in getSectionSize()
58 return Sec->SizeOfRawData; in getSectionSize()
130 if (!Sec) in graphifySections()
131 return Sec.takeError(); in graphifySections()
165 *GraphSec, getSectionSize(Obj, *Sec), in graphifySections()
166 orc::ExecutorAddr(getSectionAddress(Obj, *Sec)), in graphifySections()
167 (*Sec)->getAlignment(), 0); in graphifySections()
170 if (auto Err = Obj.getSectionContents(*Sec, Data)) in graphifySections()
178 (*Sec)->getAlignment(), 0); in graphifySections()
206 const object::coff_section *Sec = nullptr; in graphifySymbols() local
[all …]
/llvm-project-15.0.7/llvm/tools/llvm-jitlink/
H A Dllvm-jitlink-elf.cpp82 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()
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()
165 FileInfo.SectionInfos[Sec.getName()] = {SecSize, SecAddr.getValue()}; in registerELFGraphInfo()
[all …]
H A Dllvm-jitlink-macho.cpp84 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()
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()
160 FileInfo.SectionInfos[Sec.getName()] = {SecSize, SecAddr.getValue()}; in registerMachOGraphInfo()
[all …]
H A Dllvm-jitlink-coff.cpp80 for (auto &Sec : G.sections()) { in registerCOFFGraphInfo() local
82 dbgs() << " Section \"" << Sec.getName() << "\": " in registerCOFFGraphInfo()
83 << (llvm::empty(Sec.symbols()) ? "empty. skipping." in registerCOFFGraphInfo()
89 if (llvm::empty(Sec.symbols())) in registerCOFFGraphInfo()
92 if (FileInfo.SectionInfos.count(Sec.getName())) in registerCOFFGraphInfo()
98 bool isGOTSection = isCOFFGOTSection(Sec); in registerCOFFGraphInfo()
99 bool isStubsSection = isCOFFStubsSection(Sec); in registerCOFFGraphInfo()
104 auto *FirstSym = *Sec.symbols().begin(); in registerCOFFGraphInfo()
106 for (auto *Sym : Sec.symbols()) { in registerCOFFGraphInfo()
164 FileInfo.SectionInfos[Sec.getName()] = {SecSize, SecAddr.getValue()}; in registerCOFFGraphInfo()
[all …]
/llvm-project-15.0.7/llvm/lib/MC/
H A DMCFragment.cpp34 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 …]
/llvm-project-15.0.7/llvm/lib/Target/Mips/MCTargetDesc/
H A DMipsOptionRecord.cpp36 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()
/llvm-project-15.0.7/llvm/lib/Object/
H A DXCOFFObjectFile.cpp345 return toSection32(Sec)->VirtualAddress; in getSectionAddress()
361 return toSection64(Sec)->SectionSize; in getSectionSize()
363 return toSection32(Sec)->SectionSize; in getSectionSize()
368 if (isSectionVirtual(Sec)) in getSectionContents()
441 uint32_t Flags = getSectionFlags(Sec); in isSectionData()
446 uint32_t Flags = getSectionFlags(Sec); in isSectionBSS()
451 uint32_t Flags = getSectionFlags(Sec); in isDebugSection()
884 return is64Bit() ? toSection64(Sec)->Name : toSection32(Sec)->Name; in getSectionNameInternal()
892 return is64Bit() ? toSection64(Sec)->Flags : toSection32(Sec)->Flags; in getSectionFlags()
928 for (const auto &Sec : sections32()) { in getNumberOfRelocationEntries() local
[all …]
H A DSymbolSize.cpp29 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()
/llvm-project-15.0.7/llvm/lib/ObjectYAML/
H A DMachOEmitter.cpp108 TempSec.addr = Sec.addr; in constructSection()
109 TempSec.size = Sec.size; in constructSection()
110 TempSec.offset = Sec.offset; in constructSection()
111 TempSec.align = Sec.align; in constructSection()
112 TempSec.reloff = Sec.reloff; in constructSection()
113 TempSec.nreloc = Sec.nreloc; in constructSection()
114 TempSec.flags = Sec.flags; in constructSection()
312 if (OS.tell() - fileStart > Sec.offset && Sec.offset != (uint32_t)0) in writeSectionData()
318 strnlen(Sec.sectname, sizeof(Sec.sectname))); in writeSectionData()
322 if (Sec.content) in writeSectionData()
[all …]

1234567