]> Cypherpunks repositories - gostls13.git/commitdiff
debug/elf: fix inccorrect value in COMPRESS_ZLIB string name
authorFlorian Zenker <floriank@google.com>
Fri, 14 Oct 2022 09:13:38 +0000 (09:13 +0000)
committerGopher Robot <gobot@golang.org>
Fri, 14 Oct 2022 17:10:16 +0000 (17:10 +0000)
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 <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

src/debug/elf/elf.go
src/debug/elf/elf_test.go

index 77d7b0988c1a96490a52c5552b3cd89e360e3b11..02cda165108f07402961fdfc3aa4a2a72e59e6bc 100644 (file)
@@ -735,7 +735,7 @@ const (
 )
 
 var compressionStrings = []intName{
-       {0, "COMPRESS_ZLIB"},
+       {1, "COMPRESS_ZLIB"},
        {0x60000000, "COMPRESS_LOOS"},
        {0x6fffffff, "COMPRESS_HIOS"},
        {0x70000000, "COMPRESS_LOPROC"},
index a61b491090d173a24235ca66becd05afed23cb86..814c6bd6cc3f1b033d0e3778368d8b9f3cdcaa8b 100644 (file)
@@ -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) {