[clang] [llvm-objcopy] Add --gap-fill and --pad-to options (PR #65815)

James Henderson via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 25 00:45:36 PDT 2023


================
@@ -2635,9 +2635,36 @@ template <class ELFT> Error ELFWriter<ELFT>::finalize() {
 }
 
 Error BinaryWriter::write() {
-  for (const SectionBase &Sec : Obj.allocSections())
+  SmallVector<const SectionBase *, 30> LoadableSections;
+  for (const SectionBase &Sec : Obj.allocSections()) {
+    if (Sec.Type != SHT_NOBITS)
+      LoadableSections.push_back(&Sec);
----------------
jh7370 wrote:

NOBITS sections are loadable, so I don't think this variable name makes sense.

https://github.com/llvm/llvm-project/pull/65815


More information about the cfe-commits mailing list