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