llvm-objdump -D this file:
int a[100000];
int
main() {
return 0;
}Will produce an error, "The end of the file was unexpectedly encountered"
This happens because of a check in Binary.h checkOffset. (Addr + Size > M.getBufferEnd()).
Since the .bss section doesn't occupy space in the file this check fails when the above program is dumped with -D.
This change avoids the reading .bss sections.
I added a test for X86_64 but this isn't target specific.
Delete + sh_offset to solve the problem I described in a previous comment.