Lines Matching defs:Sec
31 static bool isDebugSection(const Section &Sec) {
32 return Sec.Name.starts_with(".debug");
66 Section Sec;
67 Sec.setOwnedContents(Contents);
68 Sec.Name = Name;
69 Sec.Header.VirtualSize = NeedVA ? Sec.getContents().size() : 0u;
70 Sec.Header.VirtualAddress = NeedVA ? getNextRVA(Obj) : 0u;
71 Sec.Header.SizeOfRawData =
72 NeedVA ? alignTo(Sec.Header.VirtualSize,
74 : Sec.getContents().size();
75 // Sec.Header.PointerToRawData is filled in by the writer.
76 Sec.Header.PointerToRelocations = 0;
77 Sec.Header.PointerToLinenumbers = 0;
78 // Sec.Header.NumberOfRelocations is filled in by the writer.
79 Sec.Header.NumberOfLinenumbers = 0;
80 Sec.Header.Characteristics = Characteristics;
82 Obj.addSections(Sec);
166 Obj.removeSections([&Config](const Section &Sec) {
169 if (!Config.OnlySection.empty() && !Config.OnlySection.matches(Sec.Name))
174 if (isDebugSection(Sec) &&
175 (Sec.Header.Characteristics & IMAGE_SCN_MEM_DISCARDABLE) != 0)
179 if (Config.ToRemove.matches(Sec.Name))
192 Obj.truncateSections([DebugDir](const Section &Sec) {
193 return !isDebugSection(Sec) && Sec.Name != ".buildid" &&
195 DebugDir->RelativeVirtualAddress >= Sec.Header.VirtualAddress &&
197 Sec.Header.VirtualAddress + Sec.Header.SizeOfRawData) &&
198 ((Sec.Header.Characteristics &
205 for (Section &Sec : Obj.getMutableSections())
206 Sec.Relocs.clear();
264 for (Section &Sec : Obj.getMutableSections()) {
265 const auto It = Config.SetSectionFlags.find(Sec.Name);
267 Sec.Header.Characteristics = flagsToCharacteristics(
268 It->second.NewFlags, Sec.Header.Characteristics);
287 auto It = llvm::find_if(Obj.getMutableSections(), [&](auto &Sec) {
288 return Sec.Name == NewSection.SectionName;