]> Cypherpunks repositories - gostls13.git/commit
debug/elf: do not read unrelated bytes for SHT_NOBITS sections
authorAlessandro Arzilli <alessandro.arzilli@gmail.com>
Tue, 4 Jan 2022 14:47:02 +0000 (15:47 +0100)
committerIan Lance Taylor <iant@golang.org>
Fri, 14 Jan 2022 18:20:45 +0000 (18:20 +0000)
commite4a6b84962cc2fb4f4b8bb532a84bab5bfd68d99
treeaf7c8a53aae529f16a466cd5939d1b541ffa5a59
parent9c6ecc49ca02c83f3081c30171ab40dd62557342
debug/elf: do not read unrelated bytes for SHT_NOBITS sections

SHT_NOBITS sections do not occupy space in the file and their offset is
"conceptual", reading their data should return all zeroes instead of
reading bytes from the section that follows them.

Change-Id: Iaa9634792c1909c3e87dab841dd646cd6dcf9027
Reviewed-on: https://go-review.googlesource.com/c/go/+/375216
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
Run-TryBot: Emmanuel Odeke <emmanuel@orijtech.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/debug/elf/elf_test.go
src/debug/elf/file.go