1 // RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | elf-dump --dump-section-data | FileCheck %s
3 // Test that PIC relocations with local symbols in a mergeable section are done
4 // with a reference to the symbol. Not sure if this is a linker limitation,
5 // but this matches the behavior of gas.
7 // Non-PIC relocations with 0 offset don't use the symbol.
10 movsd .Lfoo(%rip), %xmm1
14 .section .sec1,"aM",@progbits,16
17 // Section 4 is "sec1"
19 // CHECK-NEXT: (('sh_name', 18) # '.sec1'
21 // Symbol number 1 is .Lfoo
23 // CHECK-NEXT: (('st_name', 1) # '.Lfoo'
25 // Symbol number 5 is section 4
27 // CHECK-NEXT: (('st_name', 0) # ''
28 // CHECK-NEXT: ('st_bind', 0)
29 // CHECK-NEXT: ('st_type', 3)
30 // CHECK-NEXT: ('st_other', 0)
31 // CHECK-NEXT: ('st_shndx', 4)
33 // Relocation 0 refers to symbol 1
34 // CHECK: ('_relocations', [
35 // CHECK-NEXT: # Relocation 0
36 // CHECK-NEXT: (('r_offset',
37 // CHECK-NEXT: ('r_sym', 1)
38 // CHECK-NEXT: ('r_type', 2
39 // CHECK-NEXT: ('r_addend',
42 // Relocation 1 refers to symbol 5
43 // CHECK-NEXT: # Relocation 1
44 // CHECK-NEXT: (('r_offset',
45 // CHECK-NEXT: ('r_sym', 5)
46 // CHECK-NEXT: ('r_type', 10)
47 // CHECK-NEXT: ('r_addend',
50 // Relocation 2 refers to symbol 1
51 // CHECK-NEXT: # Relocation 2
52 // CHECK-NEXT: (('r_offset',
53 // CHECK-NEXT: ('r_sym', 1)
54 // CHECK-NEXT: ('r_type', 10
55 // CHECK-NEXT: ('r_addend',