Implement major new fastisel functionality: the matcher can now handle immediates...
[oota-llvm.git] / test / MC / ELF / weakref-reloc.s
1 // RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | elf-dump  | FileCheck %s
2
3 // Test that the relocations point to the correct symbols. We used to get the
4 // symbol index wrong for weakrefs when creating _GLOBAL_OFFSET_TABLE_.
5
6         .weakref        bar,foo
7         call    zed@PLT
8         call    bar
9
10 // CHECK:      # Relocation 0x00000000
11 // CHECK-NEXT: (('r_offset', 0x00000001)
12 // CHECK-NEXT:  ('r_sym', 0x00000006)
13 // CHECK-NEXT:  ('r_type', 0x00000004)
14 // CHECK-NEXT:  ('r_addend', 0xfffffffc)
15 // CHECK-NEXT: ),
16 // CHECK-NEXT: # Relocation 0x00000001
17 // CHECK-NEXT: (('r_offset', 0x00000006)
18 // CHECK-NEXT:  ('r_sym', 0x00000005)
19 // CHECK-NEXT:  ('r_type', 0x00000002)
20 // CHECK-NEXT:  ('r_addend', 0xfffffffc)
21 // CHECK-NEXT: ),
22
23 // CHECK:      # Symbol 0x00000004
24 // CHECK-NEXT: (('st_name', 0x00000009) # '_GLOBAL_OFFSET_TABLE_'
25 // CHECK-NEXT:  ('st_bind', 0x00000001)
26 // CHECK-NEXT:  ('st_type', 0x00000000)
27 // CHECK-NEXT:  ('st_other', 0x00000000)
28 // CHECK-NEXT:  ('st_shndx', 0x00000000)
29 // CHECK-NEXT:  ('st_value', 0x0000000000000000)
30 // CHECK-NEXT:  ('st_size', 0x0000000000000000)
31 // CHECK-NEXT: ),
32 // CHECK-NEXT: # Symbol 0x00000005
33 // CHECK-NEXT: (('st_name', 0x00000001) # 'foo'
34 // CHECK-NEXT:  ('st_bind', 0x00000002)
35 // CHECK-NEXT:  ('st_type', 0x00000000)
36 // CHECK-NEXT:  ('st_other', 0x00000000)
37 // CHECK-NEXT:  ('st_shndx', 0x00000000)
38 // CHECK-NEXT:  ('st_value', 0x0000000000000000)
39 // CHECK-NEXT:  ('st_size', 0x0000000000000000)
40 // CHECK-NEXT: ),
41 // CHECK-NEXT: # Symbol 0x00000006
42 // CHECK-NEXT: (('st_name', 0x00000005) # 'zed'
43 // CHECK-NEXT:  ('st_bind', 0x00000001)
44 // CHECK-NEXT:  ('st_type', 0x00000000)
45 // CHECK-NEXT:  ('st_other', 0x00000000)
46 // CHECK-NEXT:  ('st_shndx', 0x00000000)
47 // CHECK-NEXT:  ('st_value', 0x0000000000000000)
48 // CHECK-NEXT:  ('st_size', 0x0000000000000000)
49 // CHECK-NEXT: ),