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

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 13 01:52:53 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.Flags & SectionFlag::SecLoad) && Sec.Type != SHT_NOBITS)
----------------
jh7370 wrote:

Skipping NOBITS sections seems a fairly dramatic departure from the previous code. It may make sense, but I'd like to hear your explanation.

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


More information about the llvm-commits mailing list