48 lines · plain
1# REQUIRES: x862# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o3# RUN: ld.lld %t.o %t.o -shared --emit-relocs -o %t.so4# RUN: llvm-readelf -S -r %t.so | FileCheck %s --check-prefixes=CHECK,RELOC5# RUN: llvm-dwarfdump --eh-frame %t.so | FileCheck %s --check-prefix=EH6 7## Also show that the merging happens when going via a -r link.8# RUN: ld.lld -r %t.o %t.o -o %t.ro9# RUN: ld.lld %t.ro -o %t2.so -shared10# RUN: llvm-readelf -S -r %t2.so | FileCheck %s11 12# CHECK: Name Type Address Off Size ES Flg Lk Inf Al13# CHECK: .eh_frame PROGBITS [[#%x,]] [[#%x,]] 000058 00 A 0 0 814# CHECK: foo PROGBITS {{0*}}[[#%x,FOO:]] [[#%x,]] 000002 00 AX 0 0 115# CHECK-NEXT: bar PROGBITS {{0*}}[[#%x,FOO+2]] [[#%x,]] 000002 00 AX 0 0 116 17# RELOC: Offset Info Type Symbol's Value Symbol's Name + Addend18# RELOC-NEXT: {{0*}}[[#%x,OFF:]] [[#%x,]] R_X86_64_PC32 [[#%x,]] foo + 019# RELOC-NEXT: {{0*}}[[#%x,OFF+20]] [[#%x,]] R_X86_64_PC32 [[#%x,]] bar + 020# RELOC-NEXT: {{0*}}[[#OFF+40]] [[#%x,]] R_X86_64_PC32 [[#%x,]] foo + 121# RELOC-NEXT: {{0*}}[[#%x,OFF-24]] [[#%x,]] R_X86_64_NONE 0{{$}}22 23# EH: Format: DWARF3224# EH: 00000018 00000010 0000001c FDE cie=00000000 pc={{0*}}[[#%x,FOO:]]...25# EH-SAME: {{0*}}[[#%x,FOO+1]]26# EH-COUNT-3: DW_CFA_nop:27# EH-EMPTY: 28# EH: 0000002c 00000010 00000030 FDE cie=00000000 pc={{0*}}[[#%x,FOO+2]]...{{0*}}[[#%x,FOO+4]]29# EH-COUNT-3: DW_CFA_nop:30# EH-EMPTY:31# EH: 00000040 00000010 00000044 FDE cie=00000000 pc={{0*}}[[#%x,FOO+1]]...{{0*}}[[#%x,FOO+2]]32# EH-COUNT-3: DW_CFA_nop:33# EH-EMPTY:34# EH-NEXT: 0x[[#%x,]]: CFA=RSP+8: RIP=[CFA-8]35# EH-EMPTY:36# EH-NEXT: 00000054 ZERO terminator37 38 .section foo,"ax",@progbits39 .cfi_startproc40 nop41 .cfi_endproc42 43 .section bar,"axG",@progbits,foo,comdat44 .cfi_startproc45 nop46 nop47 .cfi_endproc48