LLVM 18.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
14#include "llvm/MC/MCAsmInfo.h"
15#include "llvm/MC/MCContext.h"
16#include "llvm/MC/MCSection.h"
27
28using namespace llvm;
29
30static bool useCompactUnwind(const Triple &T) {
31 // Only on darwin.
32 if (!T.isOSDarwin())
33 return false;
34
35 // aarch64 always has it.
36 if (T.getArch() == Triple::aarch64 || T.getArch() == Triple::aarch64_32)
37 return true;
38
39 // armv7k always has it.
40 if (T.isWatchABI())
41 return true;
42
43 // Use it on newer version of OS X.
44 if (T.isMacOSX() && !T.isMacOSXVersionLT(10, 6))
45 return true;
46
47 // And the iOS simulator.
48 if (T.isiOS() && T.isX86())
49 return true;
50
51 // The rest of the simulators always have it.
52 if (T.isSimulatorEnvironment())
53 return true;
54
55 return false;
56}
57
58void MCObjectFileInfo::initMachOMCObjectFileInfo(const Triple &T) {
59 // MachO
61
63 "__TEXT", "__eh_frame",
67
68 if (T.isOSDarwin() &&
69 (T.getArch() == Triple::aarch64 || T.getArch() == Triple::aarch64_32 ||
70 T.isSimulatorEnvironment()))
72
73 switch (Ctx->emitDwarfUnwindInfo()) {
76 break;
79 break;
83 break;
84 }
85
87
88 TextSection // .text
89 = Ctx->getMachOSection("__TEXT", "__text",
92 DataSection // .data
93 = Ctx->getMachOSection("__DATA", "__data", 0, SectionKind::getData());
94
95 // BSSSection might not be expected initialized on msvc.
96 BSSSection = nullptr;
97
98 TLSDataSection // .tdata
99 = Ctx->getMachOSection("__DATA", "__thread_data",
102 TLSBSSSection // .tbss
103 = Ctx->getMachOSection("__DATA", "__thread_bss",
106
107 // TODO: Verify datarel below.
108 TLSTLVSection // .tlv
109 = Ctx->getMachOSection("__DATA", "__thread_vars",
112
114 "__DATA", "__thread_init", MachO::S_THREAD_LOCAL_INIT_FUNCTION_POINTERS,
116
117 CStringSection // .cstring
118 = Ctx->getMachOSection("__TEXT", "__cstring",
122 = Ctx->getMachOSection("__TEXT","__ustring", 0,
124 FourByteConstantSection // .literal4
125 = Ctx->getMachOSection("__TEXT", "__literal4",
128 EightByteConstantSection // .literal8
129 = Ctx->getMachOSection("__TEXT", "__literal8",
132
133 SixteenByteConstantSection // .literal16
134 = Ctx->getMachOSection("__TEXT", "__literal16",
137
138 ReadOnlySection // .const
139 = Ctx->getMachOSection("__TEXT", "__const", 0,
141
142 // If the target is not powerpc, map the coal sections to the non-coal
143 // sections.
144 //
145 // "__TEXT/__textcoal_nt" => section "__TEXT/__text"
146 // "__TEXT/__const_coal" => section "__TEXT/__const"
147 // "__DATA/__datacoal_nt" => section "__DATA/__data"
148 Triple::ArchType ArchTy = T.getArch();
149
150 ConstDataSection // .const_data
151 = Ctx->getMachOSection("__DATA", "__const", 0,
153
154 if (ArchTy == Triple::ppc || ArchTy == Triple::ppc64) {
156 = Ctx->getMachOSection("__TEXT", "__textcoal_nt",
161 = Ctx->getMachOSection("__TEXT", "__const_coal",
165 "__DATA", "__datacoal_nt", MachO::S_COALESCED, SectionKind::getData());
167 } else {
172 }
173
175 = Ctx->getMachOSection("__DATA","__common",
179 = Ctx->getMachOSection("__DATA","__bss", MachO::S_ZEROFILL,
181
182
184 = Ctx->getMachOSection("__DATA", "__la_symbol_ptr",
188 = Ctx->getMachOSection("__DATA", "__nl_symbol_ptr",
191
193 = Ctx->getMachOSection("__DATA", "__thread_ptr",
196
197 AddrSigSection = Ctx->getMachOSection("__DATA", "__llvm_addrsig", 0,
199
200 // Exception Handling.
201 LSDASection = Ctx->getMachOSection("__TEXT", "__gcc_except_tab", 0,
203
204 COFFDebugSymbolsSection = nullptr;
205 COFFDebugTypesSection = nullptr;
207
208 if (useCompactUnwind(T)) {
210 Ctx->getMachOSection("__LD", "__compact_unwind", MachO::S_ATTR_DEBUG,
212
213 if (T.isX86())
214 CompactUnwindDwarfEHFrameOnly = 0x04000000; // UNWIND_X86_64_MODE_DWARF
215 else if (T.getArch() == Triple::aarch64 || T.getArch() == Triple::aarch64_32)
216 CompactUnwindDwarfEHFrameOnly = 0x03000000; // UNWIND_ARM64_MODE_DWARF
217 else if (T.getArch() == Triple::arm || T.getArch() == Triple::thumb)
218 CompactUnwindDwarfEHFrameOnly = 0x04000000; // UNWIND_ARM_MODE_DWARF
219 }
220
221 // Debug Information.
223 Ctx->getMachOSection("__DWARF", "__debug_names", MachO::S_ATTR_DEBUG,
224 SectionKind::getMetadata(), "debug_names_begin");
226 Ctx->getMachOSection("__DWARF", "__apple_names", MachO::S_ATTR_DEBUG,
227 SectionKind::getMetadata(), "names_begin");
229 Ctx->getMachOSection("__DWARF", "__apple_objc", MachO::S_ATTR_DEBUG,
230 SectionKind::getMetadata(), "objc_begin");
231 // 16 character section limit...
233 Ctx->getMachOSection("__DWARF", "__apple_namespac", MachO::S_ATTR_DEBUG,
234 SectionKind::getMetadata(), "namespac_begin");
236 Ctx->getMachOSection("__DWARF", "__apple_types", MachO::S_ATTR_DEBUG,
237 SectionKind::getMetadata(), "types_begin");
238
240 Ctx->getMachOSection("__DWARF", "__swift_ast", MachO::S_ATTR_DEBUG,
242
244 Ctx->getMachOSection("__DWARF", "__debug_abbrev", MachO::S_ATTR_DEBUG,
245 SectionKind::getMetadata(), "section_abbrev");
247 Ctx->getMachOSection("__DWARF", "__debug_info", MachO::S_ATTR_DEBUG,
248 SectionKind::getMetadata(), "section_info");
250 Ctx->getMachOSection("__DWARF", "__debug_line", MachO::S_ATTR_DEBUG,
251 SectionKind::getMetadata(), "section_line");
253 Ctx->getMachOSection("__DWARF", "__debug_line_str", MachO::S_ATTR_DEBUG,
254 SectionKind::getMetadata(), "section_line_str");
256 Ctx->getMachOSection("__DWARF", "__debug_frame", MachO::S_ATTR_DEBUG,
257 SectionKind::getMetadata(), "section_frame");
259 Ctx->getMachOSection("__DWARF", "__debug_pubnames", MachO::S_ATTR_DEBUG,
262 Ctx->getMachOSection("__DWARF", "__debug_pubtypes", MachO::S_ATTR_DEBUG,
265 Ctx->getMachOSection("__DWARF", "__debug_gnu_pubn", MachO::S_ATTR_DEBUG,
268 Ctx->getMachOSection("__DWARF", "__debug_gnu_pubt", MachO::S_ATTR_DEBUG,
271 Ctx->getMachOSection("__DWARF", "__debug_str", MachO::S_ATTR_DEBUG,
272 SectionKind::getMetadata(), "info_string");
274 Ctx->getMachOSection("__DWARF", "__debug_str_offs", MachO::S_ATTR_DEBUG,
275 SectionKind::getMetadata(), "section_str_off");
277 Ctx->getMachOSection("__DWARF", "__debug_addr", MachO::S_ATTR_DEBUG,
278 SectionKind::getMetadata(), "section_info");
280 Ctx->getMachOSection("__DWARF", "__debug_loc", MachO::S_ATTR_DEBUG,
281 SectionKind::getMetadata(), "section_debug_loc");
283 Ctx->getMachOSection("__DWARF", "__debug_loclists", MachO::S_ATTR_DEBUG,
284 SectionKind::getMetadata(), "section_debug_loc");
285
287 Ctx->getMachOSection("__DWARF", "__debug_aranges", MachO::S_ATTR_DEBUG,
290 Ctx->getMachOSection("__DWARF", "__debug_ranges", MachO::S_ATTR_DEBUG,
291 SectionKind::getMetadata(), "debug_range");
293 Ctx->getMachOSection("__DWARF", "__debug_rnglists", MachO::S_ATTR_DEBUG,
294 SectionKind::getMetadata(), "debug_range");
296 Ctx->getMachOSection("__DWARF", "__debug_macinfo", MachO::S_ATTR_DEBUG,
297 SectionKind::getMetadata(), "debug_macinfo");
299 Ctx->getMachOSection("__DWARF", "__debug_macro", MachO::S_ATTR_DEBUG,
300 SectionKind::getMetadata(), "debug_macro");
302 Ctx->getMachOSection("__DWARF", "__debug_inlined", MachO::S_ATTR_DEBUG,
305 Ctx->getMachOSection("__DWARF", "__debug_cu_index", MachO::S_ATTR_DEBUG,
308 Ctx->getMachOSection("__DWARF", "__debug_tu_index", MachO::S_ATTR_DEBUG,
310 StackMapSection = Ctx->getMachOSection("__LLVM_STACKMAPS", "__llvm_stackmaps",
312
313 FaultMapSection = Ctx->getMachOSection("__LLVM_FAULTMAPS", "__llvm_faultmaps",
315
317 "__LLVM", "__remarks", MachO::S_ATTR_DEBUG, SectionKind::getMetadata());
318
319 // The architecture of dsymutil makes it very difficult to copy the Swift
320 // reflection metadata sections into the __TEXT segment, so dsymutil creates
321 // these sections in the __DWARF segment instead.
323#define HANDLE_SWIFT_SECTION(KIND, MACHO, ELF, COFF) \
324 Swift5ReflectionSections \
325 [llvm::binaryformat::Swift5ReflectionSectionKind::KIND] = \
326 Ctx->getMachOSection(Ctx->getSwift5ReflectionSegmentName().data(), \
327 MACHO, 0, SectionKind::getMetadata());
328#include "llvm/BinaryFormat/Swift.def"
329 }
330
332}
333
334void MCObjectFileInfo::initELFMCObjectFileInfo(const Triple &T, bool Large) {
335 switch (T.getArch()) {
336 case Triple::mips:
337 case Triple::mipsel:
338 case Triple::mips64:
339 case Triple::mips64el:
340 // We cannot use DW_EH_PE_sdata8 for the large PositionIndependent case
341 // since there is no R_MIPS_PC64 relocation (only a 32-bit version).
342 if (PositionIndependent && !Large)
344 else
348 break;
349 case Triple::ppc64:
350 case Triple::ppc64le:
351 case Triple::aarch64:
353 case Triple::x86_64:
356 break;
357 case Triple::bpfel:
358 case Triple::bpfeb:
360 break;
361 case Triple::hexagon:
363 PositionIndependent ? dwarf::DW_EH_PE_pcrel : dwarf::DW_EH_PE_absptr;
364 break;
365 case Triple::xtensa:
367 break;
368 default:
370 break;
371 }
372
373 unsigned EHSectionType = T.getArch() == Triple::x86_64
376
377 // Solaris requires different flags for .eh_frame to seemingly every other
378 // platform.
379 unsigned EHSectionFlags = ELF::SHF_ALLOC;
380 if (T.isOSSolaris() && T.getArch() != Triple::x86_64)
381 EHSectionFlags |= ELF::SHF_WRITE;
382
383 // ELF
386
389
392
395
397 Ctx->getELFSection(".tdata", ELF::SHT_PROGBITS,
399
402
403 DataRelROSection = Ctx->getELFSection(".data.rel.ro", ELF::SHT_PROGBITS,
405
407 Ctx->getELFSection(".rodata.cst4", ELF::SHT_PROGBITS,
409
411 Ctx->getELFSection(".rodata.cst8", ELF::SHT_PROGBITS,
413
415 Ctx->getELFSection(".rodata.cst16", ELF::SHT_PROGBITS,
417
419 Ctx->getELFSection(".rodata.cst32", ELF::SHT_PROGBITS,
421
422 // Exception Handling Sections.
423
424 // FIXME: We're emitting LSDA info into a readonly section on ELF, even though
425 // it contains relocatable pointers. In PIC mode, this is probably a big
426 // runtime hit for C++ apps. Either the contents of the LSDA need to be
427 // adjusted or this should be a data section.
428 LSDASection = Ctx->getELFSection(".gcc_except_table", ELF::SHT_PROGBITS,
430
431 COFFDebugSymbolsSection = nullptr;
432 COFFDebugTypesSection = nullptr;
433
434 unsigned DebugSecType = ELF::SHT_PROGBITS;
435
436 // MIPS .debug_* sections should have SHT_MIPS_DWARF section type
437 // to distinguish among sections contain DWARF and ECOFF debug formats.
438 // Sections with ECOFF debug format are obsoleted and marked by SHT_PROGBITS.
439 if (T.isMIPS())
440 DebugSecType = ELF::SHT_MIPS_DWARF;
441
442 // Debug Info Sections.
444 Ctx->getELFSection(".debug_abbrev", DebugSecType, 0);
445 DwarfInfoSection = Ctx->getELFSection(".debug_info", DebugSecType, 0);
446 DwarfLineSection = Ctx->getELFSection(".debug_line", DebugSecType, 0);
448 Ctx->getELFSection(".debug_line_str", DebugSecType,
450 DwarfFrameSection = Ctx->getELFSection(".debug_frame", DebugSecType, 0);
452 Ctx->getELFSection(".debug_pubnames", DebugSecType, 0);
454 Ctx->getELFSection(".debug_pubtypes", DebugSecType, 0);
456 Ctx->getELFSection(".debug_gnu_pubnames", DebugSecType, 0);
458 Ctx->getELFSection(".debug_gnu_pubtypes", DebugSecType, 0);
460 Ctx->getELFSection(".debug_str", DebugSecType,
462 DwarfLocSection = Ctx->getELFSection(".debug_loc", DebugSecType, 0);
464 Ctx->getELFSection(".debug_aranges", DebugSecType, 0);
466 Ctx->getELFSection(".debug_ranges", DebugSecType, 0);
468 Ctx->getELFSection(".debug_macinfo", DebugSecType, 0);
469 DwarfMacroSection = Ctx->getELFSection(".debug_macro", DebugSecType, 0);
470
471 // DWARF5 Experimental Debug Info
472
473 // Accelerator Tables
475 Ctx->getELFSection(".debug_names", ELF::SHT_PROGBITS, 0);
477 Ctx->getELFSection(".apple_names", ELF::SHT_PROGBITS, 0);
479 Ctx->getELFSection(".apple_objc", ELF::SHT_PROGBITS, 0);
481 Ctx->getELFSection(".apple_namespaces", ELF::SHT_PROGBITS, 0);
483 Ctx->getELFSection(".apple_types", ELF::SHT_PROGBITS, 0);
484
485 // String Offset and Address Sections
487 Ctx->getELFSection(".debug_str_offsets", DebugSecType, 0);
488 DwarfAddrSection = Ctx->getELFSection(".debug_addr", DebugSecType, 0);
489 DwarfRnglistsSection = Ctx->getELFSection(".debug_rnglists", DebugSecType, 0);
490 DwarfLoclistsSection = Ctx->getELFSection(".debug_loclists", DebugSecType, 0);
491
492 // Fission Sections
494 Ctx->getELFSection(".debug_info.dwo", DebugSecType, ELF::SHF_EXCLUDE);
496 Ctx->getELFSection(".debug_types.dwo", DebugSecType, ELF::SHF_EXCLUDE);
498 Ctx->getELFSection(".debug_abbrev.dwo", DebugSecType, ELF::SHF_EXCLUDE);
500 ".debug_str.dwo", DebugSecType,
503 Ctx->getELFSection(".debug_line.dwo", DebugSecType, ELF::SHF_EXCLUDE);
505 Ctx->getELFSection(".debug_loc.dwo", DebugSecType, ELF::SHF_EXCLUDE);
506 DwarfStrOffDWOSection = Ctx->getELFSection(".debug_str_offsets.dwo",
507 DebugSecType, ELF::SHF_EXCLUDE);
509 Ctx->getELFSection(".debug_rnglists.dwo", DebugSecType, ELF::SHF_EXCLUDE);
511 Ctx->getELFSection(".debug_macinfo.dwo", DebugSecType, ELF::SHF_EXCLUDE);
513 Ctx->getELFSection(".debug_macro.dwo", DebugSecType, ELF::SHF_EXCLUDE);
514
516 Ctx->getELFSection(".debug_loclists.dwo", DebugSecType, ELF::SHF_EXCLUDE);
517
518 // DWP Sections
520 Ctx->getELFSection(".debug_cu_index", DebugSecType, 0);
522 Ctx->getELFSection(".debug_tu_index", DebugSecType, 0);
523
525 Ctx->getELFSection(".llvm_stackmaps", ELF::SHT_PROGBITS, ELF::SHF_ALLOC);
526
528 Ctx->getELFSection(".llvm_faultmaps", ELF::SHT_PROGBITS, ELF::SHF_ALLOC);
529
531 Ctx->getELFSection(".eh_frame", EHSectionType, EHSectionFlags);
532
533 StackSizesSection = Ctx->getELFSection(".stack_sizes", ELF::SHT_PROGBITS, 0);
534
535 PseudoProbeSection = Ctx->getELFSection(".pseudo_probe", DebugSecType, 0);
537 Ctx->getELFSection(".pseudo_probe_desc", DebugSecType, 0);
538
539 LLVMStatsSection = Ctx->getELFSection(".llvm_stats", ELF::SHT_PROGBITS, 0);
540}
541
542void MCObjectFileInfo::initGOFFMCObjectFileInfo(const Triple &T) {
544 Ctx->getGOFFSection(".text", SectionKind::getText(), nullptr, nullptr);
545 BSSSection =
546 Ctx->getGOFFSection(".bss", SectionKind::getBSS(), nullptr, nullptr);
550 ADASection =
551 Ctx->getGOFFSection(".ada", SectionKind::getData(), nullptr, nullptr);
552}
553
554void MCObjectFileInfo::initCOFFMCObjectFileInfo(const Triple &T) {
559
560 // Set the `IMAGE_SCN_MEM_16BIT` flag when compiling for thumb mode. This is
561 // used to indicate to the linker that the text segment contains thumb instructions
562 // and to set the ISA selection bit for calls accordingly.
563 const bool IsThumb = T.getArch() == Triple::thumb;
564
565 // COFF
571 ".text",
583
584 if (T.getArch() == Triple::x86_64 || T.getArch() == Triple::aarch64 ||
585 T.getArch() == Triple::arm || T.getArch() == Triple::thumb) {
586 // On Windows with SEH, the LSDA is emitted into the .xdata section
587 LSDASection = nullptr;
588 } else {
589 LSDASection = Ctx->getCOFFSection(".gcc_except_table",
593 }
594
595 // Debug info.
607 ".debug$H",
611
613 ".debug_abbrev",
616 SectionKind::getMetadata(), "section_abbrev");
618 ".debug_info",
621 SectionKind::getMetadata(), "section_info");
623 ".debug_line",
626 SectionKind::getMetadata(), "section_line");
628 ".debug_line_str",
631 SectionKind::getMetadata(), "section_line_str");
633 ".debug_frame",
638 ".debug_pubnames",
643 ".debug_pubtypes",
648 ".debug_gnu_pubnames",
653 ".debug_gnu_pubtypes",
658 ".debug_str",
661 SectionKind::getMetadata(), "info_string");
663 ".debug_str_offsets",
666 SectionKind::getMetadata(), "section_str_off");
668 ".debug_loc",
671 SectionKind::getMetadata(), "section_debug_loc");
673 ".debug_loclists",
676 SectionKind::getMetadata(), "section_debug_loclists");
678 ".debug_aranges",
683 ".debug_ranges",
686 SectionKind::getMetadata(), "debug_range");
688 ".debug_rnglists",
691 SectionKind::getMetadata(), "debug_rnglists");
693 ".debug_macinfo",
696 SectionKind::getMetadata(), "debug_macinfo");
698 ".debug_macro",
701 SectionKind::getMetadata(), "debug_macro");
703 ".debug_macinfo.dwo",
706 SectionKind::getMetadata(), "debug_macinfo.dwo");
708 ".debug_macro.dwo",
711 SectionKind::getMetadata(), "debug_macro.dwo");
713 ".debug_info.dwo",
716 SectionKind::getMetadata(), "section_info_dwo");
718 ".debug_types.dwo",
721 SectionKind::getMetadata(), "section_types_dwo");
723 ".debug_abbrev.dwo",
726 SectionKind::getMetadata(), "section_abbrev_dwo");
728 ".debug_str.dwo",
731 SectionKind::getMetadata(), "skel_string");
733 ".debug_line.dwo",
738 ".debug_loc.dwo",
741 SectionKind::getMetadata(), "skel_loc");
743 ".debug_str_offsets.dwo",
746 SectionKind::getMetadata(), "section_str_off_dwo");
748 ".debug_addr",
751 SectionKind::getMetadata(), "addr_sec");
753 ".debug_cu_index",
758 ".debug_tu_index",
763 ".debug_names",
766 SectionKind::getMetadata(), "debug_names_begin");
768 ".apple_names",
771 SectionKind::getMetadata(), "names_begin");
773 ".apple_namespaces",
776 SectionKind::getMetadata(), "namespac_begin");
778 ".apple_types",
781 SectionKind::getMetadata(), "types_begin");
783 ".apple_objc",
786 SectionKind::getMetadata(), "objc_begin");
787
791
795
799
802
803 GEHContSection = Ctx->getCOFFSection(".gehcont$y",
807
808 GFIDsSection = Ctx->getCOFFSection(".gfids$y",
812
813 GIATsSection = Ctx->getCOFFSection(".giats$y",
817
818 GLJMPSection = Ctx->getCOFFSection(".gljmp$y",
822
827
828 StackMapSection = Ctx->getCOFFSection(".llvm_stackmaps",
832}
833
834void MCObjectFileInfo::initSPIRVMCObjectFileInfo(const Triple &T) {
835 // Put everything in a single binary section.
837}
838
839void MCObjectFileInfo::initWasmMCObjectFileInfo(const Triple &T) {
842
844 Ctx->getWasmSection(".debug_line", SectionKind::getMetadata());
846 Ctx->getWasmSection(".debug_line_str", SectionKind::getMetadata(),
851 Ctx->getWasmSection(".debug_loc", SectionKind::getMetadata());
853 Ctx->getWasmSection(".debug_abbrev", SectionKind::getMetadata());
856 Ctx->getWasmSection(".debug_ranges", SectionKind::getMetadata());
858 Ctx->getWasmSection(".debug_macinfo", SectionKind::getMetadata());
860 Ctx->getWasmSection(".debug_macro", SectionKind::getMetadata());
864 Ctx->getWasmSection(".debug_info", SectionKind::getMetadata());
869 Ctx->getWasmSection(".debug_gnu_pubnames", SectionKind::getMetadata());
871 Ctx->getWasmSection(".debug_gnu_pubtypes", SectionKind::getMetadata());
872
874 Ctx->getWasmSection(".debug_names", SectionKind::getMetadata());
876 Ctx->getWasmSection(".debug_str_offsets", SectionKind::getMetadata());
878 Ctx->getWasmSection(".debug_addr", SectionKind::getMetadata());
880 Ctx->getWasmSection(".debug_rnglists", SectionKind::getMetadata());
882 Ctx->getWasmSection(".debug_loclists", SectionKind::getMetadata());
883
884 // Fission Sections
886 Ctx->getWasmSection(".debug_info.dwo", SectionKind::getMetadata());
888 Ctx->getWasmSection(".debug_types.dwo", SectionKind::getMetadata());
890 Ctx->getWasmSection(".debug_abbrev.dwo", SectionKind::getMetadata());
892 Ctx->getWasmSection(".debug_str.dwo", SectionKind::getMetadata(),
895 Ctx->getWasmSection(".debug_line.dwo", SectionKind::getMetadata());
897 Ctx->getWasmSection(".debug_loc.dwo", SectionKind::getMetadata());
899 Ctx->getWasmSection(".debug_str_offsets.dwo", SectionKind::getMetadata());
901 Ctx->getWasmSection(".debug_rnglists.dwo", SectionKind::getMetadata());
903 Ctx->getWasmSection(".debug_macinfo.dwo", SectionKind::getMetadata());
905 Ctx->getWasmSection(".debug_macro.dwo", SectionKind::getMetadata());
906
908 Ctx->getWasmSection(".debug_loclists.dwo", SectionKind::getMetadata());
909
910 // DWP Sections
912 Ctx->getWasmSection(".debug_cu_index", SectionKind::getMetadata());
914 Ctx->getWasmSection(".debug_tu_index", SectionKind::getMetadata());
915
916 // Wasm use data section for LSDA.
917 // TODO Consider putting each function's exception table in a separate
918 // section, as in -function-sections, to facilitate lld's --gc-section.
919 LSDASection = Ctx->getWasmSection(".rodata.gcc_except_table",
921
922 // TODO: Define more sections.
923}
924
925void MCObjectFileInfo::initXCOFFMCObjectFileInfo(const Triple &T) {
926 // The default csect for program code. Functions without a specified section
927 // get placed into this csect. The choice of csect name is not a property of
928 // the ABI or object file format, but various tools rely on the section
929 // name being empty (considering named symbols to be "user symbol names").
933 /* MultiSymbolsAllowed*/ true);
934
936 ".data", SectionKind::getData(),
938 /* MultiSymbolsAllowed*/ true);
939
941 ".rodata", SectionKind::getReadOnly(),
943 /* MultiSymbolsAllowed*/ true);
945
947 ".rodata.8", SectionKind::getReadOnly(),
949 /* MultiSymbolsAllowed*/ true);
951
953 ".rodata.16", SectionKind::getReadOnly(),
955 /* MultiSymbolsAllowed*/ true);
957
959 ".tdata", SectionKind::getThreadData(),
961 /* MultiSymbolsAllowed*/ true);
962
964 "TOC", SectionKind::getData(),
967
968 // The TOC-base always has 0 size, but 4 byte alignment.
970
972 ".gcc_except_table", SectionKind::getReadOnly(),
975
977 ".eh_info_table", SectionKind::getData(),
980
981 // DWARF sections for XCOFF are not csects. They are special STYP_DWARF
982 // sections, and the individual DWARF sections are distinguished by their
983 // section subtype.
985 ".dwabrev", SectionKind::getMetadata(),
986 /* CsectProperties */ std::nullopt,
987 /* MultiSymbolsAllowed */ true, ".dwabrev", XCOFF::SSUBTYP_DWABREV);
988
990 ".dwinfo", SectionKind::getMetadata(), /* CsectProperties */ std::nullopt,
991 /* MultiSymbolsAllowed */ true, ".dwinfo", XCOFF::SSUBTYP_DWINFO);
992
994 ".dwline", SectionKind::getMetadata(), /* CsectProperties */ std::nullopt,
995 /* MultiSymbolsAllowed */ true, ".dwline", XCOFF::SSUBTYP_DWLINE);
996
998 ".dwframe", SectionKind::getMetadata(),
999 /* CsectProperties */ std::nullopt,
1000 /* MultiSymbolsAllowed */ true, ".dwframe", XCOFF::SSUBTYP_DWFRAME);
1001
1003 ".dwpbnms", SectionKind::getMetadata(),
1004 /* CsectProperties */ std::nullopt,
1005 /* MultiSymbolsAllowed */ true, ".dwpbnms", XCOFF::SSUBTYP_DWPBNMS);
1006
1008 ".dwpbtyp", SectionKind::getMetadata(),
1009 /* CsectProperties */ std::nullopt,
1010 /* MultiSymbolsAllowed */ true, ".dwpbtyp", XCOFF::SSUBTYP_DWPBTYP);
1011
1013 ".dwstr", SectionKind::getMetadata(), /* CsectProperties */ std::nullopt,
1014 /* MultiSymbolsAllowed */ true, ".dwstr", XCOFF::SSUBTYP_DWSTR);
1015
1017 ".dwloc", SectionKind::getMetadata(), /* CsectProperties */ std::nullopt,
1018 /* MultiSymbolsAllowed */ true, ".dwloc", XCOFF::SSUBTYP_DWLOC);
1019
1021 ".dwarnge", SectionKind::getMetadata(),
1022 /* CsectProperties */ std::nullopt,
1023 /* MultiSymbolsAllowed */ true, ".dwarnge", XCOFF::SSUBTYP_DWARNGE);
1024
1026 ".dwrnges", SectionKind::getMetadata(),
1027 /* CsectProperties */ std::nullopt,
1028 /* MultiSymbolsAllowed */ true, ".dwrnges", XCOFF::SSUBTYP_DWRNGES);
1029
1031 ".dwmac", SectionKind::getMetadata(), /* CsectProperties */ std::nullopt,
1032 /* MultiSymbolsAllowed */ true, ".dwmac", XCOFF::SSUBTYP_DWMAC);
1033}
1034
1035void MCObjectFileInfo::initDXContainerObjectFileInfo(const Triple &T) {
1036 // At the moment the DXBC section should end up empty.
1038}
1039
1041
1043 bool LargeCodeModel) {
1044 PositionIndependent = PIC;
1045 Ctx = &MCCtx;
1046
1047 // Common.
1051
1053
1055
1056 EHFrameSection = nullptr; // Created on demand.
1057 CompactUnwindSection = nullptr; // Used only by selected targets.
1058 DwarfAccelNamesSection = nullptr; // Used only by selected targets.
1059 DwarfAccelObjCSection = nullptr; // Used only by selected targets.
1060 DwarfAccelNamespaceSection = nullptr; // Used only by selected targets.
1061 DwarfAccelTypesSection = nullptr; // Used only by selected targets.
1062
1063 Triple TheTriple = Ctx->getTargetTriple();
1064 switch (Ctx->getObjectFileType()) {
1065 case MCContext::IsMachO:
1066 initMachOMCObjectFileInfo(TheTriple);
1067 break;
1068 case MCContext::IsCOFF:
1069 initCOFFMCObjectFileInfo(TheTriple);
1070 break;
1071 case MCContext::IsELF:
1072 initELFMCObjectFileInfo(TheTriple, LargeCodeModel);
1073 break;
1074 case MCContext::IsGOFF:
1075 initGOFFMCObjectFileInfo(TheTriple);
1076 break;
1077 case MCContext::IsSPIRV:
1078 initSPIRVMCObjectFileInfo(TheTriple);
1079 break;
1080 case MCContext::IsWasm:
1081 initWasmMCObjectFileInfo(TheTriple);
1082 break;
1083 case MCContext::IsXCOFF:
1084 initXCOFFMCObjectFileInfo(TheTriple);
1085 break;
1087 initDXContainerObjectFileInfo(TheTriple);
1088 break;
1089 }
1090}
1091
1092MCSection *MCObjectFileInfo::getDwarfComdatSection(const char *Name,
1093 uint64_t Hash) const {
1094 switch (Ctx->getTargetTriple().getObjectFormat()) {
1095 case Triple::ELF:
1097 utostr(Hash), /*IsComdat=*/true);
1098 case Triple::Wasm:
1100 utostr(Hash), MCContext::GenericSectionID);
1101 case Triple::MachO:
1102 case Triple::COFF:
1103 case Triple::GOFF:
1104 case Triple::SPIRV:
1105 case Triple::XCOFF:
1108 report_fatal_error("Cannot get DWARF comdat section for this object file "
1109 "format: not implemented.");
1110 break;
1111 }
1112 llvm_unreachable("Unknown ObjectFormatType");
1113}
1114
1115MCSection *
1117 if ((Ctx->getObjectFileType() != MCContext::IsELF) ||
1118 Ctx->getTargetTriple().isPS4())
1119 return StackSizesSection;
1120
1121 const MCSectionELF &ElfSec = static_cast<const MCSectionELF &>(TextSec);
1122 unsigned Flags = ELF::SHF_LINK_ORDER;
1123 StringRef GroupName;
1124 if (const MCSymbol *Group = ElfSec.getGroup()) {
1125 GroupName = Group->getName();
1126 Flags |= ELF::SHF_GROUP;
1127 }
1128
1129 return Ctx->getELFSection(".stack_sizes", ELF::SHT_PROGBITS, Flags, 0,
1130 GroupName, true, ElfSec.getUniqueID(),
1131 cast<MCSymbolELF>(TextSec.getBeginSymbol()));
1132}
1133
1134MCSection *
1136 if (Ctx->getObjectFileType() != MCContext::IsELF)
1137 return nullptr;
1138
1139 const MCSectionELF &ElfSec = static_cast<const MCSectionELF &>(TextSec);
1140 unsigned Flags = ELF::SHF_LINK_ORDER;
1141 StringRef GroupName;
1142 if (const MCSymbol *Group = ElfSec.getGroup()) {
1143 GroupName = Group->getName();
1144 Flags |= ELF::SHF_GROUP;
1145 }
1146
1147 // Use the text section's begin symbol and unique ID to create a separate
1148 // .llvm_bb_addr_map section associated with every unique text section.
1149 return Ctx->getELFSection(".llvm_bb_addr_map", ELF::SHT_LLVM_BB_ADDR_MAP,
1150 Flags, 0, GroupName, true, ElfSec.getUniqueID(),
1151 cast<MCSymbolELF>(TextSec.getBeginSymbol()));
1152}
1153
1154MCSection *
1156 if (Ctx->getObjectFileType() != MCContext::IsELF)
1157 return nullptr;
1158
1159 const MCSectionELF &ElfSec = static_cast<const MCSectionELF &>(TextSec);
1160 unsigned Flags = ELF::SHF_LINK_ORDER | ELF::SHF_ALLOC;
1161 StringRef GroupName;
1162 if (const MCSymbol *Group = ElfSec.getGroup()) {
1163 GroupName = Group->getName();
1164 Flags |= ELF::SHF_GROUP;
1165 }
1166
1167 return Ctx->getELFSection(".kcfi_traps", ELF::SHT_PROGBITS, Flags, 0,
1168 GroupName,
1169 /*IsComdat=*/true, ElfSec.getUniqueID(),
1170 cast<MCSymbolELF>(TextSec.getBeginSymbol()));
1171}
1172
1173MCSection *
1175 if (Ctx->getObjectFileType() != MCContext::IsELF)
1176 return PseudoProbeSection;
1177
1178 const auto &ElfSec = static_cast<const MCSectionELF &>(TextSec);
1179 unsigned Flags = ELF::SHF_LINK_ORDER;
1180 StringRef GroupName;
1181 if (const MCSymbol *Group = ElfSec.getGroup()) {
1182 GroupName = Group->getName();
1183 Flags |= ELF::SHF_GROUP;
1184 }
1185
1187 Flags, 0, GroupName, true, ElfSec.getUniqueID(),
1188 cast<MCSymbolELF>(TextSec.getBeginSymbol()));
1189}
1190
1191MCSection *
1193 if (Ctx->getObjectFileType() == MCContext::IsELF) {
1194 // Create a separate comdat group for each function's descriptor in order
1195 // for the linker to deduplicate. The duplication, must be from different
1196 // tranlation unit, can come from:
1197 // 1. Inline functions defined in header files;
1198 // 2. ThinLTO imported funcions;
1199 // 3. Weak-linkage definitions.
1200 // Use a concatenation of the section name and the function name as the
1201 // group name so that descriptor-only groups won't be folded with groups of
1202 // code.
1203 if (Ctx->getTargetTriple().supportsCOMDAT() && !FuncName.empty()) {
1204 auto *S = static_cast<MCSectionELF *>(PseudoProbeDescSection);
1205 auto Flags = S->getFlags() | ELF::SHF_GROUP;
1206 return Ctx->getELFSection(S->getName(), S->getType(), Flags,
1207 S->getEntrySize(),
1208 S->getName() + "_" + FuncName,
1209 /*IsComdat=*/true);
1210 }
1211 }
1213}
1214
1216 return LLVMStatsSection;
1217}
1218
1220 const MCSection *TextSec) const {
1221 if (Ctx->getObjectFileType() != MCContext::IsELF)
1222 return nullptr;
1223
1224 // SHF_WRITE for relocations, and let user post-process data in-place.
1226
1227 if (!TextSec)
1228 TextSec = getTextSection();
1229
1230 StringRef GroupName;
1231 const auto &ElfSec = static_cast<const MCSectionELF &>(*TextSec);
1232 if (const MCSymbol *Group = ElfSec.getGroup()) {
1233 GroupName = Group->getName();
1234 Flags |= ELF::SHF_GROUP;
1235 }
1236 return Ctx->getELFSection(Name, ELF::SHT_PROGBITS, Flags, 0, GroupName, true,
1237 ElfSec.getUniqueID(),
1238 cast<MCSymbolELF>(TextSec->getBeginSymbol()));
1239}
std::string Name
static bool useCompactUnwind(const Triple &T)
This file declares the MCSectionGOFF class, which contains all of the necessary machine code sections...
PassInstrumentationCallbacks PIC
This file contains some functions that are useful when dealing with strings.
unsigned getCodePointerSize() const
Get the code pointer size in bytes.
Definition: MCAsmInfo.h:550
static const MCConstantExpr * create(int64_t Value, MCContext &Ctx, bool PrintInHex=false, unsigned SizeInBytes=0)
Definition: MCExpr.cpp:194
Context object for machine code objects.
Definition: MCContext.h:76
@ GenericSectionID
Pass this value as the UniqueID during section creation to get the generic section with the given nam...
Definition: MCContext.h:548
MCSectionMachO * getMachOSection(StringRef Segment, StringRef Section, unsigned TypeAndAttributes, unsigned Reserved2, SectionKind K, const char *BeginSymName=nullptr)
Return the MCSection for the specified mach-o section.
Definition: MCContext.cpp:438
Environment getObjectFileType() const
Definition: MCContext.h:429
MCSectionWasm * getWasmSection(const Twine &Section, SectionKind K, unsigned Flags=0)
Definition: MCContext.h:646
MCSectionELF * getELFSection(const Twine &Section, unsigned Type, unsigned Flags)
Definition: MCContext.h:565
const StringRef & getSwift5ReflectionSegmentName() const
Definition: MCContext.h:431
MCSectionXCOFF * getXCOFFSection(StringRef Section, SectionKind K, std::optional< XCOFF::CsectProperties > CsectProp=std::nullopt, bool MultiSymbolsAllowed=false, const char *BeginSymName=nullptr, std::optional< XCOFF::DwarfSectionSubtypeFlags > DwarfSubtypeFlags=std::nullopt)
Definition: MCContext.cpp:774
const MCAsmInfo * getAsmInfo() const
Definition: MCContext.h:446
MCSectionCOFF * getCOFFSection(StringRef Section, unsigned Characteristics, SectionKind Kind, StringRef COMDATSymName, int Selection, unsigned UniqueID=GenericSectionID, const char *BeginSymName=nullptr)
Definition: MCContext.cpp:662
MCSectionDXContainer * getDXContainerSection(StringRef Section, SectionKind K)
Get the section for the provided Section name.
Definition: MCContext.cpp:856
MCSectionSPIRV * getSPIRVSection()
Definition: MCContext.cpp:844
EmitDwarfUnwindType emitDwarfUnwindInfo() const
Definition: MCContext.cpp:923
MCSectionGOFF * getGOFFSection(StringRef Section, SectionKind Kind, MCSection *Parent, const MCExpr *SubsectionId)
Definition: MCContext.cpp:650
const Triple & getTargetTriple() const
Definition: MCContext.h:434
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 * DwarfARangesSection
MCSection * MergeableConst16Section
MCSection * COFFGlobalTypeHashesSection
MCSection * MergeableConst4Section
MCSection * DwarfMacinfoSection
MCSection * DwarfPubNamesSection
MCSection * DwarfGnuPubTypesSection
Section for newer gnu pubtypes.
MCSection * getLLVMStatsSection() const
MCSection * TextSection
Section directive for standard text.
MCSection * ConstDataCoalSection
MCSection * ConstTextCoalSection
MCSection * TLSDataSection
Section directive for Thread Local data. ELF, MachO, COFF, and Wasm.
MCSection * MergeableConst8Section
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) const
MCSection * DwarfLoclistsSection
The DWARF v5 locations list section.
MCSection * PseudoProbeSection
Section for pseudo probe information used by AutoFDO.
MCSection * FourByteConstantSection
MCSection * DwarfAccelNamesSection
MCSection * getStackSizesSection(const MCSection &TextSec) const
MCSection * DwarfRnglistsSection
The DWARF v5 range list section.
const MCSection * DwarfDebugInlineSection
MCSection * DwarfAbbrevDWOSection
MCSection * getBBAddrMapSection(const MCSection &TextSec) const
MCSection * COFFDebugTypesSection
MCSection * LazySymbolPointerSection
MCSection * RemarksSection
Remarks section.
MCSection * getPseudoProbeSection(const MCSection &TextSec) const
MCSection * PseudoProbeDescSection
MCSection * DwarfPubTypesSection
MCSection * DwarfRangesSection
MCSection * DwarfStrOffDWOSection
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 * DwarfAccelObjCSection
MCSection * TLSTLVSection
Section for thread local structure information.
MCSection * DwarfSwiftASTSection
void initMCObjectFileInfo(MCContext &MCCtx, bool PIC, bool LargeCodeModel=false)
MCSection * DwarfRnglistsDWOSection
The DWARF v5 range and location list sections for fission.
MCSection * MergeableConst32Section
MCSection * SixteenByteConstantSection
MCSection * getPCSection(StringRef Name, const MCSection *TextSec) const
MCSection * DwarfLineStrSection
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.
MCSection * DwarfAbbrevSection
unsigned FDECFIEncoding
FDE CFI encoding.
bool SupportsWeakOmittedEHFrame
True if target object file supports a weak_definition of constant 0 for an omitted EH frame.
MCSection * DwarfLoclistsDWOSection
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 * DwarfTypesDWOSection
MCSection * DwarfGnuPubNamesSection
Section for newer gnu pubnames.
MCSection * StackMapSection
StackMap section.
MCSection * DwarfMacroDWOSection
MCSection * DwarfMacinfoDWOSection
MCSection * DwarfAccelNamespaceSection
MCSection * DwarfAccelTypesSection
MCSection * DataSection
Section directive for standard data.
This represents a section on linux, lots of unix variants and some bare metal systems.
Definition: MCSectionELF.h:26
unsigned getUniqueID() const
Definition: MCSectionELF.h:87
const MCSymbolELF * getGroup() const
Definition: MCSectionELF.h:76
Instances of this class represent a uniqued identifier for a section in the current translation unit.
Definition: MCSection.h:39
void setAlignment(Align Value)
Definition: MCSection.h:141
StringRef getName() const
Definition: MCSection.h:124
MCSymbol * getBeginSymbol()
Definition: MCSection.h:129
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:41
static SectionKind getThreadData()
Definition: SectionKind.h:207
static SectionKind getMetadata()
Definition: SectionKind.h:188
static SectionKind getMergeable2ByteCString()
Definition: SectionKind.h:196
static SectionKind getMergeableConst4()
Definition: SectionKind.h:202
static SectionKind getText()
Definition: SectionKind.h:190
static SectionKind getReadOnlyWithRel()
Definition: SectionKind.h:214
static SectionKind getData()
Definition: SectionKind.h:213
static SectionKind getMergeableConst8()
Definition: SectionKind.h:203
static SectionKind getBSS()
Definition: SectionKind.h:209
static SectionKind getThreadBSS()
Definition: SectionKind.h:206
static SectionKind getMergeableConst16()
Definition: SectionKind.h:204
static SectionKind getMergeable1ByteCString()
Definition: SectionKind.h:193
static SectionKind getReadOnly()
Definition: SectionKind.h:192
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
constexpr bool empty() const
empty - Check if the string is empty.
Definition: StringRef.h:134
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
bool isPS4() const
Tests whether the target is the PS4 platform.
Definition: Triple.h:708
ObjectFormatType getObjectFormat() const
Get the object format for this triple.
Definition: Triple.h:381
bool supportsCOMDAT() const
Tests whether the target supports comdat.
Definition: Triple.h:1002
@ aarch64_be
Definition: Triple.h:52
@ mips64el
Definition: Triple.h:67
@ aarch64_32
Definition: Triple.h:53
@ DXContainer
Definition: Triple.h:283
@ UnknownObjectFormat
Definition: Triple.h:280
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
SectionCharacteristics
Definition: COFF.h:297
@ IMAGE_SCN_LNK_REMOVE
Definition: COFF.h:307
@ IMAGE_SCN_CNT_CODE
Definition: COFF.h:302
@ IMAGE_SCN_MEM_READ
Definition: COFF.h:335
@ IMAGE_SCN_MEM_EXECUTE
Definition: COFF.h:334
@ IMAGE_SCN_CNT_UNINITIALIZED_DATA
Definition: COFF.h:304
@ IMAGE_SCN_MEM_DISCARDABLE
Definition: COFF.h:330
@ IMAGE_SCN_LNK_INFO
Definition: COFF.h:306
@ IMAGE_SCN_MEM_16BIT
Definition: COFF.h:311
@ IMAGE_SCN_CNT_INITIALIZED_DATA
Definition: COFF.h:303
@ IMAGE_SCN_MEM_WRITE
Definition: COFF.h:336
@ SHT_PROGBITS
Definition: ELF.h:1000
@ SHT_NOBITS
Definition: ELF.h:1007
@ SHT_MIPS_DWARF
Definition: ELF.h:1069
@ SHT_LLVM_BB_ADDR_MAP
Definition: ELF.h:1037
@ SHT_X86_64_UNWIND
Definition: ELF.h:1065
@ SHF_MERGE
Definition: ELF.h:1095
@ SHF_STRINGS
Definition: ELF.h:1098
@ SHF_EXCLUDE
Definition: ELF.h:1123
@ SHF_ALLOC
Definition: ELF.h:1089
@ SHF_LINK_ORDER
Definition: ELF.h:1104
@ SHF_GROUP
Definition: ELF.h:1111
@ SHF_WRITE
Definition: ELF.h:1086
@ SHF_TLS
Definition: ELF.h:1114
@ SHF_EXECINSTR
Definition: ELF.h:1092
@ SK_PPA1
Definition: GOFF.h:156
@ 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
@ S_ATTR_DEBUG
S_ATTR_DEBUG - A debug section.
Definition: MachO.h:207
@ S_ATTR_NO_TOC
S_ATTR_NO_TOC - Section contains coalesced symbols that are not to be in a ranlib table of contents.
Definition: MachO.h:195
@ S_ATTR_LIVE_SUPPORT
S_ATTR_LIVE_SUPPORT - Blocks are live if they reference live blocks.
Definition: MachO.h:202
@ S_ATTR_PURE_INSTRUCTIONS
S_ATTR_PURE_INSTRUCTIONS - Section contains only true machine instructions.
Definition: MachO.h:192
@ S_ATTR_STRIP_STATIC_SYMS
S_ATTR_STRIP_STATIC_SYMS - Ok to strip static symbols in this section in files with the MY_DYLDLINK f...
Definition: MachO.h:198
@ SSUBTYP_DWARNGE
DWARF aranges section.
Definition: XCOFF.h:158
@ SSUBTYP_DWFRAME
DWARF frame section.
Definition: XCOFF.h:163
@ SSUBTYP_DWABREV
DWARF abbrev section.
Definition: XCOFF.h:159
@ SSUBTYP_DWINFO
DWARF info section.
Definition: XCOFF.h:154
@ SSUBTYP_DWRNGES
DWARF ranges section.
Definition: XCOFF.h:161
@ SSUBTYP_DWLOC
DWARF loc section.
Definition: XCOFF.h:162
@ SSUBTYP_DWMAC
DWARF macinfo section.
Definition: XCOFF.h:164
@ SSUBTYP_DWPBNMS
DWARF pubnames section.
Definition: XCOFF.h:156
@ SSUBTYP_DWPBTYP
DWARF pubtypes section.
Definition: XCOFF.h:157
@ SSUBTYP_DWLINE
DWARF line section.
Definition: XCOFF.h:155
@ SSUBTYP_DWSTR
DWARF str section.
Definition: XCOFF.h:160
@ XMC_TC0
TOC Anchor for TOC Addressability.
Definition: XCOFF.h:117
@ XMC_RW
Read Write Data.
Definition: XCOFF.h:116
@ XMC_TL
Initialized thread-local variable.
Definition: XCOFF.h:125
@ XMC_RO
Read Only Constant.
Definition: XCOFF.h:105
@ XMC_PR
Program Code.
Definition: XCOFF.h:104
@ XTY_SD
Csect definition for initialized storage.
Definition: XCOFF.h:241
@ DW_EH_PE_pcrel
Definition: Dwarf.h:534
@ DW_EH_PE_sdata4
Definition: Dwarf.h:531
@ DW_EH_PE_sdata8
Definition: Dwarf.h:532
@ DW_EH_PE_absptr
Definition: Dwarf.h:523
@ WASM_SEG_FLAG_STRINGS
Definition: Wasm.h:393
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
Definition: Error.cpp:156
This struct is a compact representation of a valid (non-zero power of two) alignment.
Definition: Alignment.h:39