[lld] 94573a4 - [ELF][test] Change some tests to use SHF_COMPRESSED instead of legacy .zdebug

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 1 00:19:00 PDT 2022


Author: Fangrui Song
Date: 2022-06-01T00:18:54-07:00
New Revision: 94573a49c9d1c9902050f8022a6828ea06ee51de

URL: https://github.com/llvm/llvm-project/commit/94573a49c9d1c9902050f8022a6828ea06ee51de
DIFF: https://github.com/llvm/llvm-project/commit/94573a49c9d1c9902050f8022a6828ea06ee51de.diff

LOG: [ELF][test] Change some tests to use SHF_COMPRESSED instead of legacy .zdebug

Added: 
    

Modified: 
    lld/test/ELF/compressed-debug-input-err.s
    lld/test/ELF/gdb-index.s

Removed: 
    


################################################################################
diff  --git a/lld/test/ELF/compressed-debug-input-err.s b/lld/test/ELF/compressed-debug-input-err.s
index 922fcfc61bb37..0683a4b1e5ee0 100644
--- a/lld/test/ELF/compressed-debug-input-err.s
+++ b/lld/test/ELF/compressed-debug-input-err.s
@@ -1,14 +1,19 @@
-# REQUIRES: zlib, ppc, x86
-
-# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
+# REQUIRES: zlib
+# RUN: yaml2obj %s -o %t.o
 # RUN: not ld.lld %t.o -o /dev/null -shared 2>&1 | FileCheck %s
 
-# RUN: llvm-mc -filetype=obj -triple=powerpc64-unknown-unknown %s -o %t-be.o
-# RUN: not ld.lld %t-be.o -o /dev/null -shared 2>&1 | FileCheck %s
-
 ## Check we are able to report zlib uncompress errors.
-# CHECK: error: {{.*}}.o:(.debug_str): uncompress failed: zlib error: Z_DATA_ERROR
+# CHECK: error: {{.*}}.o:(.debug_info): uncompress failed: zlib error: Z_DATA_ERROR
 
-.section .zdebug_str,"MS", at progbits,1
- .ascii "ZLIB"
- .byte 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1
+!ELF
+FileHeader:
+  Class:   ELFCLASS64
+  Data:    ELFDATA2LSB
+  Type:    ET_REL
+  Machine: EM_X86_64
+Sections:
+  - Type:         SHT_PROGBITS
+    Name:         .debug_info
+    Flags:        [ SHF_COMPRESSED ]
+    AddressAlign: 0x04
+    Content:      "010000000000000004000000000000000100000000000000ffff"

diff  --git a/lld/test/ELF/gdb-index.s b/lld/test/ELF/gdb-index.s
index 2b59956ed8b7a..7e72d470a118c 100644
--- a/lld/test/ELF/gdb-index.s
+++ b/lld/test/ELF/gdb-index.s
@@ -14,7 +14,7 @@
 # SECTION-NOT: .debug_gnu_pubnames
 # SECTION-NOT: .debug_gnu_pubtypes
 
-# RUN: llvm-mc -compress-debug-sections=zlib-gnu -filetype=obj -triple=x86_64-pc-linux \
+# RUN: llvm-mc -compress-debug-sections=zlib -filetype=obj -triple=x86_64-pc-linux \
 # RUN:   %p/Inputs/gdb-index.s -o %t2.o
 # RUN: ld.lld --gdb-index %t1.o %t2.o -o %t
 


        


More information about the llvm-commits mailing list