]> Cypherpunks repositories - gostls13.git/commit
debug/elf: transparently decompress compressed sections
authorAustin Clements <austin@google.com>
Wed, 2 Dec 2015 17:20:29 +0000 (12:20 -0500)
committerAustin Clements <austin@google.com>
Thu, 3 Dec 2015 20:53:11 +0000 (20:53 +0000)
commit76483877052eaa9b2242deee2239e82d3953fd16
tree6a4aefba2782a6ead3b9d42280feddafcc79a301
parente1544d3bb68d56ebf43cc8828e3dce18fd5ef442
debug/elf: transparently decompress compressed sections

This adds support for compressed ELF sections. This compression is
treated as a framing issue and hence the package APIs all
transparently decompress compressed sections. This requires some
subtlety for (*Section).Open, which returns an io.ReadSeeker: since
the decompressed data comes from an io.Reader, this commit introduces
a Reader-to-ReadSeeker adapter that is efficient for common uses of
Seek and does what it can otherwise.

Fixes #11773.

Change-Id: Ic0cb7255a85cadf4c1d15fb563d5a2e89dbd3c36
Reviewed-on: https://go-review.googlesource.com/17341
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Austin Clements <austin@google.com>
src/debug/elf/elf.go
src/debug/elf/file.go
src/debug/elf/file_test.go
src/debug/elf/reader.go [new file with mode: 0644]
src/debug/elf/testdata/compressed-32.obj [new file with mode: 0644]
src/debug/elf/testdata/compressed-64.obj [new file with mode: 0644]