Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
debug/elf: (*Section).Data() returns non-zero data for SHT_NOBITS section #18667
(*Section).Data fails to take section.Type == Type:elf.SHT_NOBITS into account, and will happily return anything in the file at the section file offset.
On certain ELF files, debug/elf will output non-zero data for .bss section.
This is because the .comment section happens to be after the .bss section.
Perhaps this is a user error, but I'm not entirely sure. And if it is indeed a bug of debug/elf, I'm not sure whether we should make it return
I would be inclined to return an error of the
That said, I would reconsider if that choice breaks real programs that seem otherwise correct.