2013-04-12 04:06:46 +00:00
|
|
|
// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | llvm-readobj -r | FileCheck %s
|
2010-09-25 05:42:19 +00:00
|
|
|
|
2014-03-29 06:26:49 +00: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 15:43:32 +00:00
|
|
|
|
|
|
|
|
|
|
|
movsd .Lfoo(%rip), %xmm1
|
|
|
|
movl $.Lfoo, %edi
|
|
|
|
movl $.Lfoo+2, %edi
|
2010-10-05 23:57:26 +00:00
|
|
|
jmp foo@PLT
|
2010-10-06 16:23:36 +00:00
|
|
|
movq foo@GOTPCREL, %rax
|
2010-10-06 19:27:21 +00:00
|
|
|
movq zed, %rax
|
2014-03-29 06:26:49 +00:00
|
|
|
movsd .Lfoo+4(%rip), %xmm1
|
2010-10-05 15:43:32 +00:00
|
|
|
|
2010-09-25 05:42:19 +00:00
|
|
|
.section .sec1,"aM",@progbits,16
|
|
|
|
.Lfoo:
|
2010-10-06 19:27:21 +00:00
|
|
|
zed:
|
|
|
|
.global zed
|
2010-09-25 05:42:19 +00:00
|
|
|
|
2010-10-05 23:57:26 +00:00
|
|
|
.section bar,"ax",@progbits
|
|
|
|
foo:
|
|
|
|
|
2013-04-12 04:06:46 +00:00
|
|
|
// CHECK: Relocations [
|
2013-05-30 03:05:14 +00:00
|
|
|
// CHECK-NEXT: Section (2) .rela.text {
|
2013-04-12 04:06:46 +00:00
|
|
|
// CHECK-NEXT: 0x{{[^ ]+}} R_X86_64_PC32 .Lfoo 0x{{[^ ]+}}
|
|
|
|
// CHECK-NEXT: 0x{{[^ ]+}} R_X86_64_32 .sec1 0x{{[^ ]+}}
|
|
|
|
// CHECK-NEXT: 0x{{[^ ]+}} R_X86_64_32 .Lfoo 0x{{[^ ]+}}
|
|
|
|
// 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 06:26:49 +00:00
|
|
|
// CHECK-NEXT: 0x{{[^ ]+}} R_X86_64_PC32 .sec1 0x{{[^ ]+}}
|
2013-04-12 04:06:46 +00:00
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: ]
|