37 lines · plain
1# REQUIRES: x86, zlib2 3## NOTE GNU ld makes .debug_str and .debug_info SHF_ALLOC due to `. += 10`.4# RUN: echo "SECTIONS { \5# RUN: .text : { . += 0x10; *(.text) } \6# RUN: .debug_str 0 : { . += 0x10; *(.debug_str) } \7# RUN: .debug_info 0 : { . += 0x10; *(.debug_info) } \8# RUN: }" > %t.script9 10# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o11# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %S/../Inputs/compress-debug.s -o %t2.o12# RUN: ld.lld %t2.o %t.o -o %t1 --compress-debug-sections=zlib -T %t.script13# RUN: llvm-dwarfdump %t1 -debug-str | FileCheck %s14# These two checks correspond to the patched values of a_sym and a_debug_sym.15# T = 0x54 - address of .text input section for this file (the start address of16# .text is 0 by default, the size of the preceding .text in the other input17# file is 0x44, and the linker script adds an additional 0x10).18# S = 0x53 - offset of .debug_info section for this file (the size of19# the preceding .debug_info from the other input file is 0x43, and the20# linker script adds an additional 0x10).21# Also note that the .debug_str offsets are also offset by 0x10, as directed by22# the linker script.23# CHECK: 0x00000010: "T"24# CHECK: 0x00000014: "S"25 26.text27a_sym:28nop29 30.section .debug_str,"MS",@progbits,131.long a_sym32.long a_debug_sym33 34.section .debug_info,"",@progbits35a_debug_sym:36.long 0x8877665537