2013-04-12 12:06:46 +08:00
|
|
|
// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | llvm-readobj -r | FileCheck %s
|
2010-09-25 13:42:19 +08:00
|
|
|
|
2014-03-29 14:26:49 +08:00
|
|
|
// Test that relocations with local symbols in a mergeable section are done
|
|
|
|
// with a reference to the symbol if the offset is non zero.
|
2010-10-05 23:43:32 +08:00
|
|
|
|
|
|
|
|
|
|
|
movsd .Lfoo(%rip), %xmm1
|
|
|
|
movl $.Lfoo, %edi
|
|
|
|
movl $.Lfoo+2, %edi
|
2010-10-06 07:57:26 +08:00
|
|
|
jmp foo@PLT
|
2010-10-07 00:23:36 +08:00
|
|
|
movq foo@GOTPCREL, %rax
|
2010-10-07 03:27:21 +08:00
|
|
|
movq zed, %rax
|
2014-03-29 14:26:49 +08:00
|
|
|
movsd .Lfoo+4(%rip), %xmm1
|
2010-10-05 23:43:32 +08:00
|
|
|
|
2010-09-25 13:42:19 +08:00
|
|
|
.section .sec1,"aM",@progbits,16
|
|
|
|
.Lfoo:
|
2010-10-07 03:27:21 +08:00
|
|
|
zed:
|
|
|
|
.global zed
|
2010-09-25 13:42:19 +08:00
|
|
|
|
2010-10-06 07:57:26 +08:00
|
|
|
.section bar,"ax",@progbits
|
|
|
|
foo:
|
|
|
|
|
2013-04-12 12:06:46 +08:00
|
|
|
// CHECK: Relocations [
|
2015-04-15 23:59:37 +08:00
|
|
|
// CHECK-NEXT: Section {{.*}} .rela.text {
|
2015-06-23 19:31:32 +08:00
|
|
|
// CHECK-NEXT: 0x{{[^ ]+}} R_X86_64_PC32 .Lfoo 0x{{[^ ]+}}
|
2013-04-12 12:06:46 +08:00
|
|
|
// CHECK-NEXT: 0x{{[^ ]+}} R_X86_64_32 .sec1 0x{{[^ ]+}}
|
2015-06-23 19:31:32 +08:00
|
|
|
// CHECK-NEXT: 0x{{[^ ]+}} R_X86_64_32 .Lfoo 0x{{[^ ]+}}
|
2013-04-12 12:06:46 +08:00
|
|
|
// CHECK-NEXT: 0x{{[^ ]+}} R_X86_64_PLT32 foo 0x{{[^ ]+}}
|
|
|
|
// CHECK-NEXT: 0x{{[^ ]+}} R_X86_64_GOTPCREL foo 0x{{[^ ]+}}
|
|
|
|
// CHECK-NEXT: 0x{{[^ ]+}} R_X86_64_32S zed 0x{{[^ ]+}}
|
2014-03-29 14:26:49 +08:00
|
|
|
// CHECK-NEXT: 0x{{[^ ]+}} R_X86_64_PC32 .sec1 0x{{[^ ]+}}
|
2013-04-12 12:06:46 +08:00
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: ]
|