LLVM 24.0.0git
MCObjectFileInfo.cpp
Go to the documentation of this file.
1//===-- MCObjectFileInfo.cpp - Object File Information --------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
16#include "llvm/MC/MCAsmInfo.h"
17#include "llvm/MC/MCContext.h"
19#include "llvm/MC/MCSection.h"
29#include "llvm/MC/SectionKind.h"
31
32using namespace llvm;
33
34static bool useCompactUnwind(const Triple &T) {
35 // Only on darwin.
36 if (!T.isOSDarwin())
37 return false;
38
39 // aarch64 always has it.
40 if (T.getArch() == Triple::aarch64 || T.getArch() == Triple::aarch64_32)
41 return true;
42
43 // armv7k always has it.
44 if (T.isWatchABI())
45 return true;
46
47 // Use it on newer version of OS X.
48 if (T.isMacOSX() && !T.isMacOSXVersionLT(10, 6))
49 return true;
50
51 // And the iOS simulator.
52 if (T.isiOS() && T.isX86())
53 return true;
54
55 // The rest of the simulators always have it.
56 if (T.isSimulatorEnvironment())
57 return true;
58
59 // XROS always has it.
60 if (T.isXROS())
61 return true;
62
63 return false;
64}
65
66void MCObjectFileInfo::initMachOMCObjectFileInfo(const Triple &T) {
67 EHFrameSection = Ctx->getMachOSection(
68 "__TEXT", "__eh_frame",
72
73 if (T.isOSDarwin() &&
74 (T.getArch() == Triple::aarch64 || T.getArch() == Triple::aarch64_32 ||
75 T.isSimulatorEnvironment()))
77
78 switch (Ctx->emitDwarfUnwindInfo()) {
82 break;
85 break;
89 break;
90 }
91
93
94 TextSection // .text
95 = Ctx->getMachOSection("__TEXT", "__text",
98 DataSection // .data
99 = Ctx->getMachOSection("__DATA", "__data", 0, SectionKind::getData());
100
101 // BSSSection might not be expected initialized on msvc.
102 BSSSection = nullptr;
103
104 TLSDataSection // .tdata
105 = Ctx->getMachOSection("__DATA", "__thread_data",
108 TLSBSSSection // .tbss
109 = Ctx->getMachOSection("__DATA", "__thread_bss",
112
113 // TODO: Verify datarel below.
114 TLSTLVSection // .tlv
115 = Ctx->getMachOSection("__DATA", "__thread_vars",
118
119 TLSThreadInitSection = Ctx->getMachOSection(
120 "__DATA", "__thread_init", MachO::S_THREAD_LOCAL_INIT_FUNCTION_POINTERS,
122
123 CStringSection // .cstring
124 = Ctx->getMachOSection("__TEXT", "__cstring",
128 = Ctx->getMachOSection("__TEXT","__ustring", 0,
130 FourByteConstantSection // .literal4
131 = Ctx->getMachOSection("__TEXT", "__literal4",
134 EightByteConstantSection // .literal8
135 = Ctx->getMachOSection("__TEXT", "__literal8",
138
139 SixteenByteConstantSection // .literal16
140 = Ctx->getMachOSection("__TEXT", "__literal16",
143
144 ReadOnlySection // .const
145 = Ctx->getMachOSection("__TEXT", "__const", 0,
147
148 // If the target is not powerpc, map the coal sections to the non-coal
149 // sections.
150 //
151 // "__TEXT/__textcoal_nt" => section "__TEXT/__text"
152 // "__TEXT/__const_coal" => section "__TEXT/__const"
153 // "__DATA/__datacoal_nt" => section "__DATA/__data"
154 Triple::ArchType ArchTy = T.getArch();
155
156 ConstDataSection // .const_data
157 = Ctx->getMachOSection("__DATA", "__const", 0,
159
160 if (ArchTy == Triple::ppc || ArchTy == Triple::ppc64) {
162 = Ctx->getMachOSection("__TEXT", "__textcoal_nt",
167 = Ctx->getMachOSection("__TEXT", "__const_coal",
170 DataCoalSection = Ctx->getMachOSection(
171 "__DATA", "__datacoal_nt", MachO::S_COALESCED, SectionKind::getData());
173 } else {
178 }
179
181 = Ctx->getMachOSection("__DATA","__common",
185 = Ctx->getMachOSection("__DATA","__bss", MachO::S_ZEROFILL,
187
188
190 = Ctx->getMachOSection("__DATA", "__la_symbol_ptr",
194 = Ctx->getMachOSection("__DATA", "__nl_symbol_ptr",
197
199 = Ctx->getMachOSection("__DATA", "__thread_ptr",
202
203 AddrSigSection = Ctx->getMachOSection("__DATA", "__llvm_addrsig", 0,
205
206 // Exception Handling.
207 LSDASection = Ctx->getMachOSection("__TEXT", "__gcc_except_tab", 0,
209
210 COFFDebugSymbolsSection = nullptr;
211 COFFDebugTypesSection = nullptr;
213
214 if (useCompactUnwind(T)) {
216 Ctx->getMachOSection("__LD", "__compact_unwind", MachO::S_ATTR_DEBUG,
218
219 if (T.isX86())
220 CompactUnwindDwarfEHFrameOnly = 0x04000000; // UNWIND_X86_64_MODE_DWARF
221 else if (T.getArch() == Triple::aarch64 || T.getArch() == Triple::aarch64_32)
222 CompactUnwindDwarfEHFrameOnly = 0x03000000; // UNWIND_ARM64_MODE_DWARF
223 else if (T.getArch() == Triple::arm || T.getArch() == Triple::thumb)
224 CompactUnwindDwarfEHFrameOnly = 0x04000000; // UNWIND_ARM_MODE_DWARF
225 }
226
227 // Debug Information.
229 Ctx->getMachOSection("__DWARF", "__debug_names", MachO::S_ATTR_DEBUG,
230 SectionKind::getMetadata(), "debug_names_begin");
232 Ctx->getMachOSection("__DWARF", "__apple_names", MachO::S_ATTR_DEBUG,
233 SectionKind::getMetadata(), "names_begin");
235 Ctx->getMachOSection("__DWARF", "__apple_objc", MachO::S_ATTR_DEBUG,
236 SectionKind::getMetadata(), "objc_begin");
237 // 16 character section limit...
239 Ctx->getMachOSection("__DWARF", "__apple_namespac", MachO::S_ATTR_DEBUG,
240 SectionKind::getMetadata(), "namespac_begin");
242 Ctx->getMachOSection("__DWARF", "__apple_types", MachO::S_ATTR_DEBUG,
243 SectionKind::getMetadata(), "types_begin");
244
246 Ctx->getMachOSection("__DWARF", "__swift_ast", MachO::S_ATTR_DEBUG,
248
250 Ctx->getMachOSection("__DWARF", "__debug_abbrev", MachO::S_ATTR_DEBUG,
251 SectionKind::getMetadata(), "section_abbrev");
253 Ctx->getMachOSection("__DWARF", "__debug_info", MachO::S_ATTR_DEBUG,
254 SectionKind::getMetadata(), "section_info");
256 Ctx->getMachOSection("__DWARF", "__debug_line", MachO::S_ATTR_DEBUG,
257 SectionKind::getMetadata(), "section_line");
259 Ctx->getMachOSection("__DWARF", "__debug_line_str", MachO::S_ATTR_DEBUG,
260 SectionKind::getMetadata(), "section_line_str");
262 Ctx->getMachOSection("__DWARF", "__debug_frame", MachO::S_ATTR_DEBUG,
263 SectionKind::getMetadata(), "section_frame");
265 Ctx->getMachOSection("__DWARF", "__debug_pubnames", MachO::S_ATTR_DEBUG,
268 Ctx->getMachOSection("__DWARF", "__debug_pubtypes", MachO::S_ATTR_DEBUG,
271 Ctx->getMachOSection("__DWARF", "__debug_gnu_pubn", MachO::S_ATTR_DEBUG,
274 Ctx->getMachOSection("__DWARF", "__debug_gnu_pubt", MachO::S_ATTR_DEBUG,
277 Ctx->getMachOSection("__DWARF", "__debug_str", MachO::S_ATTR_DEBUG,
278 SectionKind::getMetadata(), "info_string");
280 Ctx->getMachOSection("__DWARF", "__debug_str_offs", MachO::S_ATTR_DEBUG,
281 SectionKind::getMetadata(), "section_str_off");
283 Ctx->getMachOSection("__DWARF", "__debug_addr", MachO::S_ATTR_DEBUG,
284 SectionKind::getMetadata(), "section_info");
286 Ctx->getMachOSection("__DWARF", "__debug_loc", MachO::S_ATTR_DEBUG,
287 SectionKind::getMetadata(), "section_debug_loc");
289 Ctx->getMachOSection("__DWARF", "__debug_loclists", MachO::S_ATTR_DEBUG,
290 SectionKind::getMetadata(), "section_debug_loc");
291
293 Ctx->getMachOSection("__DWARF", "__debug_aranges", MachO::S_ATTR_DEBUG,
296 Ctx->getMachOSection("__DWARF", "__debug_ranges", MachO::S_ATTR_DEBUG,
297 SectionKind::getMetadata(), "debug_range");
299 Ctx->getMachOSection("__DWARF", "__debug_rnglists", MachO::S_ATTR_DEBUG,
300 SectionKind::getMetadata(), "debug_range");
302 Ctx->getMachOSection("__DWARF", "__debug_macinfo", MachO::S_ATTR_DEBUG,
303 SectionKind::getMetadata(), "debug_macinfo");
305 Ctx->getMachOSection("__DWARF", "__debug_macro", MachO::S_ATTR_DEBUG,
306 SectionKind::getMetadata(), "debug_macro");
308 Ctx->getMachOSection("__DWARF", "__debug_inlined", MachO::S_ATTR_DEBUG,
311 Ctx->getMachOSection("__DWARF", "__debug_cu_index", MachO::S_ATTR_DEBUG,
314 Ctx->getMachOSection("__DWARF", "__debug_tu_index", MachO::S_ATTR_DEBUG,
316 StackMapSection = Ctx->getMachOSection("__LLVM_STACKMAPS", "__llvm_stackmaps",
318
319 FaultMapSection = Ctx->getMachOSection("__LLVM_FAULTMAPS", "__llvm_faultmaps",
321
322 RemarksSection = Ctx->getMachOSection(
323 "__LLVM", "__remarks", MachO::S_ATTR_DEBUG, SectionKind::getMetadata());
324
325 // Emit the pseudoprobe sections in the __LLVM segment. Current ld ignores the
326 // __LLVM and __DWARF segment, so the probe metadata is dropped from the final
327 // linked image on every toolchain.
328 PseudoProbeSection = Ctx->getMachOSection(
329 "__LLVM", "__probes", MachO::S_ATTR_DEBUG | MachO::S_ATTR_NO_DEAD_STRIP,
332 Ctx->getMachOSection("__LLVM", "__probe_descs",
335
336 // The architecture of dsymutil makes it very difficult to copy the Swift
337 // reflection metadata sections into the __TEXT segment, so dsymutil creates
338 // these sections in the __DWARF segment instead.
339 if (!Ctx->getSwift5ReflectionSegmentName().empty()) {
340#define HANDLE_SWIFT_SECTION(KIND, MACHO, ELF, COFF) \
341 Swift5ReflectionSections \
342 [llvm::binaryformat::Swift5ReflectionSectionKind::KIND] = \
343 Ctx->getMachOSection(Ctx->getSwift5ReflectionSegmentName().data(), \
344 MACHO, 0, SectionKind::getMetadata());
345#include "llvm/BinaryFormat/Swift.def"
346 }
347
349}
350
351void MCObjectFileInfo::initELFMCObjectFileInfo(const Triple &T, bool Large) {
352 switch (T.getArch()) {
353 case Triple::mips:
354 case Triple::mipsel:
355 case Triple::mips64:
356 case Triple::mips64el:
357 case Triple::nanomips:
358 // We cannot use DW_EH_PE_sdata8 for the large PositionIndependent case
359 // since there is no R_MIPS_PC64 relocation (only a 32-bit version).
360 // In fact DW_EH_PE_sdata4 is enough for us now, and GNU ld doesn't
361 // support pcrel|sdata8 well. Let's use sdata4 for now.
362 if (PositionIndependent)
364 else
365 FDECFIEncoding = Ctx->getAsmInfo().getCodePointerSize() == 4
368 break;
369 case Triple::ppc64:
370 case Triple::ppc64le:
371 case Triple::aarch64:
373 case Triple::x86_64:
375 ((Large || Ctx->getTargetOptions().LargeEHEncoding)
378 break;
379 case Triple::bpfel:
380 case Triple::bpfeb:
382 break;
383 case Triple::hexagon:
385 PositionIndependent ? dwarf::DW_EH_PE_pcrel : dwarf::DW_EH_PE_absptr;
386 break;
387 case Triple::xtensa:
389 break;
390 default:
392 break;
393 }
394
395 unsigned EHSectionType = T.getArch() == Triple::x86_64
398 switch (T.getArch()) {
399 case Triple::x86_64:
400 SFrameABIArch = sframe::ABI::AMD64EndianLittle;
401 break;
402 case Triple::aarch64:
403 SFrameABIArch = sframe::ABI::AArch64EndianLittle;
404 break;
406 SFrameABIArch = sframe::ABI::AArch64EndianBig;
407 break;
408 default:
409 break;
410 }
411
412 // Solaris requires different flags for .eh_frame to seemingly every other
413 // platform.
414 unsigned EHSectionFlags = ELF::SHF_ALLOC;
415 if (T.isOSSolaris() && T.getArch() != Triple::x86_64)
416 EHSectionFlags |= ELF::SHF_WRITE;
417
418 // ELF
419 BSSSection = Ctx->getELFSection(".bss", ELF::SHT_NOBITS,
421
422 TextSection = Ctx->getELFSection(".text", ELF::SHT_PROGBITS,
424
425 DataSection = Ctx->getELFSection(".data", ELF::SHT_PROGBITS,
427
429 Ctx->getELFSection(".rodata", ELF::SHT_PROGBITS, ELF::SHF_ALLOC);
430
432 Ctx->getELFSection(".tdata", ELF::SHT_PROGBITS,
434
435 TLSBSSSection = Ctx->getELFSection(
437
438 DataRelROSection = Ctx->getELFSection(".data.rel.ro", ELF::SHT_PROGBITS,
440
441 MergeableConst4Section = Ctx->getELFSection(
442 ".rodata.cst4", ELF::SHT_PROGBITS, ELF::SHF_ALLOC | ELF::SHF_MERGE, 4);
443
444 MergeableConst8Section = Ctx->getELFSection(
445 ".rodata.cst8", ELF::SHT_PROGBITS, ELF::SHF_ALLOC | ELF::SHF_MERGE, 8);
446
447 MergeableConst16Section = Ctx->getELFSection(
448 ".rodata.cst16", ELF::SHT_PROGBITS, ELF::SHF_ALLOC | ELF::SHF_MERGE, 16);
449
450 MergeableConst32Section = Ctx->getELFSection(
451 ".rodata.cst32", ELF::SHT_PROGBITS, ELF::SHF_ALLOC | ELF::SHF_MERGE, 32);
452
453 // Exception Handling Sections.
454
455 // FIXME: We're emitting LSDA info into a readonly section on ELF, even though
456 // it contains relocatable pointers. In PIC mode, this is probably a big
457 // runtime hit for C++ apps. Either the contents of the LSDA need to be
458 // adjusted or this should be a data section.
459 LSDASection = Ctx->getELFSection(".gcc_except_table", ELF::SHT_PROGBITS,
461
462 COFFDebugSymbolsSection = nullptr;
463 COFFDebugTypesSection = nullptr;
464
465 unsigned DebugSecType = ELF::SHT_PROGBITS;
466
467 // MIPS .debug_* sections should have SHT_MIPS_DWARF section type
468 // to distinguish among sections contain DWARF and ECOFF debug formats.
469 // Sections with ECOFF debug format are obsoleted and marked by SHT_PROGBITS.
470 if (T.isMIPS())
471 DebugSecType = ELF::SHT_MIPS_DWARF;
472
473 // Debug Info Sections.
475 Ctx->getELFSection(".debug_abbrev", DebugSecType, 0);
476 DwarfInfoSection = Ctx->getELFSection(".debug_info", DebugSecType, 0);
477 DwarfLineSection = Ctx->getELFSection(".debug_line", DebugSecType, 0);
479 Ctx->getELFSection(".debug_line_str", DebugSecType,
481 DwarfFrameSection = Ctx->getELFSection(".debug_frame", DebugSecType, 0);
483 Ctx->getELFSection(".debug_pubnames", DebugSecType, 0);
485 Ctx->getELFSection(".debug_pubtypes", DebugSecType, 0);
487 Ctx->getELFSection(".debug_gnu_pubnames", DebugSecType, 0);
489 Ctx->getELFSection(".debug_gnu_pubtypes", DebugSecType, 0);
491 Ctx->getELFSection(".debug_str", DebugSecType,
493 DwarfLocSection = Ctx->getELFSection(".debug_loc", DebugSecType, 0);
495 Ctx->getELFSection(".debug_aranges", DebugSecType, 0);
497 Ctx->getELFSection(".debug_ranges", DebugSecType, 0);
499 Ctx->getELFSection(".debug_macinfo", DebugSecType, 0);
500 DwarfMacroSection = Ctx->getELFSection(".debug_macro", DebugSecType, 0);
501
502 // DWARF5 Experimental Debug Info
503
504 // Accelerator Tables
506 Ctx->getELFSection(".debug_names", ELF::SHT_PROGBITS, 0);
508 Ctx->getELFSection(".apple_names", ELF::SHT_PROGBITS, 0);
510 Ctx->getELFSection(".apple_objc", ELF::SHT_PROGBITS, 0);
512 Ctx->getELFSection(".apple_namespaces", ELF::SHT_PROGBITS, 0);
514 Ctx->getELFSection(".apple_types", ELF::SHT_PROGBITS, 0);
515
516 // String Offset and Address Sections
518 Ctx->getELFSection(".debug_str_offsets", DebugSecType, 0);
519 DwarfAddrSection = Ctx->getELFSection(".debug_addr", DebugSecType, 0);
520 DwarfRnglistsSection = Ctx->getELFSection(".debug_rnglists", DebugSecType, 0);
521 DwarfLoclistsSection = Ctx->getELFSection(".debug_loclists", DebugSecType, 0);
522
523 // Fission Sections
525 Ctx->getELFSection(".debug_info.dwo", DebugSecType, ELF::SHF_EXCLUDE);
527 Ctx->getELFSection(".debug_types.dwo", DebugSecType, ELF::SHF_EXCLUDE);
529 Ctx->getELFSection(".debug_abbrev.dwo", DebugSecType, ELF::SHF_EXCLUDE);
530 DwarfStrDWOSection = Ctx->getELFSection(
531 ".debug_str.dwo", DebugSecType,
534 Ctx->getELFSection(".debug_line.dwo", DebugSecType, ELF::SHF_EXCLUDE);
536 Ctx->getELFSection(".debug_loc.dwo", DebugSecType, ELF::SHF_EXCLUDE);
537 DwarfStrOffDWOSection = Ctx->getELFSection(".debug_str_offsets.dwo",
538 DebugSecType, ELF::SHF_EXCLUDE);
540 Ctx->getELFSection(".debug_rnglists.dwo", DebugSecType, ELF::SHF_EXCLUDE);
542 Ctx->getELFSection(".debug_macinfo.dwo", DebugSecType, ELF::SHF_EXCLUDE);
544 Ctx->getELFSection(".debug_macro.dwo", DebugSecType, ELF::SHF_EXCLUDE);
545
547 Ctx->getELFSection(".debug_loclists.dwo", DebugSecType, ELF::SHF_EXCLUDE);
548
549 // DWP Sections
551 Ctx->getELFSection(".debug_cu_index", DebugSecType, 0);
553 Ctx->getELFSection(".debug_tu_index", DebugSecType, 0);
554
556 Ctx->getELFSection(".llvm_stackmaps", ELF::SHT_PROGBITS, ELF::SHF_ALLOC);
557
559 Ctx->getELFSection(".llvm_faultmaps", ELF::SHT_PROGBITS, ELF::SHF_ALLOC);
560
562 Ctx->getELFSection(".eh_frame", EHSectionType, EHSectionFlags);
563
565 Ctx->getELFSection(".sframe", ELF::SHT_GNU_SFRAME, ELF::SHF_ALLOC);
566
567 StackSizesSection = Ctx->getELFSection(".stack_sizes", ELF::SHT_PROGBITS, 0);
568
569 PseudoProbeSection = Ctx->getELFSection(".pseudo_probe", DebugSecType, 0);
571 Ctx->getELFSection(".pseudo_probe_desc", DebugSecType, 0);
572
573 LLVMStatsSection = Ctx->getELFSection(".llvm_stats", ELF::SHT_PROGBITS, 0);
574}
575
576void MCObjectFileInfo::initGOFFMCObjectFileInfo(const Triple &T) {
577 MCSectionGOFF *RootSDSection = Ctx->getGOFFSection(
580
581 MCSectionGOFF *ADAEDSection = Ctx->getGOFFSection(
583 GOFF::EDAttr{false, false, GOFF::ESD_RMODE_64, GOFF::ESD_NS_Parts,
586 RootSDSection);
587 ADAEDSection->setAlignment(Align(16)); // Quadword
588 ADASection = Ctx->getGOFFSection(
589 SectionKind::getData(), "#S",
590 GOFF::PRAttr{false, GOFF::ESD_EXE_DATA, GOFF::ESD_BST_Strong,
592 ADAEDSection);
593
594 TextSection = Ctx->getGOFFSection(
596 GOFF::EDAttr{true, false, GOFF::ESD_RMODE_64, GOFF::ESD_NS_NormalName,
599 RootSDSection);
600 TextSection->setAlignment(Align(8)); // Doubleword
601
602 MCSectionGOFF *PPA2ListEDSection = Ctx->getGOFFSection(
604 GOFF::EDAttr{true, false, GOFF::ESD_RMODE_64, GOFF::ESD_NS_Parts,
607 RootSDSection);
608 PPA2ListEDSection->setAlignment(Align(8)); // Doubleword
609 PPA2ListSection = Ctx->getGOFFSection(
610 SectionKind::getData(), "@@PPA2",
611 GOFF::PRAttr{true, GOFF::ESD_EXE_DATA, GOFF::ESD_BST_Strong,
613 PPA2ListEDSection);
614 static_cast<MCSectionGOFF *>(PPA2ListSection)->setExternalName(".&ppa2");
615
616 IDRLSection = Ctx->getGOFFSection(
617 SectionKind::getData(), "B_IDRL",
618 GOFF::EDAttr{true, false, GOFF::ESD_RMODE_64, GOFF::ESD_NS_NormalName,
621 RootSDSection);
622 IDRLSection->setAlignment(Align(8)); // Doubleword
623
624 // Debug Info Sections. The ED name is the same used by the XL compiler.
625 auto InitDebugSection = [this,
626 RootSDSection](StringRef EDName,
627 StringRef LDName) -> MCSectionGOFF * {
628 // Debug info classes can be discarded by the binder (STRIPCL), so they are
629 // marked as removable.
630 MCSectionGOFF *ED = Ctx->getGOFFSection(
631 SectionKind::getMetadata(), EDName,
632 GOFF::EDAttr{false, true, GOFF::ESD_RMODE_64, GOFF::ESD_NS_Parts,
635 RootSDSection);
636 ED->setAlignment(Align(8)); // Doubleword
637 // At least for llc, this function is called twice! (See function
638 // compileModule() in llc.cpp). Since the context is not cleared, the
639 // already allocated section is returned above. We only add the begin symbol
640 // if it is not yet set to avoid an assertion.
641 MCSymbolGOFF *LD = static_cast<MCSymbolGOFF *>(ED->getBeginSymbol());
642 if (!LD) {
643 LD = static_cast<MCSymbolGOFF *>(getContext().getOrCreateSymbol(LDName));
644 LD->setCodeData(GOFF::ESD_EXE_DATA);
645 LD->setWeak(false);
646 LD->setLinkage(GOFF::ESD_LT_XPLink);
647 LD->setExternal(false);
648 LD->setADA(ED);
649 ED->setBeginSymbol(LD);
650 } else
651 assert(LD->getName() == LDName && "Wrong label name");
652 return ED;
653 };
654 DwarfAbbrevSection = InitDebugSection("D_ABREV", ".debug_abbrev");
655 DwarfInfoSection = InitDebugSection("D_INFO", ".debug_info");
656 DwarfLineSection = InitDebugSection("D_LINE", ".debug_line");
657 DwarfFrameSection = InitDebugSection("D_FRAME", ".debug_frame");
658 DwarfPubNamesSection = InitDebugSection("D_PBNMS", ".debug_pubnames");
659 DwarfPubTypesSection = InitDebugSection("D_PTYPES", ".debug_pubtypes");
660 DwarfStrSection = InitDebugSection("D_STR", ".debug_str");
661 DwarfLocSection = InitDebugSection("D_LOC", ".debug_loc");
662 DwarfARangesSection = InitDebugSection("D_ARNGE", ".debug_aranges");
663 DwarfRangesSection = InitDebugSection("D_RNGES", ".debug_ranges");
664 DwarfMacinfoSection = InitDebugSection("D_MACIN", ".debug_macinfo");
665
666 // DWARF 5 sections.
667 DwarfDebugNamesSection = InitDebugSection("D_NAMES", ".debug_names");
668 DwarfStrOffSection = InitDebugSection("D_STROFFS", ".debug_str_offsets");
669 DwarfAddrSection = InitDebugSection("D_ADDR", ".debug_addr");
670 DwarfRnglistsSection = InitDebugSection("D_RNGLISTS", ".debug_rnglists");
671 DwarfLoclistsSection = InitDebugSection("D_LOCLISTS", ".debug_loclists");
672 DwarfLineStrSection = InitDebugSection("D_LINESTR", ".debug_line_str");
673
674 // Special GNU sections.
675 DwarfGnuPubNamesSection = InitDebugSection("D_GPBNMS", ".debug_gnu_pubnames");
677 InitDebugSection("D_GPTYPES", ".debug_gnu_pubtypes");
678
679 // Accelerator Tables.
680 DwarfAccelNamesSection = InitDebugSection("D_APPLNMS", ".apple_names");
682 InitDebugSection("D_APPLNMSP", ".apple_namespaces");
683 DwarfAccelTypesSection = InitDebugSection("D_APPLTYPS", ".apple_types");
684 DwarfAccelObjCSection = InitDebugSection("D_APPLOBJC", ".apple_objc");
685
686 // Fission Sections
687 DwarfInfoDWOSection = InitDebugSection("D_INFO_DWO", ".debug_info.dwo");
688 DwarfTypesDWOSection = InitDebugSection("D_TYPES_DWO", ".debug_types.dwo");
689 DwarfAbbrevDWOSection = InitDebugSection("D_ABREV_DWO", ".debug_abbrev.dwo");
690 DwarfStrDWOSection = InitDebugSection("D_STR_DWO", ".debug_str.dwo");
691 DwarfLineDWOSection = InitDebugSection("D_LINE_DWO", ".debug_line.dwo");
692 DwarfLocDWOSection = InitDebugSection("D_LOC_DWO", ".debug_loc.dwo");
694 InitDebugSection("D_STROFFS_DWO", ".debug_str_offsets.dwo");
696 InitDebugSection("D_RNGLISTS_DWO", ".debug_rnglists.dwo");
698 InitDebugSection("D_MACINFO_DWO", ".debug_macinfo.dwo");
699 DwarfMacroDWOSection = InitDebugSection("D_MACRO_DWO", ".debug_macro.dwo");
701 InitDebugSection("D_LOCLISTS_DWO", ".debug_loclists.dwo");
702}
703
704void MCObjectFileInfo::initCOFFMCObjectFileInfo(const Triple &T) {
706 Ctx->getCOFFSection(".eh_frame", COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
708
709 // Set the `IMAGE_SCN_MEM_16BIT` flag when compiling for thumb mode. This is
710 // used to indicate to the linker that the text segment contains thumb instructions
711 // and to set the ISA selection bit for calls accordingly.
712 const bool IsThumb = T.getArch() == Triple::thumb;
713
714 // COFF
715 BSSSection = Ctx->getCOFFSection(
718 TextSection = Ctx->getCOFFSection(
719 ".text",
723 DataSection = Ctx->getCOFFSection(
727 Ctx->getCOFFSection(".rdata", COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
729
730 if (T.getArch() == Triple::x86_64 || T.getArch() == Triple::aarch64 ||
731 T.getArch() == Triple::arm || T.getArch() == Triple::thumb) {
732 // On Windows with SEH, the LSDA is emitted into the .xdata section
733 LSDASection = nullptr;
734 } else {
735 LSDASection = Ctx->getCOFFSection(".gcc_except_table",
738 }
739
740 if (T.getArch() == Triple::aarch64) {
742 Ctx->getCOFFSection(".impcall", COFF::IMAGE_SCN_LNK_INFO);
743 } else if (T.getArch() == Triple::x86_64) {
744 // Import Call Optimization on x64 leverages the same metadata as the
745 // retpoline mitigation, hence the unusual section name.
747 Ctx->getCOFFSection(".retplne", COFF::IMAGE_SCN_LNK_INFO);
748 }
749
750 // Debug info.
752 Ctx->getCOFFSection(".debug$S", (COFF::IMAGE_SCN_MEM_DISCARDABLE |
756 Ctx->getCOFFSection(".debug$T", (COFF::IMAGE_SCN_MEM_DISCARDABLE |
760 Ctx->getCOFFSection(".debug$H", (COFF::IMAGE_SCN_MEM_DISCARDABLE |
763
764 DwarfAbbrevSection = Ctx->getCOFFSection(
765 ".debug_abbrev", COFF::IMAGE_SCN_MEM_DISCARDABLE |
768 DwarfInfoSection = Ctx->getCOFFSection(
769 ".debug_info", COFF::IMAGE_SCN_MEM_DISCARDABLE |
772 DwarfLineSection = Ctx->getCOFFSection(
773 ".debug_line", COFF::IMAGE_SCN_MEM_DISCARDABLE |
776 DwarfLineStrSection = Ctx->getCOFFSection(
777 ".debug_line_str", COFF::IMAGE_SCN_MEM_DISCARDABLE |
780 DwarfFrameSection = Ctx->getCOFFSection(
781 ".debug_frame", COFF::IMAGE_SCN_MEM_DISCARDABLE |
784 DwarfPubNamesSection = Ctx->getCOFFSection(
785 ".debug_pubnames", COFF::IMAGE_SCN_MEM_DISCARDABLE |
788 DwarfPubTypesSection = Ctx->getCOFFSection(
789 ".debug_pubtypes", COFF::IMAGE_SCN_MEM_DISCARDABLE |
792 DwarfGnuPubNamesSection = Ctx->getCOFFSection(
793 ".debug_gnu_pubnames", COFF::IMAGE_SCN_MEM_DISCARDABLE |
796 DwarfGnuPubTypesSection = Ctx->getCOFFSection(
797 ".debug_gnu_pubtypes", COFF::IMAGE_SCN_MEM_DISCARDABLE |
800 DwarfStrSection = Ctx->getCOFFSection(
801 ".debug_str", COFF::IMAGE_SCN_MEM_DISCARDABLE |
804 DwarfStrOffSection = Ctx->getCOFFSection(
805 ".debug_str_offsets", COFF::IMAGE_SCN_MEM_DISCARDABLE |
808 DwarfLocSection = Ctx->getCOFFSection(
809 ".debug_loc", COFF::IMAGE_SCN_MEM_DISCARDABLE |
812 DwarfLoclistsSection = Ctx->getCOFFSection(
813 ".debug_loclists", COFF::IMAGE_SCN_MEM_DISCARDABLE |
816 DwarfARangesSection = Ctx->getCOFFSection(
817 ".debug_aranges", COFF::IMAGE_SCN_MEM_DISCARDABLE |
820 DwarfRangesSection = Ctx->getCOFFSection(
821 ".debug_ranges", COFF::IMAGE_SCN_MEM_DISCARDABLE |
824 DwarfRnglistsSection = Ctx->getCOFFSection(
825 ".debug_rnglists", COFF::IMAGE_SCN_MEM_DISCARDABLE |
828 DwarfMacinfoSection = Ctx->getCOFFSection(
829 ".debug_macinfo", COFF::IMAGE_SCN_MEM_DISCARDABLE |
832 DwarfMacroSection = Ctx->getCOFFSection(
833 ".debug_macro", COFF::IMAGE_SCN_MEM_DISCARDABLE |
836 DwarfMacinfoDWOSection = Ctx->getCOFFSection(
837 ".debug_macinfo.dwo", COFF::IMAGE_SCN_MEM_DISCARDABLE |
841 DwarfMacroDWOSection = Ctx->getCOFFSection(
842 ".debug_macro.dwo", COFF::IMAGE_SCN_MEM_DISCARDABLE |
846 DwarfInfoDWOSection = Ctx->getCOFFSection(
847 ".debug_info.dwo", COFF::IMAGE_SCN_MEM_DISCARDABLE |
851 DwarfTypesDWOSection = Ctx->getCOFFSection(
852 ".debug_types.dwo", COFF::IMAGE_SCN_MEM_DISCARDABLE |
856 DwarfAbbrevDWOSection = Ctx->getCOFFSection(
857 ".debug_abbrev.dwo", COFF::IMAGE_SCN_MEM_DISCARDABLE |
861 DwarfStrDWOSection = Ctx->getCOFFSection(
862 ".debug_str.dwo", COFF::IMAGE_SCN_MEM_DISCARDABLE |
866 DwarfLineDWOSection = Ctx->getCOFFSection(
867 ".debug_line.dwo", COFF::IMAGE_SCN_MEM_DISCARDABLE |
871 DwarfLocDWOSection = Ctx->getCOFFSection(
872 ".debug_loc.dwo", COFF::IMAGE_SCN_MEM_DISCARDABLE |
876 DwarfLoclistsDWOSection = Ctx->getCOFFSection(
877 ".debug_loclists.dwo", COFF::IMAGE_SCN_MEM_DISCARDABLE |
881 DwarfStrOffDWOSection = Ctx->getCOFFSection(
882 ".debug_str_offsets.dwo", COFF::IMAGE_SCN_MEM_DISCARDABLE |
886 DwarfRnglistsDWOSection = Ctx->getCOFFSection(
887 ".debug_rnglists.dwo", COFF::IMAGE_SCN_MEM_DISCARDABLE |
891 DwarfAddrSection = Ctx->getCOFFSection(
892 ".debug_addr", COFF::IMAGE_SCN_MEM_DISCARDABLE |
895 DwarfCUIndexSection = Ctx->getCOFFSection(
896 ".debug_cu_index", COFF::IMAGE_SCN_MEM_DISCARDABLE |
899 DwarfTUIndexSection = Ctx->getCOFFSection(
900 ".debug_tu_index", COFF::IMAGE_SCN_MEM_DISCARDABLE |
903 DwarfDebugNamesSection = Ctx->getCOFFSection(
904 ".debug_names", COFF::IMAGE_SCN_MEM_DISCARDABLE |
907 DwarfAccelNamesSection = Ctx->getCOFFSection(
908 ".apple_names", COFF::IMAGE_SCN_MEM_DISCARDABLE |
911 DwarfAccelNamespaceSection = Ctx->getCOFFSection(
912 ".apple_namespaces", COFF::IMAGE_SCN_MEM_DISCARDABLE |
915 DwarfAccelTypesSection = Ctx->getCOFFSection(
916 ".apple_types", COFF::IMAGE_SCN_MEM_DISCARDABLE |
919 DwarfAccelObjCSection = Ctx->getCOFFSection(
920 ".apple_objc", COFF::IMAGE_SCN_MEM_DISCARDABLE |
923
924 DrectveSection = Ctx->getCOFFSection(
926
928 Ctx->getCOFFSection(".pdata", COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
930
932 Ctx->getCOFFSection(".xdata", COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
934
935 SXDataSection = Ctx->getCOFFSection(".sxdata", COFF::IMAGE_SCN_LNK_INFO);
936
938 Ctx->getCOFFSection(".gehcont$y", COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
940
942 Ctx->getCOFFSection(".gfids$y", COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
944
946 Ctx->getCOFFSection(".giats$y", COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
948
950 Ctx->getCOFFSection(".gljmp$y", COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
952
953 TLSDataSection = Ctx->getCOFFSection(
956
957 StackMapSection = Ctx->getCOFFSection(".llvm_stackmaps",
960
961 // Set IMAGE_SCN_MEM_DISCARDABLE so that lld will not truncate section name.
962 PseudoProbeSection = Ctx->getCOFFSection(
963 ".pseudo_probe", COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
966 PseudoProbeDescSection = Ctx->getCOFFSection(
967 ".pseudo_probe_desc", COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
970}
971
972void MCObjectFileInfo::initSPIRVMCObjectFileInfo(const Triple &T) {
973 // Put everything in a single binary section.
974 TextSection = Ctx->getSPIRVSection();
975}
976
977void MCObjectFileInfo::initWasmMCObjectFileInfo(const Triple &T) {
978 TextSection = Ctx->getWasmSection(".text", SectionKind::getText());
979 DataSection = Ctx->getWasmSection(".data", SectionKind::getData());
980
982 Ctx->getWasmSection(".debug_line", SectionKind::getMetadata());
984 Ctx->getWasmSection(".debug_line_str", SectionKind::getMetadata(),
986 DwarfStrSection = Ctx->getWasmSection(
989 Ctx->getWasmSection(".debug_loc", SectionKind::getMetadata());
991 Ctx->getWasmSection(".debug_abbrev", SectionKind::getMetadata());
992 DwarfARangesSection = Ctx->getWasmSection(".debug_aranges", SectionKind::getMetadata());
994 Ctx->getWasmSection(".debug_ranges", SectionKind::getMetadata());
996 Ctx->getWasmSection(".debug_macinfo", SectionKind::getMetadata());
998 Ctx->getWasmSection(".debug_macro", SectionKind::getMetadata());
999 DwarfCUIndexSection = Ctx->getWasmSection(".debug_cu_index", SectionKind::getMetadata());
1000 DwarfTUIndexSection = Ctx->getWasmSection(".debug_tu_index", SectionKind::getMetadata());
1002 Ctx->getWasmSection(".debug_info", SectionKind::getMetadata());
1003 DwarfFrameSection = Ctx->getWasmSection(".debug_frame", SectionKind::getMetadata());
1004 DwarfPubNamesSection = Ctx->getWasmSection(".debug_pubnames", SectionKind::getMetadata());
1005 DwarfPubTypesSection = Ctx->getWasmSection(".debug_pubtypes", SectionKind::getMetadata());
1007 Ctx->getWasmSection(".debug_gnu_pubnames", SectionKind::getMetadata());
1009 Ctx->getWasmSection(".debug_gnu_pubtypes", SectionKind::getMetadata());
1010
1012 Ctx->getWasmSection(".debug_names", SectionKind::getMetadata());
1014 Ctx->getWasmSection(".debug_str_offsets", SectionKind::getMetadata());
1016 Ctx->getWasmSection(".debug_addr", SectionKind::getMetadata());
1018 Ctx->getWasmSection(".debug_rnglists", SectionKind::getMetadata());
1020 Ctx->getWasmSection(".debug_loclists", SectionKind::getMetadata());
1021
1022 // Fission Sections
1024 Ctx->getWasmSection(".debug_info.dwo", SectionKind::getMetadata());
1026 Ctx->getWasmSection(".debug_types.dwo", SectionKind::getMetadata());
1028 Ctx->getWasmSection(".debug_abbrev.dwo", SectionKind::getMetadata());
1030 Ctx->getWasmSection(".debug_str.dwo", SectionKind::getMetadata(),
1033 Ctx->getWasmSection(".debug_line.dwo", SectionKind::getMetadata());
1035 Ctx->getWasmSection(".debug_loc.dwo", SectionKind::getMetadata());
1037 Ctx->getWasmSection(".debug_str_offsets.dwo", SectionKind::getMetadata());
1039 Ctx->getWasmSection(".debug_rnglists.dwo", SectionKind::getMetadata());
1041 Ctx->getWasmSection(".debug_macinfo.dwo", SectionKind::getMetadata());
1043 Ctx->getWasmSection(".debug_macro.dwo", SectionKind::getMetadata());
1044
1046 Ctx->getWasmSection(".debug_loclists.dwo", SectionKind::getMetadata());
1047
1048 // DWP Sections
1050 Ctx->getWasmSection(".debug_cu_index", SectionKind::getMetadata());
1052 Ctx->getWasmSection(".debug_tu_index", SectionKind::getMetadata());
1053
1054 // Wasm use data section for LSDA.
1055 // TODO Consider putting each function's exception table in a separate
1056 // section, as in -function-sections, to facilitate lld's --gc-section.
1057 LSDASection = Ctx->getWasmSection(".rodata.gcc_except_table",
1059
1060 // TODO: Define more sections.
1061}
1062
1063void MCObjectFileInfo::initXCOFFMCObjectFileInfo(const Triple &T) {
1064 // The default csect for program code. Functions without a specified section
1065 // get placed into this csect. The choice of csect name is not a property of
1066 // the ABI or object file format, but various tools rely on the section
1067 // name being empty (considering named symbols to be "user symbol names").
1068 TextSection = Ctx->getXCOFFSection(
1069 "..text..", // Use a non-null name to work around an AIX assembler bug...
1071 XCOFF::CsectProperties(XCOFF::StorageMappingClass::XMC_PR, XCOFF::XTY_SD),
1072 /* MultiSymbolsAllowed*/ true);
1073
1074 // ... but use a null name when generating the symbol table.
1075 MCSectionXCOFF *TS = static_cast<MCSectionXCOFF *>(TextSection);
1077 TS->setSymbolTableName("");
1078
1079 DataSection = Ctx->getXCOFFSection(
1080 ".data", SectionKind::getData(),
1081 XCOFF::CsectProperties(XCOFF::StorageMappingClass::XMC_RW, XCOFF::XTY_SD),
1082 /* MultiSymbolsAllowed*/ true);
1083
1084 ReadOnlySection = Ctx->getXCOFFSection(
1085 ".rodata", SectionKind::getReadOnly(),
1086 XCOFF::CsectProperties(XCOFF::StorageMappingClass::XMC_RO, XCOFF::XTY_SD),
1087 /* MultiSymbolsAllowed*/ true);
1088 ReadOnlySection->setAlignment(Align(4));
1089
1090 ReadOnly8Section = Ctx->getXCOFFSection(
1091 ".rodata.8", SectionKind::getReadOnly(),
1092 XCOFF::CsectProperties(XCOFF::StorageMappingClass::XMC_RO, XCOFF::XTY_SD),
1093 /* MultiSymbolsAllowed*/ true);
1094 ReadOnly8Section->setAlignment(Align(8));
1095
1096 ReadOnly16Section = Ctx->getXCOFFSection(
1097 ".rodata.16", SectionKind::getReadOnly(),
1098 XCOFF::CsectProperties(XCOFF::StorageMappingClass::XMC_RO, XCOFF::XTY_SD),
1099 /* MultiSymbolsAllowed*/ true);
1100 ReadOnly16Section->setAlignment(Align(16));
1101
1102 TLSDataSection = Ctx->getXCOFFSection(
1103 ".tdata", SectionKind::getThreadData(),
1104 XCOFF::CsectProperties(XCOFF::StorageMappingClass::XMC_TL, XCOFF::XTY_SD),
1105 /* MultiSymbolsAllowed*/ true);
1106
1107 TOCBaseSection = Ctx->getXCOFFSection(
1108 "TOC", SectionKind::getData(),
1109 XCOFF::CsectProperties(XCOFF::StorageMappingClass::XMC_TC0,
1110 XCOFF::XTY_SD));
1111
1112 // The TOC-base always has 0 size, but 4 byte alignment.
1113 TOCBaseSection->setAlignment(Align(4));
1114
1115 LSDASection = Ctx->getXCOFFSection(
1116 ".gcc_except_table", SectionKind::getReadOnly(),
1117 XCOFF::CsectProperties(XCOFF::StorageMappingClass::XMC_RO,
1118 XCOFF::XTY_SD));
1119
1120 CompactUnwindSection = Ctx->getXCOFFSection(
1121 ".eh_info_table", SectionKind::getData(),
1122 XCOFF::CsectProperties(XCOFF::StorageMappingClass::XMC_RW,
1123 XCOFF::XTY_SD));
1124
1125 // DWARF sections for XCOFF are not csects. They are special STYP_DWARF
1126 // sections, and the individual DWARF sections are distinguished by their
1127 // section subtype.
1128 DwarfAbbrevSection = Ctx->getXCOFFSection(
1129 ".dwabrev", SectionKind::getMetadata(),
1130 /* CsectProperties */ std::nullopt,
1131 /* MultiSymbolsAllowed */ true, XCOFF::SSUBTYP_DWABREV);
1132
1133 DwarfInfoSection = Ctx->getXCOFFSection(
1134 ".dwinfo", SectionKind::getMetadata(), /* CsectProperties */ std::nullopt,
1135 /* MultiSymbolsAllowed */ true, XCOFF::SSUBTYP_DWINFO);
1136
1137 DwarfLineSection = Ctx->getXCOFFSection(
1138 ".dwline", SectionKind::getMetadata(), /* CsectProperties */ std::nullopt,
1139 /* MultiSymbolsAllowed */ true, XCOFF::SSUBTYP_DWLINE);
1140
1141 DwarfFrameSection = Ctx->getXCOFFSection(
1142 ".dwframe", SectionKind::getMetadata(),
1143 /* CsectProperties */ std::nullopt,
1144 /* MultiSymbolsAllowed */ true, XCOFF::SSUBTYP_DWFRAME);
1145
1146 DwarfPubNamesSection = Ctx->getXCOFFSection(
1147 ".dwpbnms", SectionKind::getMetadata(),
1148 /* CsectProperties */ std::nullopt,
1149 /* MultiSymbolsAllowed */ true, XCOFF::SSUBTYP_DWPBNMS);
1150
1151 DwarfPubTypesSection = Ctx->getXCOFFSection(
1152 ".dwpbtyp", SectionKind::getMetadata(),
1153 /* CsectProperties */ std::nullopt,
1154 /* MultiSymbolsAllowed */ true, XCOFF::SSUBTYP_DWPBTYP);
1155
1156 DwarfStrSection = Ctx->getXCOFFSection(
1157 ".dwstr", SectionKind::getMetadata(), /* CsectProperties */ std::nullopt,
1158 /* MultiSymbolsAllowed */ true, XCOFF::SSUBTYP_DWSTR);
1159
1160 DwarfLocSection = Ctx->getXCOFFSection(
1161 ".dwloc", SectionKind::getMetadata(), /* CsectProperties */ std::nullopt,
1162 /* MultiSymbolsAllowed */ true, XCOFF::SSUBTYP_DWLOC);
1163
1164 DwarfARangesSection = Ctx->getXCOFFSection(
1165 ".dwarnge", SectionKind::getMetadata(),
1166 /* CsectProperties */ std::nullopt,
1167 /* MultiSymbolsAllowed */ true, XCOFF::SSUBTYP_DWARNGE);
1168
1169 DwarfRangesSection = Ctx->getXCOFFSection(
1170 ".dwrnges", SectionKind::getMetadata(),
1171 /* CsectProperties */ std::nullopt,
1172 /* MultiSymbolsAllowed */ true, XCOFF::SSUBTYP_DWRNGES);
1173
1174 DwarfMacinfoSection = Ctx->getXCOFFSection(
1175 ".dwmac", SectionKind::getMetadata(), /* CsectProperties */ std::nullopt,
1176 /* MultiSymbolsAllowed */ true, XCOFF::SSUBTYP_DWMAC);
1177}
1178
1179void MCObjectFileInfo::initDXContainerObjectFileInfo(const Triple &T) {
1180 // At the moment the DXBC section should end up empty.
1181 TextSection = Ctx->getDXContainerSection("DXBC", SectionKind::getText());
1182}
1183
1185
1187 bool LargeCodeModel) {
1188 PositionIndependent = PIC;
1189 Ctx = &MCCtx;
1190
1191 // Common.
1194
1196
1198
1199 EHFrameSection = nullptr; // Created on demand.
1200 SFrameSection = nullptr; // Created on demand.
1201 CompactUnwindSection = nullptr; // Used only by selected targets.
1202 DwarfAccelNamesSection = nullptr; // Used only by selected targets.
1203 DwarfAccelObjCSection = nullptr; // Used only by selected targets.
1204 DwarfAccelNamespaceSection = nullptr; // Used only by selected targets.
1205 DwarfAccelTypesSection = nullptr; // Used only by selected targets.
1206
1207 const Triple &TheTriple = Ctx->getTargetTriple();
1208 switch (Ctx->getObjectFileType()) {
1209 case MCContext::IsMachO:
1210 initMachOMCObjectFileInfo(TheTriple);
1211 break;
1212 case MCContext::IsCOFF:
1213 initCOFFMCObjectFileInfo(TheTriple);
1214 break;
1215 case MCContext::IsELF:
1216 initELFMCObjectFileInfo(TheTriple, LargeCodeModel);
1217 break;
1218 case MCContext::IsGOFF:
1219 initGOFFMCObjectFileInfo(TheTriple);
1220 break;
1221 case MCContext::IsSPIRV:
1222 initSPIRVMCObjectFileInfo(TheTriple);
1223 break;
1224 case MCContext::IsWasm:
1225 initWasmMCObjectFileInfo(TheTriple);
1226 break;
1227 case MCContext::IsXCOFF:
1228 initXCOFFMCObjectFileInfo(TheTriple);
1229 break;
1231 initDXContainerObjectFileInfo(TheTriple);
1232 break;
1233 }
1234}
1235
1236MCSection *MCObjectFileInfo::getDwarfComdatSection(const char *Name,
1237 uint64_t Hash) const {
1238 switch (Ctx->getTargetTriple().getObjectFormat()) {
1239 case Triple::ELF:
1240 return Ctx->getELFSection(Name, ELF::SHT_PROGBITS, ELF::SHF_GROUP, 0,
1241 utostr(Hash), /*IsComdat=*/true);
1242 case Triple::Wasm:
1243 return Ctx->getWasmSection(Name, SectionKind::getMetadata(), 0,
1245 case Triple::MachO:
1246 case Triple::COFF:
1247 case Triple::GOFF:
1248 case Triple::SPIRV:
1249 case Triple::XCOFF:
1252 report_fatal_error("Cannot get DWARF comdat section for this object file "
1253 "format: not implemented.");
1254 break;
1255 }
1256 llvm_unreachable("Unknown ObjectFormatType");
1257}
1258
1259MCSection *
1261 if (Ctx->getObjectFileType() != MCContext::IsELF)
1262 return nullptr;
1263
1264 const MCSectionELF &ElfSec = static_cast<const MCSectionELF &>(TextSec);
1265 unsigned Flags = ELF::SHF_LINK_ORDER;
1266 StringRef GroupName;
1267 if (const MCSymbol *Group = ElfSec.getGroup()) {
1268 GroupName = Group->getName();
1269 Flags |= ELF::SHF_GROUP;
1270 }
1271
1272 return Ctx->getELFSection(
1273 ".llvm.callgraph", ELF::SHT_LLVM_CALL_GRAPH, Flags, 0, GroupName,
1274 /*IsComdat=*/true, ElfSec.getUniqueID(),
1275 static_cast<const MCSymbolELF *>(TextSec.getBeginSymbol()));
1276}
1277
1278MCSection *
1280 if ((Ctx->getObjectFileType() != MCContext::IsELF) ||
1281 Ctx->getTargetTriple().isPS4())
1282 return StackSizesSection;
1283
1284 const MCSectionELF &ElfSec = static_cast<const MCSectionELF &>(TextSec);
1285 unsigned Flags = ELF::SHF_LINK_ORDER;
1286 StringRef GroupName;
1287 if (const MCSymbol *Group = ElfSec.getGroup()) {
1288 GroupName = Group->getName();
1289 Flags |= ELF::SHF_GROUP;
1290 }
1291
1292 return Ctx->getELFSection(
1293 ".stack_sizes", ELF::SHT_PROGBITS, Flags, 0, GroupName, true,
1294 ElfSec.getUniqueID(),
1295 static_cast<const MCSymbolELF *>(TextSec.getBeginSymbol()));
1296}
1297
1298MCSection *
1300 constexpr StringLiteral Name = ".llvm_bb_addr_map";
1301 if (Ctx->getObjectFileType() == MCContext::IsELF) {
1302 const MCSectionELF &ElfSec = static_cast<const MCSectionELF &>(TextSec);
1303 unsigned Flags = ELF::SHF_LINK_ORDER;
1304 StringRef GroupName;
1305 if (const MCSymbol *Group = ElfSec.getGroup()) {
1306 GroupName = Group->getName();
1307 Flags |= ELF::SHF_GROUP;
1308 }
1309
1310 // Use the text section's begin symbol and unique ID to create a separate
1311 // .llvm_bb_addr_map section associated with every unique text section.
1312 return Ctx->getELFSection(
1313 Name, ELF::SHT_LLVM_BB_ADDR_MAP, Flags, 0, GroupName, true,
1314 ElfSec.getUniqueID(),
1315 static_cast<const MCSymbolELF *>(TextSec.getBeginSymbol()));
1316 } else if (Ctx->getObjectFileType() == MCContext::IsCOFF) {
1317 StringRef COMDATSymName;
1318 int Selection = 0;
1319 unsigned Characteristics = COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
1322 const auto &COFFSec = static_cast<const MCSectionCOFF &>(TextSec);
1323 if (const MCSymbol *COMDATSym = COFFSec.getCOMDATSymbol()) {
1324 if (!Ctx->getAsmInfo().hasCOFFAssociativeComdats())
1325 report_fatal_error("BB address map requires associative COMDAT "
1326 "support for COMDAT functions");
1327 COMDATSymName = COMDATSym->getName();
1328 Characteristics |= COFF::IMAGE_SCN_LNK_COMDAT;
1330 }
1331 return Ctx->getCOFFSection(Name, Characteristics, COMDATSymName, Selection,
1332 COFFSec.getUniqueID());
1333 }
1334
1335 return nullptr;
1336}
1337
1338MCSection *
1340 if (Ctx->getObjectFileType() != MCContext::IsELF)
1341 return nullptr;
1342
1343 const MCSectionELF &ElfSec = static_cast<const MCSectionELF &>(TextSec);
1344 unsigned Flags = ELF::SHF_LINK_ORDER | ELF::SHF_ALLOC;
1345 StringRef GroupName;
1346 if (const MCSymbol *Group = ElfSec.getGroup()) {
1347 GroupName = Group->getName();
1348 Flags |= ELF::SHF_GROUP;
1349 }
1350
1351 return Ctx->getELFSection(
1352 ".kcfi_traps", ELF::SHT_PROGBITS, Flags, 0, GroupName,
1353 /*IsComdat=*/true, ElfSec.getUniqueID(),
1354 static_cast<const MCSymbolELF *>(TextSec.getBeginSymbol()));
1355}
1356
1357MCSection *
1359 auto ObjFileType = Ctx->getObjectFileType();
1360 if (ObjFileType == MCContext::IsELF) {
1361 const auto &ElfSec = static_cast<const MCSectionELF &>(TextSec);
1362 unsigned Flags = ELF::SHF_LINK_ORDER;
1363 StringRef GroupName;
1364 if (const MCSymbol *Group = ElfSec.getGroup()) {
1365 GroupName = Group->getName();
1366 Flags |= ELF::SHF_GROUP;
1367 }
1368 return Ctx->getELFSection(
1369 PseudoProbeSection->getName(), ELF::SHT_PROGBITS, Flags, 0, GroupName,
1370 true, ElfSec.getUniqueID(),
1371 static_cast<const MCSymbolELF *>(TextSec.getBeginSymbol()));
1372 } else if (ObjFileType == MCContext::IsCOFF) {
1373 StringRef COMDATSymName = "";
1374 int Selection = 0;
1375 unsigned Characteristics =
1376 static_cast<MCSectionCOFF *>(PseudoProbeSection)->getCharacteristics();
1377 const auto &COFFSec = static_cast<const MCSectionCOFF &>(TextSec);
1378 if (const MCSymbol *COMDATSym = COFFSec.getCOMDATSymbol()) {
1379 // Associate .pseudo_probe to its function section.
1380 COMDATSymName = COMDATSym->getName();
1381 Characteristics |= COFF::IMAGE_SCN_LNK_COMDAT;
1383 }
1384 return Ctx->getCOFFSection(PseudoProbeSection->getName(), Characteristics,
1385 COMDATSymName, Selection, COFFSec.getUniqueID());
1386 }
1387
1388 return PseudoProbeSection;
1389}
1390
1391MCSection *
1393 uint64_t FuncHash) const {
1394 if (!Ctx->getTargetTriple().supportsCOMDAT() || FuncName.empty())
1396
1397 // Create a separate comdat group for each function's descriptor in order
1398 // for the linker to deduplicate. The duplication, must be from different
1399 // translation unit, can come from:
1400 // 1. Inline functions defined in header files;
1401 // 2. ThinLTO imported functions;
1402 // 3. Weak-linkage definitions.
1403 // Use a concatenation of the section name, function name, and function hash
1404 // as the group name so that descriptors with different hashes (due to user
1405 // code not following ODR or compiler codegen inconsistencies) get separate
1406 // COMDAT sections instead of being silently dropped (ELF) or causing linker
1407 // errors (COFF). Duplicate GUIDs with mismatching hashes are detected
1408 // during descriptor decoding and reported by llvm-profgen.
1409 auto ObjFileType = Ctx->getObjectFileType();
1410 if (ObjFileType == MCContext::IsELF) {
1411 auto *S = static_cast<MCSectionELF *>(PseudoProbeDescSection);
1412 auto Flags = S->getFlags() | ELF::SHF_GROUP;
1413 return Ctx->getELFSection(
1414 S->getName(), S->getType(), Flags, S->getEntrySize(),
1415 (S->getName() + "_" + FuncName + "." + Twine::utohexstr(FuncHash))
1416 .str(),
1417 /*IsComdat=*/true);
1418 } else if (ObjFileType == MCContext::IsCOFF) {
1419 auto *S = static_cast<MCSectionCOFF *>(PseudoProbeDescSection);
1420 unsigned Characteristics =
1421 S->getCharacteristics() | COFF::IMAGE_SCN_LNK_COMDAT;
1422 std::string COMDATSymName =
1423 (S->getName() + "_" + FuncName + "." + Twine::utohexstr(FuncHash))
1424 .str();
1425 return Ctx->getCOFFSection(S->getName(), Characteristics, COMDATSymName,
1427 }
1428
1430}
1431
1435
1437 const MCSection *TextSec) const {
1438 if (Ctx->getObjectFileType() != MCContext::IsELF)
1439 return nullptr;
1440
1441 // SHF_WRITE for relocations, and let user post-process data in-place.
1443
1444 if (!TextSec)
1445 TextSec = getTextSection();
1446
1447 StringRef GroupName;
1448 const auto &ElfSec = static_cast<const MCSectionELF &>(*TextSec);
1449 if (const MCSymbol *Group = ElfSec.getGroup()) {
1450 GroupName = Group->getName();
1451 Flags |= ELF::SHF_GROUP;
1452 }
1453 return Ctx->getELFSection(
1454 Name, ELF::SHT_PROGBITS, Flags, 0, GroupName, true, ElfSec.getUniqueID(),
1455 static_cast<const MCSymbolELF *>(TextSec->getBeginSymbol()));
1456}
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
amdgpu AMDGPU DAG DAG Pattern Instruction Selection
static bool useCompactUnwind(const Triple &T)
This file declares the MCSectionGOFF class, which contains all of the necessary machine code sections...
This file contains the MCSymbolGOFF class.
#define T
PassInstrumentationCallbacks PIC
This file contains data-structure definitions and constants to support unwinding based on ....
This file contains some functions that are useful when dealing with strings.
Context object for machine code objects.
Definition MCContext.h:84
LLVM_ABI MCSymbol * getOrCreateSymbol(const Twine &Name)
Lookup the symbol inside with the specified Name.
MCSection * NonLazySymbolPointerSection
MCSection * TLSBSSSection
Section directive for Thread Local uninitialized data.
MCSection * DwarfDebugNamesSection
Accelerator table sections.
const MCSection * TLSThreadInitSection
Section for thread local data initialization functions.
MCSection * DwarfStrOffSection
The DWARF v5 string offset and address table sections.
MCSection * MergeableConst16Section
MCSection * COFFGlobalTypeHashesSection
MCSection * SFrameSection
SFrame section.
MCSection * DwarfGnuPubTypesSection
Section for newer gnu pubtypes.
MCSection * getLLVMStatsSection() const
MCSection * TextSection
Section directive for standard text.
MCSection * TLSDataSection
Section directive for Thread Local data. ELF, MachO, COFF, and Wasm.
MCSection * ThreadLocalPointerSection
MCSection * LSDASection
If exception handling is supported by the target, this is the section the Language Specific Data Area...
MCSection * CompactUnwindSection
If exception handling is supported by the target and the target can support a compact representation ...
MCSection * COFFDebugSymbolsSection
MCSection * getPseudoProbeDescSection(StringRef FuncName, uint64_t FuncHash) const
MCSection * DwarfLoclistsSection
The DWARF v5 locations list section.
MCSection * PseudoProbeSection
Section for pseudo probe information used by AutoFDO.
MCSection * FourByteConstantSection
MCSection * getStackSizesSection(const MCSection &TextSec) const
MCSection * DwarfRnglistsSection
The DWARF v5 range list section.
const MCSection * DwarfDebugInlineSection
MCSection * getBBAddrMapSection(const MCSection &TextSec) const
MCSection * LazySymbolPointerSection
MCSection * RemarksSection
Remarks section.
MCSection * getPseudoProbeSection(const MCSection &TextSec) const
MCSection * TLSExtraDataSection
Extra TLS Variable Data section.
MCSection * EHFrameSection
EH frame section.
bool OmitDwarfIfHaveCompactUnwind
OmitDwarfIfHaveCompactUnwind - True if the target object file supports having some functions with com...
MCSection * DrectveSection
COFF specific sections.
MCSection * FaultMapSection
FaultMap section.
MCSection * getKCFITrapSection(const MCSection &TextSec) const
MCSection * TLSTLVSection
Section for thread local structure information.
void initMCObjectFileInfo(MCContext &MCCtx, bool PIC, bool LargeCodeModel=false)
MCSection * DwarfRnglistsDWOSection
The DWARF v5 range and location list sections for fission.
MCSection * ImportCallSection
If import call optimization is supported by the target, this is the section to emit import call data ...
MCSection * MergeableConst32Section
MCSection * SixteenByteConstantSection
MCSection * getPCSection(StringRef Name, const MCSection *TextSec) const
std::optional< sframe::ABI > SFrameABIArch
SFrame ABI architecture byte.
bool SupportsCompactUnwindWithoutEHFrame
True if the target object file supports emitting a compact unwind section without an associated EH fr...
MCSection * ReadOnlySection
Section that is readonly and can contain arbitrary initialized data.
unsigned FDECFIEncoding
FDE CFI encoding.
MCSection * DwarfLoclistsDWOSection
MCSection * getCallGraphSection(const MCSection &TextSec) const
MCSection * BSSSection
Section that is default initialized to zero.
MCSection * EightByteConstantSection
MCSection * StackSizesSection
Section containing metadata on function stack sizes.
unsigned CompactUnwindDwarfEHFrameOnly
Compact unwind encoding indicating that we should emit only an EH frame.
MCSection * getTextSection() const
MCSection * DwarfGnuPubNamesSection
Section for newer gnu pubnames.
MCSection * StackMapSection
StackMap section.
MCContext & getContext() const
MCSection * DwarfAccelNamespaceSection
MCSection * DataSection
Section directive for standard data.
This represents a section on Windows.
This represents a section on linux, lots of unix variants and some bare metal systems.
unsigned getFlags() const
unsigned getUniqueID() const
const MCSymbolELF * getGroup() const
void setSymbolTableName(StringRef STN)
MCSymbolXCOFF * getQualNameSymbol() const
Instances of this class represent a uniqued identifier for a section in the current translation unit.
Definition MCSection.h:577
void setAlignment(Align Value)
Definition MCSection.h:662
static constexpr unsigned NonUniqueID
Definition MCSection.h:582
void setBeginSymbol(MCSymbol *Sym)
Definition MCSection.h:654
MCSymbol * getBeginSymbol()
Definition MCSection.h:650
void setSymbolTableName(StringRef STN)
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition MCSymbol.h:42
static SectionKind getThreadData()
static SectionKind getMetadata()
static SectionKind getMergeable2ByteCString()
static SectionKind getMergeableConst4()
static SectionKind getText()
static SectionKind getReadOnlyWithRel()
static SectionKind getData()
static SectionKind getMergeableConst8()
static SectionKind getBSS()
static SectionKind getThreadBSS()
static SectionKind getMergeableConst16()
static SectionKind getMergeable1ByteCString()
static SectionKind getReadOnly()
A wrapper around a string literal that serves as a proxy for constructing global tables of StringRefs...
Definition StringRef.h:880
Represent a constant reference to a string, i.e.
Definition StringRef.h:56
constexpr bool empty() const
Check if the string is empty.
Definition StringRef.h:141
Triple - Helper class for working with autoconf configuration names.
Definition Triple.h:48
@ UnknownObjectFormat
Definition Triple.h:424
static Twine utohexstr(uint64_t Val)
Definition Twine.h:385
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
SectionCharacteristics
Definition COFF.h:298
@ IMAGE_SCN_LNK_REMOVE
Definition COFF.h:308
@ IMAGE_SCN_CNT_CODE
Definition COFF.h:303
@ IMAGE_SCN_MEM_READ
Definition COFF.h:336
@ IMAGE_SCN_MEM_EXECUTE
Definition COFF.h:335
@ IMAGE_SCN_CNT_UNINITIALIZED_DATA
Definition COFF.h:305
@ IMAGE_SCN_MEM_DISCARDABLE
Definition COFF.h:331
@ IMAGE_SCN_LNK_INFO
Definition COFF.h:307
@ IMAGE_SCN_MEM_16BIT
Definition COFF.h:312
@ IMAGE_SCN_CNT_INITIALIZED_DATA
Definition COFF.h:304
@ IMAGE_SCN_LNK_COMDAT
Definition COFF.h:309
@ IMAGE_SCN_MEM_WRITE
Definition COFF.h:337
@ IMAGE_COMDAT_SELECT_ASSOCIATIVE
Definition COFF.h:459
@ IMAGE_COMDAT_SELECT_EXACT_MATCH
Definition COFF.h:458
@ SHF_MERGE
Definition ELF.h:1104
@ SHF_STRINGS
Definition ELF.h:1107
@ SHF_EXCLUDE
Definition ELF.h:1132
@ SHF_ALLOC
Definition ELF.h:1098
@ SHF_LINK_ORDER
Definition ELF.h:1113
@ SHF_GROUP
Definition ELF.h:1120
@ SHF_WRITE
Definition ELF.h:1095
@ SHF_TLS
Definition ELF.h:1123
@ SHF_EXECINSTR
Definition ELF.h:1101
@ SHT_PROGBITS
Definition ELF.h:996
@ SHT_NOBITS
Definition ELF.h:1003
@ SHT_LLVM_CALL_GRAPH
Definition ELF.h:1039
@ SHT_MIPS_DWARF
Definition ELF.h:1076
@ SHT_LLVM_BB_ADDR_MAP
Definition ELF.h:1034
@ SHT_GNU_SFRAME
Definition ELF.h:1044
@ SHT_X86_64_UNWIND
Definition ELF.h:1072
@ ESD_LB_Deferred
Definition GOFF.h:129
@ ESD_LB_NoLoad
Definition GOFF.h:130
@ ESD_LB_Initial
Definition GOFF.h:128
constexpr StringLiteral CLASS_WSA
@ ESD_BA_Concatenate
Definition GOFF.h:98
@ ESD_BA_Merge
Definition GOFF.h:99
@ ESD_TS_Structured
Definition GOFF.h:93
@ ESD_TS_ByteOriented
Definition GOFF.h:92
@ ESD_EXE_DATA
Definition GOFF.h:111
@ ESD_RQ_1
Definition GOFF.h:70
@ ESD_RQ_0
Definition GOFF.h:69
constexpr StringLiteral CLASS_PPA2
@ ESD_BSC_Section
Definition GOFF.h:136
@ ESD_LT_OS
Definition GOFF.h:142
@ ESD_LT_XPLink
Definition GOFF.h:142
@ ESD_NS_Parts
Definition GOFF.h:65
@ ESD_NS_NormalName
Definition GOFF.h:63
@ ESD_TA_Rent
Definition GOFF.h:106
constexpr StringLiteral CLASS_CODE
@ ESD_BST_Strong
Definition GOFF.h:123
@ ESD_RMODE_64
Definition GOFF.h:88
constexpr uint32_t S_ATTR_NO_DEAD_STRIP
No dead stripping.
Definition MachO.h:198
@ S_THREAD_LOCAL_VARIABLE_POINTERS
S_THREAD_LOCAL_VARIABLE_POINTERS - Section with pointers to thread local structures.
Definition MachO.h:175
@ S_16BYTE_LITERALS
S_16BYTE_LITERALS - Section with only 16 byte literals.
Definition MachO.h:160
@ S_THREAD_LOCAL_INIT_FUNCTION_POINTERS
S_THREAD_LOCAL_INIT_FUNCTION_POINTERS - Section with thread local variable initialization pointers to...
Definition MachO.h:178
@ S_COALESCED
S_COALESCED - Section contains symbols that are to be coalesced.
Definition MachO.h:152
@ S_THREAD_LOCAL_ZEROFILL
S_THREAD_LOCAL_ZEROFILL - Thread local zerofill section.
Definition MachO.h:169
@ S_LAZY_SYMBOL_POINTERS
S_LAZY_SYMBOL_POINTERS - Section with lazy symbol pointers.
Definition MachO.h:141
@ S_CSTRING_LITERALS
S_CSTRING_LITERALS - Section with literal C strings.
Definition MachO.h:131
@ S_THREAD_LOCAL_REGULAR
S_THREAD_LOCAL_REGULAR - Thread local data section.
Definition MachO.h:167
@ S_ZEROFILL
S_ZEROFILL - Zero fill on demand section.
Definition MachO.h:129
@ S_NON_LAZY_SYMBOL_POINTERS
S_NON_LAZY_SYMBOL_POINTERS - Section with non-lazy symbol pointers.
Definition MachO.h:139
@ S_4BYTE_LITERALS
S_4BYTE_LITERALS - Section with 4 byte literals.
Definition MachO.h:133
@ S_8BYTE_LITERALS
S_8BYTE_LITERALS - Section with 8 byte literals.
Definition MachO.h:135
@ S_THREAD_LOCAL_VARIABLES
S_THREAD_LOCAL_VARIABLES - Section with thread local variable structure data.
Definition MachO.h:172
constexpr uint32_t S_ATTR_STRIP_STATIC_SYMS
Ok to strip static symbols in this section in files with the MY_DYLDLINK flag.
Definition MachO.h:196
constexpr uint32_t S_ATTR_DEBUG
A debug section.
Definition MachO.h:204
constexpr uint32_t S_ATTR_PURE_INSTRUCTIONS
Section contains only true machine instructions.
Definition MachO.h:190
constexpr uint32_t S_ATTR_LIVE_SUPPORT
Blocks are live if they reference live blocks.
Definition MachO.h:200
constexpr uint32_t S_ATTR_NO_TOC
Section contains coalesced symbols that are not to be in a ranlib table of contents.
Definition MachO.h:193
@ SSUBTYP_DWARNGE
DWARF aranges section.
Definition XCOFF.h:160
@ SSUBTYP_DWFRAME
DWARF frame section.
Definition XCOFF.h:165
@ SSUBTYP_DWABREV
DWARF abbrev section.
Definition XCOFF.h:161
@ SSUBTYP_DWINFO
DWARF info section.
Definition XCOFF.h:156
@ SSUBTYP_DWRNGES
DWARF ranges section.
Definition XCOFF.h:163
@ SSUBTYP_DWLOC
DWARF loc section.
Definition XCOFF.h:164
@ SSUBTYP_DWMAC
DWARF macinfo section.
Definition XCOFF.h:166
@ SSUBTYP_DWPBNMS
DWARF pubnames section.
Definition XCOFF.h:158
@ SSUBTYP_DWPBTYP
DWARF pubtypes section.
Definition XCOFF.h:159
@ SSUBTYP_DWLINE
DWARF line section.
Definition XCOFF.h:157
@ SSUBTYP_DWSTR
DWARF str section.
Definition XCOFF.h:162
@ XMC_TC0
TOC Anchor for TOC Addressability.
Definition XCOFF.h:119
@ XMC_RW
Read Write Data.
Definition XCOFF.h:118
@ XMC_TL
Initialized thread-local variable.
Definition XCOFF.h:127
@ XMC_RO
Read Only Constant.
Definition XCOFF.h:107
@ XMC_PR
Program Code.
Definition XCOFF.h:106
@ XTY_SD
Csect definition for initialized storage.
Definition XCOFF.h:243
@ DW_EH_PE_pcrel
Definition Dwarf.h:982
@ DW_EH_PE_sdata4
Definition Dwarf.h:979
@ DW_EH_PE_sdata8
Definition Dwarf.h:980
@ DW_EH_PE_absptr
Definition Dwarf.h:971
@ WASM_SEG_FLAG_STRINGS
Definition Wasm.h:240
This is an optimization pass for GlobalISel generic memory operations.
std::string utostr(uint64_t X, bool isNeg=false)
FuncHash
Definition InstrProf.h:78
LLVM_ABI void report_fatal_error(Error Err, bool gen_crash_diag=true)
Definition Error.cpp:163