llvm.org GIT mirror llvm / 7931a61
Change how we handle section symbols on ELF. On ELF every section can have a corresponding section symbol. When in an assembly file we have .quad .text the '.text' refers to that symbol. The way we used to handle them is to leave .text an undefined symbol until the very end when the object writer would map them to the actual section symbol. The problem with that is that anything before the end would see an undefined symbol. This could result in bad diagnostics (test/MC/AArch64/label-arithmetic-diags-elf.s), or incorrect results when using the asm streamer (est/MC/Mips/expansion-jal-sym-pic.s). Fixing this will also allow using the section symbol earlier for setting sh_link of SHF_METADATA sections. This patch includes a few hacks to avoid changing our behaviour when handling conflicts between section symbols and other symbols. I reported pr31850 to track that. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293936 91177308-0d34-0410-b5e6-96231b3b80d8 Rafael Espindola 3 years ago
18 changed file(s) with 114 addition(s) and 151 deletion(s). Raw diff Collapse all Expand all
8181
8282 /// Bindings of names to symbols.
8383 SymbolTable Symbols;
84
85 /// Sections can have a corresponding symbol. This maps one to the
86 /// other.
87 DenseMap SectionSymbols;
8884
8985 /// A mapping from a local label number and an instance count to a symbol.
9086 /// For example, in the assembly
231227 MCSymbol *getOrCreateDirectionalLocalSymbol(unsigned LocalLabelVal,
232228 unsigned Instance);
233229
230 MCSectionELF *createELFSectionImpl(StringRef Section, unsigned Type,
231 unsigned Flags, SectionKind K,
232 unsigned EntrySize,
233 const MCSymbolELF *Group,
234 unsigned UniqueID,
235 const MCSectionELF *Associated);
236
234237 public:
235238 explicit MCContext(const MCAsmInfo *MAI, const MCRegisterInfo *MRI,
236239 const MCObjectFileInfo *MOFI,
286289 ///
287290 /// \param Name - The symbol name, which must be unique across all symbols.
288291 MCSymbol *getOrCreateSymbol(const Twine &Name);
289
290 MCSymbolELF *getOrCreateSectionSymbol(const MCSectionELF &Section);
291292
292293 /// Gets a symbol that will be defined to the final stack offset of a local
293294 /// variable after codegen.
339340
340341 MCSectionELF *getELFSection(const Twine &Section, unsigned Type,
341342 unsigned Flags) {
342 return getELFSection(Section, Type, Flags, nullptr);
343 }
344
345 MCSectionELF *getELFSection(const Twine &Section, unsigned Type,
346 unsigned Flags, const char *BeginSymName) {
347 return getELFSection(Section, Type, Flags, 0, "", BeginSymName);
343 return getELFSection(Section, Type, Flags, 0, "");
348344 }
349345
350346 MCSectionELF *getELFSection(const Twine &Section, unsigned Type,
351347 unsigned Flags, unsigned EntrySize,
352348 const Twine &Group) {
353 return getELFSection(Section, Type, Flags, EntrySize, Group, nullptr);
349 return getELFSection(Section, Type, Flags, EntrySize, Group, ~0);
354350 }
355351
356352 MCSectionELF *getELFSection(const Twine &Section, unsigned Type,
357353 unsigned Flags, unsigned EntrySize,
358 const Twine &Group, const char *BeginSymName) {
359 return getELFSection(Section, Type, Flags, EntrySize, Group, ~0,
360 BeginSymName);
361 }
362
363 MCSectionELF *getELFSection(const Twine &Section, unsigned Type,
364 unsigned Flags, unsigned EntrySize,
365 const Twine &Group, unsigned UniqueID) {
366 return getELFSection(Section, Type, Flags, EntrySize, Group, UniqueID,
367 nullptr);
368 }
369
370 MCSectionELF *getELFSection(const Twine &Section, unsigned Type,
371 unsigned Flags, unsigned EntrySize,
372 const Twine &Group, unsigned UniqueID,
373 const char *BeginSymName);
354 const Twine &Group, unsigned UniqueID);
374355
375356 MCSectionELF *getELFSection(const Twine &Section, unsigned Type,
376357 unsigned Flags, unsigned EntrySize,
377358 const MCSymbolELF *Group, unsigned UniqueID,
378 const char *BeginSymName,
379359 const MCSectionELF *Associated);
380360
381361 /// Get a section with the provided group identifier. This section is
370370
371371 void ELFObjectWriter::executePostLayoutBinding(MCAssembler &Asm,
372372 const MCAsmLayout &Layout) {
373 // Section symbols are used as definitions for undefined symbols with matching
374 // names. If there are multiple sections with the same name, the first one is
375 // used.
376 for (const MCSection &Sec : Asm) {
377 const MCSymbol *Begin = Sec.getBeginSymbol();
378 if (!Begin)
379 continue;
380
381 const MCSymbol *Alias = Asm.getContext().lookupSymbol(Begin->getName());
382 if (!Alias || !Alias->isUndefined())
383 continue;
384
385 Renames.insert(
386 std::make_pair(cast(Alias), cast(Begin)));
387 }
388
389373 // The presence of symbol versions causes undefined symbols and
390374 // versions declared with @@@ to be renamed.
391375 for (const MCSymbol &A : Asm.symbols()) {
7979 MCSubtargetAllocator.DestroyAll();
8080 UsedNames.clear();
8181 Symbols.clear();
82 SectionSymbols.clear();
8382 Allocator.Reset();
8483 Instances.clear();
8584 CompilationDir.clear();
121120 Sym = createSymbol(NameRef, false, false);
122121
123122 return Sym;
124 }
125
126 MCSymbolELF *MCContext::getOrCreateSectionSymbol(const MCSectionELF &Section) {
127 MCSymbol *&Sym = SectionSymbols[&Section];
128 if (Sym)
129 return cast(Sym);
130
131 StringRef Name = Section.getSectionName();
132 auto NameIter = UsedNames.insert(std::make_pair(Name, false)).first;
133 Sym = new (&*NameIter, *this) MCSymbolELF(&*NameIter, /*isTemporary*/ false);
134
135 return cast(Sym);
136123 }
137124
138125 MCSymbol *MCContext::getOrCreateFrameAllocSymbol(StringRef FuncName,
315302 const_cast(Section)->setSectionName(CachedName);
316303 }
317304
305 MCSectionELF *MCContext::createELFSectionImpl(StringRef Section, unsigned Type,
306 unsigned Flags, SectionKind K,
307 unsigned EntrySize,
308 const MCSymbolELF *Group,
309 unsigned UniqueID,
310 const MCSectionELF *Associated) {
311
312 MCSymbolELF *R;
313 MCSymbol *&Sym = Symbols[Section];
314 if (Sym && Sym->isUndefined()) {
315 R = cast(Sym);
316 } else {
317 auto NameIter = UsedNames.insert(std::make_pair(Section, false)).first;
318 R = new (&*NameIter, *this) MCSymbolELF(&*NameIter, /*isTemporary*/ false);
319 if (!Sym)
320 Sym = R;
321 }
322 R->setBinding(ELF::STB_LOCAL);
323 R->setType(ELF::STT_SECTION);
324 R->setRedefinable(true);
325
326 auto *Ret = new (ELFAllocator.Allocate()) MCSectionELF(
327 Section, Type, Flags, K, EntrySize, Group, UniqueID, R, Associated);
328
329 auto *F = new MCDataFragment();
330 Ret->getFragmentList().insert(Ret->begin(), F);
331 F->setParent(Ret);
332 R->setFragment(F);
333
334 return Ret;
335 }
336
318337 MCSectionELF *MCContext::createELFRelSection(const Twine &Name, unsigned Type,
319338 unsigned Flags, unsigned EntrySize,
320339 const MCSymbolELF *Group,
324343 std::tie(I, Inserted) =
325344 ELFRelSecNames.insert(std::make_pair(Name.str(), true));
326345
327 return new (ELFAllocator.Allocate())
328 MCSectionELF(I->getKey(), Type, Flags, SectionKind::getReadOnly(),
329 EntrySize, Group, true, nullptr, Associated);
346 return createELFSectionImpl(I->getKey(), Type, Flags,
347 SectionKind::getReadOnly(), EntrySize, Group,
348 true, Associated);
330349 }
331350
332351 MCSectionELF *MCContext::getELFNamedSection(const Twine &Prefix,
338357
339358 MCSectionELF *MCContext::getELFSection(const Twine &Section, unsigned Type,
340359 unsigned Flags, unsigned EntrySize,
341 const Twine &Group, unsigned UniqueID,
342 const char *BeginSymName) {
360 const Twine &Group, unsigned UniqueID) {
343361 MCSymbolELF *GroupSym = nullptr;
344362 if (!Group.isTriviallyEmpty() && !Group.str().empty())
345363 GroupSym = cast(getOrCreateSymbol(Group));
346364
347365 return getELFSection(Section, Type, Flags, EntrySize, GroupSym, UniqueID,
348 BeginSymName, nullptr);
366 nullptr);
349367 }
350368
351369 MCSectionELF *MCContext::getELFSection(const Twine &Section, unsigned Type,
352370 unsigned Flags, unsigned EntrySize,
353371 const MCSymbolELF *GroupSym,
354372 unsigned UniqueID,
355 const char *BeginSymName,
356373 const MCSectionELF *Associated) {
357374 StringRef Group = "";
358375 if (GroupSym)
374391 else
375392 Kind = SectionKind::getReadOnly();
376393
377 MCSymbol *Begin = nullptr;
378 if (BeginSymName)
379 Begin = createTempSymbol(BeginSymName, false);
380
381 MCSectionELF *Result = new (ELFAllocator.Allocate())
382 MCSectionELF(CachedName, Type, Flags, Kind, EntrySize, GroupSym, UniqueID,
383 Begin, Associated);
394 MCSectionELF *Result = createELFSectionImpl(
395 CachedName, Type, Flags, Kind, EntrySize, GroupSym, UniqueID, Associated);
384396 Entry.second = Result;
385397 return Result;
386398 }
387399
388400 MCSectionELF *MCContext::createELFGroupSection(const MCSymbolELF *Group) {
389 MCSectionELF *Result = new (ELFAllocator.Allocate())
390 MCSectionELF(".group", ELF::SHT_GROUP, 0, SectionKind::getReadOnly(), 4,
391 Group, ~0, nullptr, nullptr);
392 return Result;
401 return createELFSectionImpl(".group", ELF::SHT_GROUP, 0,
402 SectionKind::getReadOnly(), 4, Group, ~0,
403 nullptr);
393404 }
394405
395406 MCSectionCOFF *MCContext::getCOFFSection(StringRef Section,
147147 Asm.registerSymbol(*Grp);
148148
149149 this->MCObjectStreamer::ChangeSection(Section, Subsection);
150 MCContext &Ctx = getContext();
151 auto *Begin = cast_or_null(Section->getBeginSymbol());
152 if (!Begin) {
153 Begin = Ctx.getOrCreateSectionSymbol(*SectionELF);
154 Section->setBeginSymbol(Begin);
155 }
156 if (Begin->isUndefined()) {
157 Asm.registerSymbol(*Begin);
158 Begin->setType(ELF::STT_SECTION);
159 }
150 Asm.registerSymbol(*Section->getBeginSymbol());
160151 }
161152
162153 void MCELFStreamer::EmitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol) {
505505 COFFDebugTypesSection = nullptr;
506506
507507 // Debug Info Sections.
508 DwarfAbbrevSection = Ctx->getELFSection(".debug_abbrev", ELF::SHT_PROGBITS, 0,
509 "section_abbrev");
510 DwarfInfoSection =
511 Ctx->getELFSection(".debug_info", ELF::SHT_PROGBITS, 0, "section_info");
508 DwarfAbbrevSection =
509 Ctx->getELFSection(".debug_abbrev", ELF::SHT_PROGBITS, 0);
510 DwarfInfoSection = Ctx->getELFSection(".debug_info", ELF::SHT_PROGBITS, 0);
512511 DwarfLineSection = Ctx->getELFSection(".debug_line", ELF::SHT_PROGBITS, 0);
513512 DwarfFrameSection = Ctx->getELFSection(".debug_frame", ELF::SHT_PROGBITS, 0);
514513 DwarfPubNamesSection =
526525 DwarfARangesSection =
527526 Ctx->getELFSection(".debug_aranges", ELF::SHT_PROGBITS, 0);
528527 DwarfRangesSection =
529 Ctx->getELFSection(".debug_ranges", ELF::SHT_PROGBITS, 0, "debug_range");
530 DwarfMacinfoSection = Ctx->getELFSection(".debug_macinfo", ELF::SHT_PROGBITS,
531 0, "debug_macinfo");
528 Ctx->getELFSection(".debug_ranges", ELF::SHT_PROGBITS, 0);
529 DwarfMacinfoSection =
530 Ctx->getELFSection(".debug_macinfo", ELF::SHT_PROGBITS, 0);
532531
533532 // DWARF5 Experimental Debug Info
534533
535534 // Accelerator Tables
536535 DwarfAccelNamesSection =
537 Ctx->getELFSection(".apple_names", ELF::SHT_PROGBITS, 0, "names_begin");
536 Ctx->getELFSection(".apple_names", ELF::SHT_PROGBITS, 0);
538537 DwarfAccelObjCSection =
539 Ctx->getELFSection(".apple_objc", ELF::SHT_PROGBITS, 0, "objc_begin");
540 DwarfAccelNamespaceSection = Ctx->getELFSection(
541 ".apple_namespaces", ELF::SHT_PROGBITS, 0, "namespac_begin");
538 Ctx->getELFSection(".apple_objc", ELF::SHT_PROGBITS, 0);
539 DwarfAccelNamespaceSection =
540 Ctx->getELFSection(".apple_namespaces", ELF::SHT_PROGBITS, 0);
542541 DwarfAccelTypesSection =
543 Ctx->getELFSection(".apple_types", ELF::SHT_PROGBITS, 0, "types_begin");
542 Ctx->getELFSection(".apple_types", ELF::SHT_PROGBITS, 0);
544543
545544 // Fission Sections
546545 DwarfInfoDWOSection =
555554 DwarfLineDWOSection =
556555 Ctx->getELFSection(".debug_line.dwo", ELF::SHT_PROGBITS, 0);
557556 DwarfLocDWOSection =
558 Ctx->getELFSection(".debug_loc.dwo", ELF::SHT_PROGBITS, 0, "skel_loc");
557 Ctx->getELFSection(".debug_loc.dwo", ELF::SHT_PROGBITS, 0);
559558 DwarfStrOffDWOSection =
560559 Ctx->getELFSection(".debug_str_offsets.dwo", ELF::SHT_PROGBITS, 0);
561 DwarfAddrSection =
562 Ctx->getELFSection(".debug_addr", ELF::SHT_PROGBITS, 0, "addr_sec");
560 DwarfAddrSection = Ctx->getELFSection(".debug_addr", ELF::SHT_PROGBITS, 0);
563561
564562 // DWP Sections
565563 DwarfCUIndexSection =
44164416 return Error(Pow2AlignmentLoc, "invalid '.comm' or '.lcomm' directive "
44174417 "alignment, can't be less than zero");
44184418
4419 Sym->redefineIfPossible();
44194420 if (!Sym->isUndefined())
44204421 return Error(IDLoc, "invalid symbol redefinition");
44214422
4141
4242 void MCSymbolELF::setBinding(unsigned Binding) const {
4343 setIsBindingSet();
44 if (getType() == ELF::STT_SECTION && Binding != ELF::STB_LOCAL)
45 setType(ELF::STT_NOTYPE);
4446 unsigned Val;
4547 switch (Binding) {
4648 default:
9294
9395 void MCSymbolELF::setType(unsigned Type) const {
9496 unsigned Val;
97 if (Type == ELF::STT_SECTION && getBinding() != ELF::STB_LOCAL)
98 return;
9599 switch (Type) {
96100 default:
97101 llvm_unreachable("Unsupported Binding");
11371137 const MCSymbolELF *Group = FnSection.getGroup();
11381138 if (Group)
11391139 Flags |= ELF::SHF_GROUP;
1140 MCSectionELF *EHSection =
1141 getContext().getELFSection(EHSecName, Type, Flags, 0, Group,
1142 FnSection.getUniqueID(), nullptr, &FnSection);
1140 MCSectionELF *EHSection = getContext().getELFSection(
1141 EHSecName, Type, Flags, 0, Group, FnSection.getUniqueID(), &FnSection);
11431142
11441143 assert(EHSection && "Failed to get the required EH section");
11451144
0 ; RUN: %llc_dwarf -O2 %s -o - | FileCheck %s
11 ; Check struct X for dead variable xyz from inlined function foo.
22
3 ; CHECK: section_info
3 ; CHECK: .section .debug_info,"",@progbits
44 ; CHECK: DW_TAG_structure_type
55 ; CHECK-NEXT: DW_AT_name
66
2424 !7 = distinct !DILexicalBlock(line: 3, column: 12, file: !14, scope: !0)
2525 !8 = !DICompositeType(tag: DW_TAG_array_type, align: 32, file: !14, scope: !2, baseType: !5, elements: !9)
2626 !9 = !{!10}
27 ;CHECK: section_info:
27 ;CHECK: .section .debug_info,"",@progbits
2828 ;CHECK: DW_TAG_subrange_type
2929 ;CHECK-NEXT: DW_AT_type
3030 ;CHECK-NOT: DW_AT_lower_bound
0 ; RUN: llc -mtriple mips-linux-gnu -O2 %s -o - | FileCheck %s
11 ; Check struct X for dead variable xyz from inlined function foo.
22
3 ; CHECK: section_info
3 ; CHECK: .section .debug_info,"",@progbits
44 ; CHECK: DW_TAG_structure_type
55 ; CHECK-NEXT: info_string
66
1212 ; DW_OP_GNU_push_tls_address
1313 ; CHECK-NEXT: .byte 224
1414 ; check that the expected TLS address description is the first thing in the debug_addr section
15 ; CHECK: debug_addr
16 ; CHECK-NEXT: .Laddr_sec:
15 ; CHECK: .section .debug_addr,"",@progbits
1716 ; CHECK-NEXT: .quad tls@DTPREL+32768
1817
1918 source_filename = "test/DebugInfo/PowerPC/tls-fission.ll"
4545 ; CHECK: DW_TAG_variable
4646 ; Make sure this is relocatable.
4747 ; and test that we don't create the labels to emit a correct COFF relocation
48 ; ELF-ASM: .quad .Lsection_info+[[TYPE]] # DW_AT_type
48 ; ELF-ASM: .quad .debug_info+[[TYPE]] # DW_AT_type
4949 ; COFF-ASM: .secrel32 .Lsection_info+[[TYPE]] # DW_AT_type
5050 ; DARWIN-ASM2: .quad [[TYPE]] ## DW_AT_type
5151 ; DARWIN-ASM4: .long [[TYPE]] ## DW_AT_type
7777
7878 ; check that the expected TLS address description is the first thing in the debug_addr section
7979 ; FISSION: .section .debug_addr
80 ; FISSION: addr_sec:
8180 ; FISSION-NEXT: .quad tls@DTPOFF
8281 ; FISSION-NEXT: .quad glbl
8382 ; FISSION-NOT: .quad glbl
6262
6363 add w0, w1, #(sec_y - sec_x)
6464 cmp w0, #(sec_y - sec_x)
65 // CHECK: error: symbol 'sec_x' can not be undefined in a subtraction expression
65 // CHECK: error: Cannot represent a difference across sections
6666 // CHECK-NEXT: add w0, w1, #(sec_y - sec_x)
6767 // CHECK-NEXT: ^
68 // CHECK: error: symbol 'sec_x' can not be undefined in a subtraction expression
68 // CHECK: error: Cannot represent a difference across sections
6969 // CHECK-NEXT: cmp w0, #(sec_y - sec_x)
7070 // CHECK-NEXT: ^
3333 // ASM: .section .debug_info
3434
3535 // ASM: .section .debug_abbrev
36 // ASM-NEXT: .Lsection_abbrev:
3736 // ASM-NEXT: [[ABBREV_LABEL:.Ltmp[0-9]+]]
3837
3938 // Second instance of the section has the CU
8686 # MICRO: b .text # encoding: [0x94,0x00,A,A]
8787 # MICRO: # fixup A - offset: 0, value: .text, kind: fixup_MICROMIPS_PC16_S1
8888
89 # ELF-O32: 10 00 ff ff b 0
90 # ELF-O32-NEXT: 00000018: R_MIPS_PC16 .text
89 # ELF-O32: 10 00 ff f9 b -24
90 # ELF-O32-NEXT: 00 00 00 00 nop
9191
92 # ELF-NXX: 10 00 00 00 b 4
93 # ELF-NXX-NEXT: R_MIPS_PC16/R_MIPS_NONE/R_MIPS_NONE .text
92 # ELF-NXX: 10 00 ff f9 b -24
93 # ELF-NXX-NEXT: 00 00 00 00 nop
9494
9595 j 1f
9696 nop
150150 jal .text
151151 nop
152152
153 # FIXME: The .text section MCSymbol isn't created when printing assembly. However,
154 # it is created when generating an ELF object file.
155153 # Expanding "jal .text":
156 # O32-FIXME: lw $25, %call16(.text)($gp) # encoding: [0x8f,0x99,A,A]
157 # O32-FIXME: # fixup A - offset: 0, value: %got(.text), kind: fixup_Mips_GOT_CALL
158
159 # ELF-O32: 8f 99 00 00 lw $25, 0($gp)
160 # ELF-O32-NEXT: R_MIPS_CALL16 .text
161
162 # N32-FIXME: lw $25, %call16(.text)($gp) # encoding: [0x8f,0x99,A,A]
163 # N32-FIXME: # fixup A - offset: 0, value: %call16(.text), kind: fixup_Mips_GOT_DISP
164
165 # ELF-N32: 8f 99 00 00 lw $25, 0($gp)
166 # ELF-N32-NEXT: R_MIPS_CALL16/R_MIPS_NONE/R_MIPS_NONE .text
167
168 # N64-FIXME: ld $25, %call16(.text)($gp) # encoding: [0xdf,0x99,A,A]
169 # N64-FIXME: # fixup A - offset: 0, value: %call16(.text), kind: fixup_Mips_GOT_DISP
170
171 # ELF-N64: df 99 00 00 ld $25, 0($gp)
172 # ELF-N64-NEXT: R_MIPS_CALL16/R_MIPS_NONE/R_MIPS_NONE .text
173
174 # O32-MM-FIXME: lw $25, %got(.text)($gp) # encoding: [0xff,0x3c,A,A]
175 # O32-MM-FIXME: # fixup A - offset: 0, value: %got(.text), kind: fixup_MICROMIPS_GOT16
176 # O32-MM-FIXME: addiu $25, $25, %lo(.text) # encoding: [0x33,0x39,A,A]
177 # O32-MM-FIXME: # fixup A - offset: 0, value: %lo(.text), kind: fixup_MICROMIPS_LO16
178
179 # N32-MM-FIXME: lw $25, %got_disp(.text)($gp) # encoding: [0xff,0x3c,A,A]
180 # N32-MM-FIXME: # fixup A - offset: 0, value: %got_disp(.text), kind: fixup_MICROMIPS_GOT_DISP
181
182 # N64-MM-FIXME: ld $25, %got_disp(.text)($gp) # encoding: [0xdf,0x99,A,A]
183 # N64-MM-FIXME: # fixup A - offset: 0, value: %got_disp(.text), kind: fixup_MICROMIPS_GOT_DISP
154 # O32: lw $25, %got(.text)($gp) # encoding: [0x8f,0x99,A,A]
155 # O32-NEXT: # fixup A - offset: 0, value: %got(.text), kind: fixup_Mips_GOT
156
157 # ELF-O32: 8f 99 00 00 lw $25, 0($gp)
158 # ELF-O32-NEXT: R_MIPS_GOT16 .text
159
160 # N32: lw $25, %got_disp(.text)($gp) # encoding: [0x8f,0x99,A,A]
161 # N32-NEXT: # fixup A - offset: 0, value: %got_disp(.text), kind: fixup_Mips_GOT_DISP
162
163 # ELF-N32: 8f 99 00 00 lw $25, 0($gp)
164 # ELF-N32-NEXT: R_MIPS_GOT_DISP/R_MIPS_NONE/R_MIPS_NONE .text
165
166 # N64: ld $25, %got_disp(.text)($gp) # encoding: [0xdf,0x99,A,A]
167 # N64-NEXT: # fixup A - offset: 0, value: %got_disp(.text), kind: fixup_Mips_GOT_DISP
168
169 # ELF-N64: df 99 00 00 ld $25, 0($gp)
170 # ELF-N64-NEXT: R_MIPS_GOT_DISP/R_MIPS_NONE/R_MIPS_NONE .text
171
172 # O32-MM: lw $25, %got(.text)($gp) # encoding: [0xff,0x3c,A,A]
173 # O32-MM-NEXT: # fixup A - offset: 0, value: %got(.text), kind: fixup_MICROMIPS_GOT16
174 # O32-MM-NEXT: addiu $25, $25, %lo(.text) # encoding: [0x33,0x39,A,A]
175 # O32-MM-NEXT: # fixup A - offset: 0, value: %lo(.text), kind: fixup_MICROMIPS_LO16
176
177 # N32-MM: lw $25, %got_disp(.text)($gp) # encoding: [0xff,0x3c,A,A]
178 # N32-MM-NEXT: # fixup A - offset: 0, value: %got_disp(.text), kind: fixup_MICROMIPS_GOT_DISP
179
180 # N64-MM: ld $25, %got_disp(.text)($gp) # encoding: [0xdf,0x99,A,A]
181 # N64-MM-NEXT: # fixup A - offset: 0, value: %got_disp(.text), kind: fixup_MICROMIPS_GOT_DISP
184182
185183 # MIPS: jalr $25 # encoding: [0x03,0x20,0xf8,0x09]
186184 # MM: jalr $ra, $25 # encoding: [0x03,0xf9,0x0f,0x3c]
198196
199197 # ELF-O32: 8f 99 00 00 lw $25, 0($gp)
200198 # ELF-O32-NEXT: R_MIPS_GOT16 .text
201 # ELF-O32-NEXT: 27 39 00 54 addiu $25, $25, 84
199 # ELF-O32-NEXT: 27 39 00 58 addiu $25, $25, 88
202200 # ELF-O32-NEXT: R_MIPS_LO16 .text
203201
204202 # N32: lw $25, %got_disp($tmp0)($gp) # encoding: [0x8f,0x99,A,A]
240238
241239 # ELF-O32: 8f 99 00 00 lw $25, 0($gp)
242240 # ELF-O32-NEXT: R_MIPS_GOT16 .text
243 # ELF-O32-NEXT: 27 39 00 60 addiu $25, $25, 96
241 # ELF-O32-NEXT: 27 39 00 64 addiu $25, $25, 100
244242 # ELF-O32-NEXT: R_MIPS_LO16 .text
245243
246244 # N32-FIXME: lw $25, %got_disp(forward_local)($gp) # encoding: [0x8f,0x99,A,A]