Files
clang-p2996/llvm/test/tools/llvm-objcopy/ELF/compress-debug-sections.test
Fangrui Song 45ae553109 [llvm-objcopy] Remove support for legacy .zdebug sections
clang 14 removed -gz=zlib-gnu support and ld.lld removed linker input support
for zlib-gnu in D126793. Now let's remove zlib-gnu from llvm-objcopy.

* .zdebug* sections are no longer recognized as debug sections. --strip* don't remove them.
  They are copied like other opaque sections
* --decompress-debug-sections does not uncompress .zdebug* sections
* --compress-debug-sections=zlib-gnu is not supported

It is very rare but in case a user has object files using .zdebug . They can use
llvm-objcopy<15 or GNU objcopy for uncompression.
--compress-debug-sections=zlib-gnu is unlikely ever used by anyone, so I do not
add a custom diagnostic.

Differential Revision: https://reviews.llvm.org/D128688
2022-06-29 10:42:55 -07:00

19 lines
541 B
Plaintext

# REQUIRES: zlib
# RUN: yaml2obj %p/Inputs/compress-debug-sections.yaml -o %t.o
# RUN: cp %t.o %t.copy.o
# RUN: llvm-objcopy --compress-debug-sections=zlib %t.o %tz.o
# RUN: cp %tz.o %tz.copy.o
# RUN: llvm-objcopy --decompress-debug-sections %tz.o %t2.o
# Using redirects to avoid llvm-objdump from printing the filename.
# RUN: llvm-objdump -s --section=.debug_str - < %t.o > %t.txt
# RUN: llvm-objdump -s --section=.debug_str - < %t2.o > %t2.txt
# RUN: diff %t.txt %t2.txt
# RUN: cmp %t.o %t.copy.o
# RUN: cmp %tz.o %tz.copy.o