1*9880d681SAndroid Build Coastguard Worker// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | llvm-readobj -r | FileCheck %s 2*9880d681SAndroid Build Coastguard Worker 3*9880d681SAndroid Build Coastguard Worker// Test that relocations with local symbols in a mergeable section are done 4*9880d681SAndroid Build Coastguard Worker// with a reference to the symbol if the offset is non zero. 5*9880d681SAndroid Build Coastguard Worker 6*9880d681SAndroid Build Coastguard Worker 7*9880d681SAndroid Build Coastguard Worker movsd .Lfoo(%rip), %xmm1 8*9880d681SAndroid Build Coastguard Worker movl $.Lfoo, %edi 9*9880d681SAndroid Build Coastguard Worker movl $.Lfoo+2, %edi 10*9880d681SAndroid Build Coastguard Worker jmp foo@PLT 11*9880d681SAndroid Build Coastguard Worker movq foo@GOTPCREL, %rax 12*9880d681SAndroid Build Coastguard Worker movq zed, %rax 13*9880d681SAndroid Build Coastguard Worker movsd .Lfoo+4(%rip), %xmm1 14*9880d681SAndroid Build Coastguard Worker 15*9880d681SAndroid Build Coastguard Worker .section .sec1,"aM",@progbits,16 16*9880d681SAndroid Build Coastguard Worker.Lfoo: 17*9880d681SAndroid Build Coastguard Workerzed: 18*9880d681SAndroid Build Coastguard Worker .global zed 19*9880d681SAndroid Build Coastguard Worker 20*9880d681SAndroid Build Coastguard Worker .section bar,"ax",@progbits 21*9880d681SAndroid Build Coastguard Workerfoo: 22*9880d681SAndroid Build Coastguard Worker 23*9880d681SAndroid Build Coastguard Worker// CHECK: Relocations [ 24*9880d681SAndroid Build Coastguard Worker// CHECK-NEXT: Section {{.*}} .rela.text { 25*9880d681SAndroid Build Coastguard Worker// CHECK-NEXT: 0x{{[^ ]+}} R_X86_64_PC32 .Lfoo 0x{{[^ ]+}} 26*9880d681SAndroid Build Coastguard Worker// CHECK-NEXT: 0x{{[^ ]+}} R_X86_64_32 .sec1 0x{{[^ ]+}} 27*9880d681SAndroid Build Coastguard Worker// CHECK-NEXT: 0x{{[^ ]+}} R_X86_64_32 .Lfoo 0x{{[^ ]+}} 28*9880d681SAndroid Build Coastguard Worker// CHECK-NEXT: 0x{{[^ ]+}} R_X86_64_PLT32 foo 0x{{[^ ]+}} 29*9880d681SAndroid Build Coastguard Worker// CHECK-NEXT: 0x{{[^ ]+}} R_X86_64_GOTPCREL foo 0x{{[^ ]+}} 30*9880d681SAndroid Build Coastguard Worker// CHECK-NEXT: 0x{{[^ ]+}} R_X86_64_32S zed 0x{{[^ ]+}} 31*9880d681SAndroid Build Coastguard Worker// CHECK-NEXT: 0x{{[^ ]+}} R_X86_64_PC32 .sec1 0x{{[^ ]+}} 32*9880d681SAndroid Build Coastguard Worker// CHECK-NEXT: } 33*9880d681SAndroid Build Coastguard Worker// CHECK-NEXT: ] 34