Fixed some bugs.
[llvm/zpu.git] / test / MC / ELF / relocation.s
blob8d38b86c34c3940f61e0b09eadea6504f47e49a5
1 // RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | elf-dump --dump-section-data | FileCheck %s
3 // Test that we produce the correct relocation.
5 bar:
6 movl $bar, %edx # R_X86_64_32
7 movq $bar, %rdx # R_X86_64_32S
8 movq $bar, bar(%rip) # R_X86_64_32S
9 movl bar, %edx # R_X86_64_32S
10 movq bar, %rdx # R_X86_64_32S
11 .long bar # R_X86_64_32
12 leaq foo@GOTTPOFF(%rip), %rax # R_X86_64_GOTTPOFF
13 leaq foo@TLSGD(%rip), %rax # R_X86_64_TLSGD
14 leaq foo@TPOFF(%rax), %rax # R_X86_64_TPOFF32
15 leaq foo@TLSLD(%rip), %rdi # R_X86_64_TLSLD
16 leaq foo@DTPOFF(%rax), %rcx # R_X86_64_DTPOFF32
18 // CHECK: # Section 0x00000001
19 // CHECK: (('sh_name', 0x00000001) # '.text'
21 // CHECK: # Symbol 0x00000002
22 // CHECK: (('st_name', 0x00000000) # ''
23 // CHECK: ('st_bind', 0x00000000)
24 // CHECK ('st_type', 0x00000003)
25 // CHECK: ('st_other', 0x00000000)
26 // CHECK: ('st_shndx', 0x00000001)
28 // CHECK: # Relocation 0x00000000
29 // CHECK-NEXT: (('r_offset', 0x00000001)
30 // CHECK-NEXT: ('r_sym', 0x00000002)
31 // CHECK-NEXT: ('r_type', 0x0000000a)
32 // CHECK-NEXT: ('r_addend',
34 // CHECK: # Relocation 0x00000001
35 // CHECK-NEXT: (('r_offset', 0x00000008)
36 // CHECK-NEXT: ('r_sym', 0x00000002)
37 // CHECK-NEXT: ('r_type', 0x0000000b)
38 // CHECK-NEXT: ('r_addend',
40 // CHECK: # Relocation 0x00000002
41 // CHECK-NEXT: (('r_offset', 0x00000013)
42 // CHECK-NEXT: ('r_sym', 0x00000002)
43 // CHECK-NEXT: ('r_type', 0x0000000b)
44 // CHECK-NEXT: ('r_addend',
46 // CHECK: # Relocation 0x00000003
47 // CHECK-NEXT: (('r_offset', 0x0000001a)
48 // CHECK-NEXT: ('r_sym', 0x00000002)
49 // CHECK-NEXT: ('r_type', 0x0000000b)
50 // CHECK-NEXT: ('r_addend',
52 // CHECK: # Relocation 0x00000004
53 // CHECK-NEXT: (('r_offset', 0x00000022)
54 // CHECK-NEXT: ('r_sym', 0x00000002)
55 // CHECK-NEXT: ('r_type', 0x0000000b)
56 // CHECK-NEXT: ('r_addend',
58 // CHECK: # Relocation 0x00000005
59 // CHECK-NEXT: (('r_offset', 0x00000026)
60 // CHECK-NEXT: ('r_sym', 0x00000002)
61 // CHECK-NEXT: ('r_type', 0x0000000a)
62 // CHECK-NEXT: ('r_addend',
64 // CHECK: # Relocation 0x00000006
65 // CHECK-NEXT: (('r_offset', 0x0000002d)
66 // CHECK-NEXT: ('r_sym', 0x00000006)
67 // CHECK-NEXT: ('r_type', 0x00000016)
68 // CHECK-NEXT: ('r_addend', 0xfffffffc)
70 // CHECK: # Relocation 0x00000007
71 // CHECK-NEXT: (('r_offset', 0x00000034)
72 // CHECK-NEXT: ('r_sym', 0x00000006)
73 // CHECK-NEXT: ('r_type', 0x00000013)
74 // CHECK-NEXT: ('r_addend', 0xfffffffc)
76 // CHECK: # Relocation 0x00000008
77 // CHECK-NEXT: (('r_offset', 0x0000003b)
78 // CHECK-NEXT: ('r_sym', 0x00000006)
79 // CHECK-NEXT: ('r_type', 0x00000017)
80 // CHECK-NEXT: ('r_addend', 0x00000000)
82 // CHECK: # Relocation 0x00000009
83 // CHECK-NEXT: (('r_offset', 0x00000042)
84 // CHECK-NEXT: ('r_sym', 0x00000006)
85 // CHECK-NEXT: ('r_type', 0x00000014)
86 // CHECK-NEXT: ('r_addend', 0xfffffffc)
88 // CHECK: # Relocation 0x0000000a
89 // CHECK-NEXT: (('r_offset', 0x00000049)
90 // CHECK-NEXT: ('r_sym', 0x00000006)
91 // CHECK-NEXT: ('r_type', 0x00000015)
92 // CHECK-NEXT: ('r_addend', 0x00000000)