llvm.org GIT mirror llvm / c1819f5
[WebAssembly] Add new explicit relocation types for PIC relocations See https://github.com/WebAssembly/tool-conventions/pull/106 Differential Revision: https://reviews.llvm.org/D59907 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357710 91177308-0d34-0410-b5e6-96231b3b80d8 Sam Clegg 1 year, 7 months ago
12 changed file(s) with 190 addition(s) and 49 deletion(s). Raw diff Collapse all Expand all
11 #error "WASM_RELOC must be defined"
22 #endif
33
4 WASM_RELOC(R_WASM_FUNCTION_INDEX_LEB, 0)
5 WASM_RELOC(R_WASM_TABLE_INDEX_SLEB, 1)
6 WASM_RELOC(R_WASM_TABLE_INDEX_I32, 2)
7 WASM_RELOC(R_WASM_MEMORY_ADDR_LEB, 3)
8 WASM_RELOC(R_WASM_MEMORY_ADDR_SLEB, 4)
9 WASM_RELOC(R_WASM_MEMORY_ADDR_I32, 5)
10 WASM_RELOC(R_WASM_TYPE_INDEX_LEB, 6)
11 WASM_RELOC(R_WASM_GLOBAL_INDEX_LEB, 7)
12 WASM_RELOC(R_WASM_FUNCTION_OFFSET_I32, 8)
13 WASM_RELOC(R_WASM_SECTION_OFFSET_I32, 9)
14 WASM_RELOC(R_WASM_EVENT_INDEX_LEB, 10)
4 WASM_RELOC(R_WASM_FUNCTION_INDEX_LEB, 0)
5 WASM_RELOC(R_WASM_TABLE_INDEX_SLEB, 1)
6 WASM_RELOC(R_WASM_TABLE_INDEX_I32, 2)
7 WASM_RELOC(R_WASM_MEMORY_ADDR_LEB, 3)
8 WASM_RELOC(R_WASM_MEMORY_ADDR_SLEB, 4)
9 WASM_RELOC(R_WASM_MEMORY_ADDR_I32, 5)
10 WASM_RELOC(R_WASM_TYPE_INDEX_LEB, 6)
11 WASM_RELOC(R_WASM_GLOBAL_INDEX_LEB, 7)
12 WASM_RELOC(R_WASM_FUNCTION_OFFSET_I32, 8)
13 WASM_RELOC(R_WASM_SECTION_OFFSET_I32, 9)
14 WASM_RELOC(R_WASM_EVENT_INDEX_LEB, 10)
15 WASM_RELOC(R_WASM_MEMORY_ADDR_REL_SLEB, 11)
16 WASM_RELOC(R_WASM_TABLE_INDEX_REL_SLEB, 12)
283283 VK_Hexagon_IE,
284284 VK_Hexagon_IE_GOT,
285285
286 VK_WebAssembly_TYPEINDEX,// Reference to a symbol's type (signature)
286 VK_WASM_TYPEINDEX, // Reference to a symbol's type (signature)
287 VK_WASM_MBREL, // Memory address relative to memory base
288 VK_WASM_TBREL, // Table index relative to table bare
287289
288290 VK_AMDGPU_GOTPCREL32_LO, // symbol@gotpcrel32@lo
289291 VK_AMDGPU_GOTPCREL32_HI, // symbol@gotpcrel32@hi
301301 case VK_Hexagon_LD_PLT: return "LDPLT";
302302 case VK_Hexagon_IE: return "IE";
303303 case VK_Hexagon_IE_GOT: return "IEGOT";
304 case VK_WebAssembly_TYPEINDEX: return "TYPEINDEX";
304 case VK_WASM_TYPEINDEX: return "TYPEINDEX";
305 case VK_WASM_MBREL: return "MBREL";
306 case VK_WASM_TBREL: return "TBREL";
305307 case VK_AMDGPU_GOTPCREL32_LO: return "gotpcrel32@lo";
306308 case VK_AMDGPU_GOTPCREL32_HI: return "gotpcrel32@hi";
307309 case VK_AMDGPU_REL32_LO: return "rel32@lo";
414416 .Case("lo8", VK_AVR_LO8)
415417 .Case("hi8", VK_AVR_HI8)
416418 .Case("hlo8", VK_AVR_HLO8)
417 .Case("typeindex", VK_WebAssembly_TYPEINDEX)
419 .Case("typeindex", VK_WASM_TYPEINDEX)
420 .Case("tbrel", VK_WASM_TBREL)
421 .Case("mbrel", VK_WASM_MBREL)
418422 .Case("gotpcrel32@lo", VK_AMDGPU_GOTPCREL32_LO)
419423 .Case("gotpcrel32@hi", VK_AMDGPU_GOTPCREL32_HI)
420424 .Case("rel32@lo", VK_AMDGPU_REL32_LO)
150150 switch (Type) {
151151 case wasm::R_WASM_MEMORY_ADDR_LEB:
152152 case wasm::R_WASM_MEMORY_ADDR_SLEB:
153 case wasm::R_WASM_MEMORY_ADDR_REL_SLEB:
153154 case wasm::R_WASM_MEMORY_ADDR_I32:
154155 case wasm::R_WASM_FUNCTION_OFFSET_I32:
155156 case wasm::R_WASM_SECTION_OFFSET_I32:
579580 }
580581
581582 switch (RelEntry.Type) {
583 case wasm::R_WASM_TABLE_INDEX_REL_SLEB:
582584 case wasm::R_WASM_TABLE_INDEX_SLEB:
583585 case wasm::R_WASM_TABLE_INDEX_I32: {
584586 // Provisional value is table address of the resolved symbol itself
603605 }
604606 case wasm::R_WASM_MEMORY_ADDR_LEB:
605607 case wasm::R_WASM_MEMORY_ADDR_I32:
608 case wasm::R_WASM_MEMORY_ADDR_REL_SLEB:
606609 case wasm::R_WASM_MEMORY_ADDR_SLEB: {
607610 // Provisional value is address of the global
608611 const MCSymbolWasm *Sym = resolveSymbol(*RelEntry.Symbol);
697700 writeI32(Stream, Value, Offset);
698701 break;
699702 case wasm::R_WASM_TABLE_INDEX_SLEB:
703 case wasm::R_WASM_TABLE_INDEX_REL_SLEB:
700704 case wasm::R_WASM_MEMORY_ADDR_SLEB:
705 case wasm::R_WASM_MEMORY_ADDR_REL_SLEB:
701706 writePatchableSLEB(Stream, Value, Offset);
702707 break;
703708 default:
766766 case wasm::R_WASM_FUNCTION_INDEX_LEB:
767767 case wasm::R_WASM_TABLE_INDEX_SLEB:
768768 case wasm::R_WASM_TABLE_INDEX_I32:
769 case wasm::R_WASM_TABLE_INDEX_REL_SLEB:
769770 if (!isValidFunctionSymbol(Reloc.Index))
770771 return make_error("Bad relocation function index",
771772 object_error::parse_failed);
792793 case wasm::R_WASM_MEMORY_ADDR_LEB:
793794 case wasm::R_WASM_MEMORY_ADDR_SLEB:
794795 case wasm::R_WASM_MEMORY_ADDR_I32:
796 case wasm::R_WASM_MEMORY_ADDR_REL_SLEB:
795797 if (!isValidDataSymbol(Reloc.Index))
796798 return make_error("Bad relocation data index",
797799 object_error::parse_failed);
8989 enum TOF {
9090 MO_NO_FLAG = 0,
9191
92 // Address of data symbol via a wasm global. This adds a level of indirection
93 // similar to the GOT on native platforms.
92 // On a symbol operand this indicates that the immediate is a wasm global
93 // index. The value of the wasm global will be set to the symbol address at
94 // runtime. This adds a level of indirection similar to the GOT on native
95 // platforms.
9496 MO_GOT,
97
98 // On a symbol operand this indicates that the immediate is the symbol
99 // address relative the __memory_base wasm global.
100 // Only applicable to data symbols.
101 MO_MEMORY_BASE_REL,
102
103 // On a symbol operand this indicates that the immediate is the symbol
104 // address relative the __table_base wasm global.
105 // Only applicable to function symbols.
106 MO_TABLE_BASE_REL,
95107 };
96108
97109 } // end namespace WebAssemblyII
4141 WebAssemblyWasmObjectWriter::WebAssemblyWasmObjectWriter(bool Is64Bit)
4242 : MCWasmObjectTargetWriter(Is64Bit) {}
4343
44 static bool isFunctionSignatureRef(const MCSymbolRefExpr *Ref) {
45 return Ref->getKind() == MCSymbolRefExpr::VK_WebAssembly_TYPEINDEX;
46 }
47
48 static bool isGOTRef(const MCSymbolRefExpr *Ref) {
49 return Ref->getKind() == MCSymbolRefExpr::VK_GOT;
50 }
51
5244 static const MCSection *getFixupSection(const MCExpr *Expr) {
5345 if (auto SyExp = dyn_cast(Expr)) {
5446 if (SyExp->getSymbol().isInSection())
7466 assert(RefA);
7567 auto& SymA = cast(RefA->getSymbol());
7668
69 MCSymbolRefExpr::VariantKind Modifier = Target.getAccessVariant();
70
71 switch (Modifier) {
72 case MCSymbolRefExpr::VK_GOT:
73 return wasm::R_WASM_GLOBAL_INDEX_LEB;
74 case MCSymbolRefExpr::VK_WASM_TBREL:
75 assert(SymA.isFunction());
76 return wasm::R_WASM_TABLE_INDEX_REL_SLEB;
77 case MCSymbolRefExpr::VK_WASM_MBREL:
78 assert(SymA.isData());
79 return wasm::R_WASM_MEMORY_ADDR_REL_SLEB;
80 case MCSymbolRefExpr::VK_WASM_TYPEINDEX:
81 return wasm::R_WASM_TYPE_INDEX_LEB;
82 default:
83 break;
84 }
85
7786 switch (unsigned(Fixup.getKind())) {
7887 case WebAssembly::fixup_sleb128_i32:
7988 if (SymA.isFunction())
8291 case WebAssembly::fixup_sleb128_i64:
8392 llvm_unreachable("fixup_sleb128_i64 not implemented yet");
8493 case WebAssembly::fixup_uleb128_i32:
85 if (SymA.isGlobal() || isGOTRef(RefA))
94 if (SymA.isGlobal())
8695 return wasm::R_WASM_GLOBAL_INDEX_LEB;
87 if (SymA.isFunction()) {
88 if (isFunctionSignatureRef(RefA))
89 return wasm::R_WASM_TYPE_INDEX_LEB;
90 else
91 return wasm::R_WASM_FUNCTION_INDEX_LEB;
92 }
96 if (SymA.isFunction())
97 return wasm::R_WASM_FUNCTION_INDEX_LEB;
9398 if (SymA.isEvent())
9499 return wasm::R_WASM_EVENT_INDEX_LEB;
95100 return wasm::R_WASM_MEMORY_ADDR_LEB;
10021002 MachineFunction &MF = DAG.getMachineFunction();
10031003 MVT PtrVT = getPointerTy(MF.getDataLayout());
10041004 const char *BaseName;
1005 if (GV->getValueType()->isFunctionTy())
1005 if (GV->getValueType()->isFunctionTy()) {
10061006 BaseName = MF.createExternalSymbolName("__table_base");
1007 else
1007 OperandFlags = WebAssemblyII::MO_TABLE_BASE_REL;
1008 }
1009 else {
10081010 BaseName = MF.createExternalSymbolName("__memory_base");
1011 OperandFlags = WebAssemblyII::MO_MEMORY_BASE_REL;
1012 }
10091013 SDValue BaseAddr =
10101014 DAG.getNode(WebAssemblyISD::Wrapper, DL, PtrVT,
10111015 DAG.getTargetExternalSymbol(BaseName, PtrVT));
10121016
10131017 SDValue SymAddr = DAG.getNode(
10141018 WebAssemblyISD::WrapperPIC, DL, VT,
1015 DAG.getTargetGlobalAddress(GA->getGlobal(), DL, VT, GA->getOffset()));
1019 DAG.getTargetGlobalAddress(GA->getGlobal(), DL, VT, GA->getOffset(),
1020 OperandFlags));
10161021
10171022 return DAG.getNode(ISD::ADD, DL, VT, BaseAddr, SymAddr);
10181023 } else {
121121
122122 MCOperand WebAssemblyMCInstLower::lowerSymbolOperand(const MachineOperand &MO,
123123 MCSymbol *Sym) const {
124 bool isGOT = MO.getTargetFlags() == WebAssemblyII::MO_GOT;
125 MCSymbolRefExpr::VariantKind Kind =
126 isGOT ? MCSymbolRefExpr::VK_GOT : MCSymbolRefExpr::VK_None;
124 MCSymbolRefExpr::VariantKind Kind = MCSymbolRefExpr::VK_None;
125 unsigned TargetFlags = MO.getTargetFlags();
126
127 switch (TargetFlags) {
128 case WebAssemblyII::MO_NO_FLAG:
129 break;
130 case WebAssemblyII::MO_GOT:
131 Kind = MCSymbolRefExpr::VK_GOT;
132 break;
133 case WebAssemblyII::MO_MEMORY_BASE_REL:
134 Kind = MCSymbolRefExpr::VK_WASM_MBREL;
135 break;
136 case WebAssemblyII::MO_TABLE_BASE_REL:
137 Kind = MCSymbolRefExpr::VK_WASM_TBREL;
138 break;
139 default:
140 llvm_unreachable("Unknown target flag on GV operand");
141 }
142
127143 const MCExpr *Expr = MCSymbolRefExpr::create(Sym, Kind, Ctx);
128144
129145 if (MO.getOffset() != 0) {
130146 const auto *WasmSym = cast(Sym);
131 if (isGOT)
147 if (TargetFlags == WebAssemblyII::MO_GOT)
132148 report_fatal_error("GOT symbol references do not support offsets");
133
134149 if (WasmSym->isFunction())
135150 report_fatal_error("Function addresses with offsets not supported");
136151 if (WasmSym->isGlobal())
216231 WasmSym->setType(wasm::WASM_SYMBOL_TYPE_FUNCTION);
217232
218233 const MCExpr *Expr = MCSymbolRefExpr::create(
219 WasmSym, MCSymbolRefExpr::VK_WebAssembly_TYPEINDEX, Ctx);
234 WasmSym, MCSymbolRefExpr::VK_WASM_TYPEINDEX, Ctx);
220235 MCOp = MCOperand::createExpr(Expr);
221236 break;
222237 }
44
55 declare i32 @foo()
66 declare i32 @bar()
7 declare hidden i32 @hidden_function();
7 declare hidden i32 @hidden_function()
88
99 @indirect_func = global i32 ()* @foo
1010
1111 define void @call_indirect_func() {
1212 ; CHECK-LABEL: call_indirect_func:
1313 ; CHECK: global.get $push[[L0:[0-9]+]]=, __memory_base{{$}}
14 ; CHECK-NEXT: i32.const $push[[L1:[0-9]+]]=, indirect_func{{$}}
14 ; CHECK-NEXT: i32.const $push[[L1:[0-9]+]]=, indirect_func@MBREL{{$}}
1515 ; CHECK-NEXT: i32.add $push[[L2:[0-9]+]]=, $pop[[L0]], $pop[[L1]]{{$}}
1616 ; CHECK-NEXT: i32.load $push[[L3:[0-9]+]]=, 0($pop[[L2]]){{$}}
1717 ; CHECK-NEXT: i32.call_indirect $push[[L4:[0-9]+]]=, $pop[[L3]]{{$}}
4242 define i8* @get_function_address_hidden() {
4343 ; CHECK-LABEL: get_function_address_hidden:
4444 ; CHECK: global.get $push[[L0:[0-9]+]]=, __table_base{{$}}
45 ; CHECK-NEXT: i32.const $push[[L1:[0-9]+]]=, hidden_function{{$}}
45 ; CHECK-NEXT: i32.const $push[[L1:[0-9]+]]=, hidden_function@TBREL{{$}}
4646 ; CHECK-NEXT: i32.add $push[[L2:[0-9]+]]=, $pop[[L0]], $pop[[L1]]{{$}}
4747 ; CHECK-NEXT: return $pop[[L2]]{{$}}
4848 ; CHECK-NEXT: end_function{{$}}
2020 define i32 @load_hidden_global() {
2121 ; CHECK-LABEL: load_hidden_global:
2222 ; PIC: global.get $push[[L0:[0-9]+]]=, __memory_base{{$}}
23 ; PIC-NEXT: i32.const $push[[L1:[0-9]+]]=, hidden_global{{$}}
23 ; PIC-NEXT: i32.const $push[[L1:[0-9]+]]=, hidden_global@MBREL{{$}}
2424 ; PIC-NEXT: i32.add $push[[L2:[0-9]+]]=, $pop[[L0]], $pop[[L1]]{{$}}
2525 ; PIC-NEXT: i32.load $push[[L3:[0-9]+]]=, 0($pop[[L2]]){{$}}
2626
3535 define i32 @load_hidden_global_offset() {
3636 ; CHECK-LABEL: load_hidden_global_offset:
3737 ; PIC: global.get $push[[L0:[0-9]+]]=, __memory_base{{$}}
38 ; PIC-NEXT: i32.const $push[[L1:[0-9]+]]=, hidden_global_array{{$}}
38 ; PIC-NEXT: i32.const $push[[L1:[0-9]+]]=, hidden_global_array@MBREL{{$}}
3939 ; PIC-NEXT: i32.add $push[[L2:[0-9]+]]=, $pop[[L0]], $pop[[L1:[0-9]+]]{{$}}
4040 ; PIC-NEXT: i32.const $push[[L3:[0-9]+]]=, 20{{$}}
4141 ; PIC-NEXT: i32.add $push[[L4:[0-9]+]]=, $pop[[L2]], $pop[[L3]]{{$}}
5555 define void @store_hidden_global(i32 %n) {
5656 ; CHECK-LABEL: store_hidden_global:
5757 ; PIC: global.get $push[[L0:[0-9]+]]=, __memory_base{{$}}
58 ; PIC-NEXT: i32.const $push[[L1:[0-9]+]]=, hidden_global{{$}}
58 ; PIC-NEXT: i32.const $push[[L1:[0-9]+]]=, hidden_global@MBREL{{$}}
5959 ; PIC-NEXT: i32.add $push[[L2:[0-9]+]]=, $pop[[L0]], $pop[[L1]]{{$}}
6060 ; PIC-NEXT: i32.store 0($pop[[L2]]), $0{{$}}
6161
7070 define void @store_hidden_global_offset(i32 %n) {
7171 ; CHECK-LABEL: store_hidden_global_offset:
7272 ; PIC: global.get $push[[L0:[0-9]+]]=, __memory_base{{$}}
73 ; PIC-NEXT: i32.const $push[[L1:[0-9]+]]=, hidden_global_array{{$}}
73 ; PIC-NEXT: i32.const $push[[L1:[0-9]+]]=, hidden_global_array@MBREL{{$}}
7474 ; PIC-NEXT: i32.add $push[[L2:[0-9]+]]=, $pop[[L0]], $pop[[L1]]{{$}}
7575 ; PIC-NEXT: i32.const $push[[L3:[0-9]+]]=, 20{{$}}
7676 ; PIC-NEXT: i32.add $push[[L4:[0-9]+]]=, $pop[[L2]], $pop[[L3]]{{$}}
1515 i32.load 0
1616 end_function
1717
18 load_hidden_data:
19 .functype load_hidden_data () -> (i32)
20 global.get __memory_base
21 i32.const .L.hidden_data@MBREL
22 i32.add
23 end_function
24
25 load_hidden_func:
26 .functype load_hidden_func () -> (i32)
27 global.get __table_base
28 i32.const hidden_func@TBREL
29 i32.add
30 end_function
31
32 hidden_func:
33 .functype hidden_func () -> (i32)
34 i32.const 0
35 end_function
36
37 .section .rodata.hidden_data,"",@
38 .L.hidden_data:
39 .int8 100
40 .size .L.hidden_data, 1
41
42 #.hidden hidden_func
43 #.hidden hidden_data
1844 .size default_data, 4
1945 .functype default_func () -> (i32)
2046
3359 # CHECK-NEXT: Field: __linear_memory
3460 # CHECK-NEXT: Kind: MEMORY
3561 # CHECK-NEXT: Memory:
36 # CHECK-NEXT: Initial: 0x00000000
62 # CHECK-NEXT: Initial: 0x00000001
3763 # CHECK-NEXT: - Module: env
3864 # CHECK-NEXT: Field: __indirect_function_table
3965 # CHECK-NEXT: Kind: TABLE
5682 # CHECK-NEXT: GlobalType: I32
5783 # CHECK-NEXT: GlobalMutable: true
5884 # CHECK-NEXT: - Type: FUNCTION
59 # CHECK-NEXT: FunctionTypes: [ 0, 0 ]
85 # CHECK-NEXT: FunctionTypes: [ 0, 0, 0, 0, 0 ]
6086 # CHECK-NEXT: - Type: CODE
6187 # CHECK-NEXT: Relocations:
6288 # CHECK-NEXT: - Type: R_WASM_GLOBAL_INDEX_LEB
6591 # CHECK-NEXT: - Type: R_WASM_GLOBAL_INDEX_LEB
6692 # CHECK-NEXT: Index: 3
6793 # CHECK-NEXT: Offset: 0x00000010
94 # CHECK-NEXT: - Type: R_WASM_MEMORY_ADDR_LEB
95 # CHECK-NEXT: Index: 5
96 # CHECK-NEXT: Offset: 0x0000001C
97 # CHECK-NEXT: - Type: R_WASM_MEMORY_ADDR_REL_SLEB
98 # CHECK-NEXT: Index: 6
99 # CHECK-NEXT: Offset: 0x00000022
100 # CHECK-NEXT: - Type: R_WASM_MEMORY_ADDR_LEB
101 # CHECK-NEXT: Index: 8
102 # CHECK-NEXT: Offset: 0x0000002C
103 # CHECK-NEXT: - Type: R_WASM_TABLE_INDEX_REL_SLEB
104 # CHECK-NEXT: Index: 9
105 # CHECK-NEXT: Offset: 0x00000032
68106 # CHECK-NEXT: Functions:
69107 # CHECK-NEXT: - Index: 1
70108 # CHECK-NEXT: Locals: []
72110 # CHECK-NEXT: - Index: 2
73111 # CHECK-NEXT: Locals: []
74112 # CHECK-NEXT: Body: 2381808080002800000B
113 # CHECK-NEXT: - Index: 3
114 # CHECK-NEXT: Locals: []
115 # CHECK-NEXT: Body: 2380808080004180808080006A0B
116 # CHECK-NEXT: - Index: 4
117 # CHECK-NEXT: Locals: []
118 # CHECK-NEXT: Body: 2380808080004180808080006A0B
119 # CHECK-NEXT: - Index: 5
120 # CHECK-NEXT: Locals: []
121 # CHECK-NEXT: Body: 41000B
122 # CHECK-NEXT: - Type: DATA
123 # CHECK-NEXT: Segments:
124 # CHECK-NEXT: - SectionOffset: 6
125 # CHECK-NEXT: InitFlags: 0
126 # CHECK-NEXT: Offset:
127 # CHECK-NEXT: Opcode: I32_CONST
128 # CHECK-NEXT: Value: 0
129 # CHECK-NEXT: Content: '64'
75130 # CHECK-NEXT: - Type: CUSTOM
76131 # CHECK-NEXT: Name: linking
77132 # CHECK-NEXT: Version: 2
95150 # CHECK-NEXT: Name: default_func
96151 # CHECK-NEXT: Flags: [ UNDEFINED ]
97152 # CHECK-NEXT: Function: 0
153 # CHECK-NEXT: - Index: 4
154 # CHECK-NEXT: Kind: FUNCTION
155 # CHECK-NEXT: Name: load_hidden_data
156 # CHECK-NEXT: Flags: [ BINDING_LOCAL ]
157 # CHECK-NEXT: Function: 3
158 # CHECK-NEXT: - Index: 5
159 # CHECK-NEXT: Kind: DATA
160 # CHECK-NEXT: Name: __memory_base
161 # CHECK-NEXT: Flags: [ UNDEFINED ]
162 # CHECK-NEXT: - Index: 6
163 # CHECK-NEXT: Kind: DATA
164 # CHECK-NEXT: Name: .L.hidden_data
165 # CHECK-NEXT: Flags: [ BINDING_LOCAL ]
166 # CHECK-NEXT: Segment: 0
167 # CHECK-NEXT: Size: 1
168 # CHECK-NEXT: - Index: 7
169 # CHECK-NEXT: Kind: FUNCTION
170 # CHECK-NEXT: Name: load_hidden_func
171 # CHECK-NEXT: Flags: [ BINDING_LOCAL ]
172 # CHECK-NEXT: Function: 4
173 # CHECK-NEXT: - Index: 8
174 # CHECK-NEXT: Kind: DATA
175 # CHECK-NEXT: Name: __table_base
176 # CHECK-NEXT: Flags: [ UNDEFINED ]
177 # CHECK-NEXT: - Index: 9
178 # CHECK-NEXT: Kind: FUNCTION
179 # CHECK-NEXT: Name: hidden_func
180 # CHECK-NEXT: Flags: [ BINDING_LOCAL ]
181 # CHECK-NEXT: Function: 5
182 # CHECK-NEXT: SegmentInfo:
183 # CHECK-NEXT: - Index: 0
184 # CHECK-NEXT: Name: .rodata.hidden_data
185 # CHECK-NEXT: Alignment: 0
186 # CHECK-NEXT: Flags: [ ]
98187 # CHECK-NEXT: ...