Skip to content

Commit

Permalink
debug/elf: fix inccorrect value in COMPRESS_ZLIB string name
Browse files Browse the repository at this point in the history
LLVM recently introduced ZSTD compression for ELF sections. The error
message when failing to read the compressed section calls this
COMPRESS_ZLIB+2 while it should report it as COMPRESS_ZLIB+1.

Change-Id: I869aa69baf0c8c86665475b47343c790587cb39b
Reviewed-on: https://go-review.googlesource.com/c/go/+/443035
Reviewed-by: Ian Lance Taylor <[email protected]>
Auto-Submit: Ian Lance Taylor <[email protected]>
Run-TryBot: Ian Lance Taylor <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
  • Loading branch information
znkr authored and gopherbot committed Oct 14, 2022
1 parent e9cdca9 commit 8826bdd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/debug/elf/elf.go
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ const (
)

var compressionStrings = []intName{
{0, "COMPRESS_ZLIB"},
{1, "COMPRESS_ZLIB"},
{0x60000000, "COMPRESS_LOOS"},
{0x6fffffff, "COMPRESS_HIOS"},
{0x70000000, "COMPRESS_LOPROC"},
Expand Down
1 change: 1 addition & 0 deletions src/debug/elf/elf_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ var nameTests = []nameTest{
{R_SPARC_GOT22, "R_SPARC_GOT22"},
{ET_LOOS + 5, "ET_LOOS+5"},
{ProgFlag(0x50), "0x50"},
{COMPRESS_ZLIB + 1, "COMPRESS_ZLIB+1"},
}

func TestNames(t *testing.T) {
Expand Down

0 comments on commit 8826bdd

Please sign in to comment.