34 lines · plain
1# REQUIRES: x86, zlib2 3# RUN: rm -rf %t && mkdir %t && cd %t4# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o a.o5# RUN: ld.lld -pie a.o --compress-sections .strtab=zlib --compress-sections .symtab=zlib -o out6# RUN: llvm-readelf -Ss -x .strtab out 2>&1 | FileCheck %s7 8# CHECK: nonalloc0 PROGBITS 0000000000000000 [[#%x,]] [[#%x,]] 00 0 0 19# CHECK: .symtab SYMTAB 0000000000000000 [[#%x,]] [[#%x,]] 18 C 12 3 110# CHECK-NEXT: .shstrtab STRTAB 0000000000000000 [[#%x,]] [[#%x,]] 00 0 0 111# CHECK-NEXT: .strtab STRTAB 0000000000000000 [[#%x,]] [[#%x,]] 00 C 0 0 112 13## TODO Add compressed SHT_STRTAB/SHT_SYMTAB support to llvm-readelf14# CHECK: warning: {{.*}}: unable to get the string table for the SHT_SYMTAB section: SHT_STRTAB string table section15 16# CHECK: Hex dump of section '.strtab':17# CHECK-NEXT: 01000000 00000000 5c000000 0000000018# CHECK-NEXT: 01000000 00000000 {{.*}}19 20# RUN: not ld.lld -shared a.o --compress-sections .dynstr=zlib 2>&1 | FileCheck %s --check-prefix=ERR-ALLOC21# ERR-ALLOC: error: --compress-sections: section '.dynstr' with the SHF_ALLOC flag cannot be compressed22 23.globl _start, g0, g124_start:25l0:26g0:27g1:28.globl ggggggggggggggggggggggggggggggg029.globl ggggggggggggggggggggggggggggggg130 31.section nonalloc0,""32.quad .text+133.quad .text+234