================
@@ -130,6 +130,42 @@ class ELFRelocation {
 
   RelocUnion reloc;
 };
+
+lldb::SectionSP MergeSections(lldb::SectionSP lhs, lldb::SectionSP rhs) {
+  assert(lhs && rhs);
+
+  // We only take the RHS is the LHS is SHT_NOBITS, which would be
+  // represented as a size of 0. Where we can take the rhs.
+  if (lhs->GetByteSize() == 0)
----------------
clayborg wrote:

Check for `rhs` being zero filled first:
```
if (rhs->GetType() == eSectionTypeZeroFill)
  return lhs; // Keep old section if rhs is zero filled
if (lhs->GetType() == eSectionTypeZeroFill)
  return rhs;
```

https://github.com/llvm/llvm-project/pull/166635
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to