xref: /minix3/external/bsd/llvm/dist/llvm/test/MC/ELF/section-sym.s (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | llvm-readobj -s -t -r --expand-relocs | FileCheck %s
2*0a6a1f1dSLionel Sambuc
3*0a6a1f1dSLionel Sambuc.section foo, "aG", @progbits, f1, comdat
4*0a6a1f1dSLionel Sambuc.section foo, "G", @progbits, f2, comdat
5*0a6a1f1dSLionel Sambuc.section bar
6*0a6a1f1dSLionel Sambuc.long foo
7*0a6a1f1dSLionel Sambuc
8*0a6a1f1dSLionel Sambuc// Test that the relocation points to the first section foo.
9*0a6a1f1dSLionel Sambuc
10*0a6a1f1dSLionel Sambuc// The first seciton foo has index 6
11*0a6a1f1dSLionel Sambuc// CHECK:      Section {
12*0a6a1f1dSLionel Sambuc// CHECK:        Index:   6
13*0a6a1f1dSLionel Sambuc// CHECK-NEXT:   Name:    foo (28)
14*0a6a1f1dSLionel Sambuc// CHECK-NEXT:   Type:    SHT_PROGBITS (0x1)
15*0a6a1f1dSLionel Sambuc// CHECK-NEXT:   Flags [ (0x202)
16*0a6a1f1dSLionel Sambuc// CHECK-NEXT:     SHF_ALLOC (0x2)
17*0a6a1f1dSLionel Sambuc// CHECK-NEXT:     SHF_GROUP (0x200)
18*0a6a1f1dSLionel Sambuc// CHECK-NEXT:   ]
19*0a6a1f1dSLionel Sambuc// CHECK-NEXT:   Address:         0x0
20*0a6a1f1dSLionel Sambuc// CHECK-NEXT:   Offset:  0x50
21*0a6a1f1dSLionel Sambuc// CHECK-NEXT:   Size:    0
22*0a6a1f1dSLionel Sambuc// CHECK-NEXT:   Link:    0
23*0a6a1f1dSLionel Sambuc// CHECK-NEXT:   Info:    0
24*0a6a1f1dSLionel Sambuc// CHECK-NEXT:   AddressAlignment:        1
25*0a6a1f1dSLionel Sambuc// CHECK-NEXT:   EntrySize:       0
26*0a6a1f1dSLionel Sambuc// CHECK-NEXT: }
27*0a6a1f1dSLionel Sambuc// CHECK-NEXT: Section {
28*0a6a1f1dSLionel Sambuc// CHECK-NEXT:   Index:   7
29*0a6a1f1dSLionel Sambuc// CHECK-NEXT:   Name:    foo (28)
30*0a6a1f1dSLionel Sambuc// CHECK-NEXT:   Type:    SHT_PROGBITS (0x1)
31*0a6a1f1dSLionel Sambuc// CHECK-NEXT:   Flags [ (0x200)
32*0a6a1f1dSLionel Sambuc// CHECK-NEXT:     SHF_GROUP (0x200)
33*0a6a1f1dSLionel Sambuc// CHECK-NEXT:   ]
34*0a6a1f1dSLionel Sambuc// CHECK-NEXT:   Address:         0x0
35*0a6a1f1dSLionel Sambuc// CHECK-NEXT:   Offset:  0x50
36*0a6a1f1dSLionel Sambuc// CHECK-NEXT:   Size:    0
37*0a6a1f1dSLionel Sambuc// CHECK-NEXT:   Link:    0
38*0a6a1f1dSLionel Sambuc// CHECK-NEXT:   Info:    0
39*0a6a1f1dSLionel Sambuc// CHECK-NEXT:   AddressAlignment:        1
40*0a6a1f1dSLionel Sambuc// CHECK-NEXT:   EntrySize:       0
41*0a6a1f1dSLionel Sambuc// CHECK-NEXT: }
42*0a6a1f1dSLionel Sambuc
43*0a6a1f1dSLionel Sambuc// The relocation points to symbol 6
44*0a6a1f1dSLionel Sambuc// CHECK:      Relocations [
45*0a6a1f1dSLionel Sambuc// CHECK-NEXT:   Section (9) .relabar {
46*0a6a1f1dSLionel Sambuc// CHECK-NEXT:     Relocation {
47*0a6a1f1dSLionel Sambuc// CHECK-NEXT:       Offset:  0x0
48*0a6a1f1dSLionel Sambuc// CHECK-NEXT:       Type:    R_X86_64_32 (10)
49*0a6a1f1dSLionel Sambuc// CHECK-NEXT:       Symbol:  foo (6)
50*0a6a1f1dSLionel Sambuc// CHECK-NEXT:       Addend:  0x0
51*0a6a1f1dSLionel Sambuc// CHECK-NEXT:     }
52*0a6a1f1dSLionel Sambuc// CHECK-NEXT:   }
53*0a6a1f1dSLionel Sambuc// CHECK-NEXT: ]
54*0a6a1f1dSLionel Sambuc
55*0a6a1f1dSLionel Sambuc
56*0a6a1f1dSLionel Sambuc// The symbol 6 corresponds section 6
57*0a6a1f1dSLionel Sambuc// CHECK: Symbols [
58*0a6a1f1dSLionel Sambuc
59*0a6a1f1dSLionel Sambuc// symbol 0
60*0a6a1f1dSLionel Sambuc// CHECK-NOT: Name
61*0a6a1f1dSLionel Sambuc// CHECK: Name:
62*0a6a1f1dSLionel Sambuc
63*0a6a1f1dSLionel Sambuc// symbol 1
64*0a6a1f1dSLionel Sambuc// CHECK-NOT: Name
65*0a6a1f1dSLionel Sambuc// CHECK: Name:    f1
66*0a6a1f1dSLionel Sambuc
67*0a6a1f1dSLionel Sambuc// symbol 2
68*0a6a1f1dSLionel Sambuc// CHECK-NOT: Name
69*0a6a1f1dSLionel Sambuc// CHECK: Name:    f2
70*0a6a1f1dSLionel Sambuc
71*0a6a1f1dSLionel Sambuc// symbol 3
72*0a6a1f1dSLionel Sambuc// CHECK-NOT: Name
73*0a6a1f1dSLionel Sambuc// CHECK: Name:    .text
74*0a6a1f1dSLionel Sambuc
75*0a6a1f1dSLionel Sambuc// symbol 4
76*0a6a1f1dSLionel Sambuc// CHECK-NOT: Name
77*0a6a1f1dSLionel Sambuc// CHECK: Name:    .data
78*0a6a1f1dSLionel Sambuc
79*0a6a1f1dSLionel Sambuc// symbol 5
80*0a6a1f1dSLionel Sambuc// CHECK-NOT: Name
81*0a6a1f1dSLionel Sambuc// CHECK: Name:    .bss
82*0a6a1f1dSLionel Sambuc
83*0a6a1f1dSLionel Sambuc// symbol 6
84*0a6a1f1dSLionel Sambuc// CHECK-NOT: Name
85*0a6a1f1dSLionel Sambuc// CHECK: Name:    foo
86*0a6a1f1dSLionel Sambuc// CHECK: Section: foo (0x6)
87*0a6a1f1dSLionel Sambuc
88*0a6a1f1dSLionel Sambuc// symbol 7
89*0a6a1f1dSLionel Sambuc// CHECK-NOT: Name
90*0a6a1f1dSLionel Sambuc// CHECK: Name:    foo
91*0a6a1f1dSLionel Sambuc// CHECK: Section: foo (0x7)
92