objcopy.zig allow outputting zero length sections (#16121)

Co-authored-by: Andrew Kelley <andrew@ziglang.org>
This commit is contained in:
d18g 2023-06-22 11:55:34 +03:00 committed by GitHub
parent 438d680913
commit 991e00c270
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);
}