2013-04-12 06:06:46 +02:00
|
|
|
// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | llvm-readobj -s -sr -t | FileCheck %s
|
2010-09-20 21:20:47 +02:00
|
|
|
|
2010-10-27 22:28:07 +02:00
|
|
|
// Test that we produce the correct relocation.
|
2010-09-20 21:20:47 +02:00
|
|
|
|
2010-09-30 05:11:42 +02:00
|
|
|
bar:
|
2010-10-27 22:28:07 +02:00
|
|
|
movl $bar, %edx # R_X86_64_32
|
|
|
|
movq $bar, %rdx # R_X86_64_32S
|
|
|
|
movq $bar, bar(%rip) # R_X86_64_32S
|
|
|
|
movl bar, %edx # R_X86_64_32S
|
|
|
|
movq bar, %rdx # R_X86_64_32S
|
|
|
|
.long bar # R_X86_64_32
|
|
|
|
leaq foo@GOTTPOFF(%rip), %rax # R_X86_64_GOTTPOFF
|
|
|
|
leaq foo@TLSGD(%rip), %rax # R_X86_64_TLSGD
|
|
|
|
leaq foo@TPOFF(%rax), %rax # R_X86_64_TPOFF32
|
2010-10-28 17:02:40 +02:00
|
|
|
leaq foo@TLSLD(%rip), %rdi # R_X86_64_TLSLD
|
2011-01-23 17:11:25 +01:00
|
|
|
leaq foo@dtpoff(%rax), %rcx # R_X86_64_DTPOFF32
|
2010-12-16 23:50:01 +01:00
|
|
|
pushq $bar
|
2010-12-27 03:03:24 +01:00
|
|
|
movq foo(%rip), %rdx
|
2011-01-01 20:05:35 +01:00
|
|
|
leaq foo-bar(%r14),%r14
|
2011-05-19 22:32:34 +02:00
|
|
|
addq $bar,%rax # R_X86_64_32S
|
2013-06-28 06:24:32 +02:00
|
|
|
.quad foo@DTPOFF
|
2013-09-22 07:30:16 +02:00
|
|
|
movabsq $baz@TPOFF, %rax
|
2010-09-20 21:20:47 +02:00
|
|
|
|
2013-04-12 06:06:46 +02:00
|
|
|
// CHECK: Section {
|
2013-05-30 05:05:14 +02:00
|
|
|
// CHECK: Name: .rela.text
|
2013-04-12 06:06:46 +02:00
|
|
|
// CHECK: Relocations [
|
|
|
|
// CHECK-NEXT: 0x1 R_X86_64_32 .text
|
|
|
|
// CHECK-NEXT: 0x8 R_X86_64_32S .text
|
|
|
|
// CHECK-NEXT: 0x13 R_X86_64_32S .text
|
|
|
|
// CHECK-NEXT: 0x1A R_X86_64_32S .text
|
|
|
|
// CHECK-NEXT: 0x22 R_X86_64_32S .text
|
|
|
|
// CHECK-NEXT: 0x26 R_X86_64_32 .text
|
|
|
|
// CHECK-NEXT: 0x2D R_X86_64_GOTTPOFF foo 0xFFFFFFFFFFFFFFFC
|
|
|
|
// CHECK-NEXT: 0x34 R_X86_64_TLSGD foo 0xFFFFFFFFFFFFFFFC
|
|
|
|
// CHECK-NEXT: 0x3B R_X86_64_TPOFF32 foo 0x0
|
|
|
|
// CHECK-NEXT: 0x42 R_X86_64_TLSLD foo 0xFFFFFFFFFFFFFFFC
|
|
|
|
// CHECK-NEXT: 0x49 R_X86_64_DTPOFF32 foo 0x0
|
|
|
|
// CHECK-NEXT: 0x4E R_X86_64_32S .text 0x0
|
|
|
|
// CHECK-NEXT: 0x55 R_X86_64_PC32 foo 0xFFFFFFFFFFFFFFFC
|
|
|
|
// CHECK-NEXT: 0x5C R_X86_64_PC32 foo 0x5C
|
|
|
|
// CHECK-NEXT: 0x63 R_X86_64_32S .text 0x0
|
2013-06-28 06:24:32 +02:00
|
|
|
// CHECK-NEXT: 0x67 R_X86_64_DTPOFF64 foo 0x0
|
2013-09-22 07:30:16 +02:00
|
|
|
// CHECK-NEXT: 0x71 R_X86_64_TPOFF64 baz 0x0
|
2013-04-12 06:06:46 +02:00
|
|
|
// CHECK-NEXT: ]
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
|
|
|
|
// CHECK: Symbol {
|
|
|
|
// CHECK: Name: .text (0)
|
|
|
|
// CHECK-NEXT: Value:
|
|
|
|
// CHECK-NEXT: Size:
|
|
|
|
// CHECK-NEXT: Binding: Local
|
|
|
|
// CHECK-NEXT: Type: Section
|
|
|
|
// CHECK-NEXT: Other: 0
|
|
|
|
// CHECK-NEXT: Section: .text (0x1)
|
|
|
|
// CHECK-NEXT: }
|