1 // RUN
: llvm-mc
-filetype
=obj
-triple x86_64-pc-linux-gnu
%s
-o
- | elf-dump | FileCheck
%s
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_.
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)
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)
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)
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)
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)