Commit 991e00c270

d18g <gootvilig.davidhai@gmail.com>
2023-06-22 10:55:34
objcopy.zig allow outputting zero length sections (#16121)
Co-authored-by: Andrew Kelley <andrew@ziglang.org>
1 parent 438d680
Changed files (1)
src/objcopy.zig
@@ -442,7 +442,7 @@ const BinaryElfOutput = struct {
     }
 
     fn sectionValidForOutput(shdr: anytype) bool {
-        return shdr.sh_size > 0 and shdr.sh_type != elf.SHT_NOBITS and
+        return shdr.sh_type != elf.SHT_NOBITS and
             ((shdr.sh_flags & elf.SHF_ALLOC) == elf.SHF_ALLOC);
     }