LLVM 19.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 // XROS always has it.
56 if (T.isXROS())
57 return true;
58
59 return false;
60}
61
62void MCObjectFileInfo::initMachOMCObjectFileInfo(const Triple &T) {
63 // MachO
65
67 "__TEXT", "__eh_frame",
71
72 if (T.isOSDarwin() &&
73 (T.getArch() == Triple::aarch64 || T.getArch() == Triple::aarch64_32 ||
74 T.isSimulatorEnvironment()))
76
77 switch (Ctx->emitDwarfUnwindInfo()) {
80 break;
83 break;
87 break;
88 }
89
91
92 TextSection // .text
93 = Ctx->getMachOSection("__TEXT", "__text",
96 DataSection // .data
97 = Ctx->getMachOSection("__DATA", "__data", 0, SectionKind::getData());
98
99 // BSSSection might not be expected initialized on msvc.
100 BSSSection = nullptr;
101
102 TLSDataSection // .tdata
103 = Ctx->getMachOSection("__DATA", "__thread_data",
106 TLSBSSSection // .tbss
107 = Ctx->getMachOSection("__DATA", "__thread_bss",
110
111 // TODO: Verify datarel below.
112 TLSTLVSection // .tlv
113 = Ctx->getMachOSection("__DATA", "__thread_vars",
116
118 "__DATA", "__thread_init", MachO::S_THREAD_LOCAL_INIT_FUNCTION_POINTERS,
120
121 CStringSection // .cstring
122 = Ctx->getMachOSection("__TEXT", "__cstring",
126 = Ctx->getMachOSection("__TEXT","__ustring", 0,
128 FourByteConstantSection // .literal4
129 = Ctx->getMachOSection("__TEXT", "__literal4",
132 EightByteConstantSection // .literal8
133 = Ctx->getMachOSection("__TEXT", "__literal8",
136
137 SixteenByteConstantSection // .literal16
138 = Ctx->getMachOSection("__TEXT", "__literal16",
141
142 ReadOnlySection // .const
143 = Ctx->getMachOSection("__TEXT", "__const", 0,
145
146 // If the target is not powerpc, map the coal sections to the non-coal
147 // sections.
148 //
149 // "__TEXT/__textcoal_nt" => section "__TEXT/__text"
150 // "__TEXT/__const_coal" => section "__TEXT/__const"
151 // "__DATA/__datacoal_nt" => section "__DATA/__data"
152 Triple::ArchType ArchTy = T.getArch();
153
154 ConstDataSection // .const_data
155 = Ctx->getMachOSection("__DATA", "__const", 0,
157
158 if (ArchTy == Triple::ppc || ArchTy == Triple::ppc64) {
160 = Ctx->getMachOSection("__TEXT", "__textcoal_nt",
165 = Ctx->getMachOSection("__TEXT", "__const_coal",
169 "__DATA", "__datacoal_nt", MachO::S_COALESCED, SectionKind::getData());
171 } else {
176 }
177
179 = Ctx->getMachOSection("__DATA","__common",
183 = Ctx->getMachOSection("__DATA","__bss", MachO::S_ZEROFILL,
185
186
188 = Ctx->getMachOSection("__DATA", "__la_symbol_ptr",
192 = Ctx->getMachOSection("__DATA", "__nl_symbol_ptr",
195
197 = Ctx->getMachOSection("__DATA", "__thread_ptr",
200
201 AddrSigSection = Ctx->getMachOSection("__DATA", "__llvm_addrsig", 0,
203
204 // Exception Handling.
205 LSDASection = Ctx->getMachOSection("__TEXT", "__gcc_except_tab", 0,
207
208 COFFDebugSymbolsSection = nullptr;
209 COFFDebugTypesSection = nullptr;
211
212 if (useCompactUnwind(T)) {
214 Ctx->getMachOSection("__LD", "__compact_unwind", MachO::S_ATTR_DEBUG,
216
217 if (T.isX86())
218 CompactUnwindDwarfEHFrameOnly = 0x04000000; // UNWIND_X86_64_MODE_DWARF
219 else if (T.getArch() == Triple::aarch64 || T.getArch() == Triple::aarch64_32)
220 CompactUnwindDwarfEHFrameOnly = 0x03000000; // UNWIND_ARM64_MODE_DWARF
221 else if (T.getArch() == Triple::arm || T.getArch() == Triple::thumb)
222 CompactUnwindDwarfEHFrameOnly = 0x04000000; // UNWIND_ARM_MODE_DWARF
223 }
224
225 // Debug Information.
227 Ctx->getMachOSection("__DWARF", "__debug_names", MachO::S_ATTR_DEBUG,
228 SectionKind::getMetadata(), "debug_names_begin");
230 Ctx->getMachOSection("__DWARF", "__apple_names", MachO::S_ATTR_DEBUG,
231 SectionKind::getMetadata(), "names_begin");
233 Ctx->getMachOSection("__DWARF", "__apple_objc", MachO::S_ATTR_DEBUG,
234 SectionKind::getMetadata(), "objc_begin");
235 // 16 character section limit...
237 Ctx->getMachOSection("__DWARF", "__apple_namespac", MachO::S_ATTR_DEBUG,
238 SectionKind::getMetadata(), "namespac_begin");
240 Ctx->getMachOSection("__DWARF", "__apple_types", MachO::S_ATTR_DEBUG,
241 SectionKind::getMetadata(), "types_begin");
242
244 Ctx->getMachOSection("__DWARF", "__swift_ast", MachO::S_ATTR_DEBUG,
246
248 Ctx->getMachOSection("__DWARF", "__debug_abbrev", MachO::S_ATTR_DEBUG,
249 SectionKind::getMetadata(), "section_abbrev");
251 Ctx->getMachOSection("__DWARF", "__debug_info", MachO::S_ATTR_DEBUG,
252 SectionKind::getMetadata(), "section_info");
254 Ctx->getMachOSection("__DWARF", "__debug_line", MachO::S_ATTR_DEBUG,
255 SectionKind::getMetadata(), "section_line");
257 Ctx->getMachOSection("__DWARF", "__debug_line_str", MachO::S_ATTR_DEBUG,
258 SectionKind::getMetadata(), "section_line_str");
260 Ctx->getMachOSection("__DWARF", "__debug_frame", MachO::S_ATTR_DEBUG,
261 SectionKind::getMetadata(), "section_frame");
263 Ctx->getMachOSection("__DWARF", "__debug_pubnames", MachO::S_ATTR_DEBUG,
266 Ctx->getMachOSection("__DWARF", "__debug_pubtypes", MachO::S_ATTR_DEBUG,
269 Ctx->getMachOSection("__DWARF", "__debug_gnu_pubn", MachO::S_ATTR_DEBUG,
272 Ctx->getMachOSection("__DWARF", "__debug_gnu_pubt", MachO::S_ATTR_DEBUG,
275 Ctx->getMachOSection("__DWARF", "__debug_str", MachO::S_ATTR_DEBUG,
276 SectionKind::getMetadata(), "info_string");
278 Ctx->getMachOSection("__DWARF", "__debug_str_offs", MachO::S_ATTR_DEBUG,
279 SectionKind::getMetadata(), "section_str_off");
281 Ctx->getMachOSection("__DWARF", "__debug_addr", MachO::S_ATTR_DEBUG,
282 SectionKind::getMetadata(), "section_info");
284 Ctx->getMachOSection("__DWARF", "__debug_loc", MachO::S_ATTR_DEBUG,
285 SectionKind::getMetadata(), "section_debug_loc");
287 Ctx->getMachOSection("__DWARF", "__debug_loclists", MachO::S_ATTR_DEBUG,
288 SectionKind::getMetadata(), "section_debug_loc");
289
291 Ctx->getMachOSection("__DWARF", "__debug_aranges", MachO::S_ATTR_DEBUG,
294 Ctx->getMachOSection("__DWARF", "__debug_ranges", MachO::S_ATTR_DEBUG,
295 SectionKind::getMetadata(), "debug_range");
297 Ctx->getMachOSection("__DWARF", "__debug_rnglists", MachO::S_ATTR_DEBUG,
298 SectionKind::getMetadata(), "debug_range");
300 Ctx->getMachOSection("__DWARF", "__debug_macinfo", MachO::S_ATTR_DEBUG,
301 SectionKind::getMetadata(), "debug_macinfo");
303 Ctx->getMachOSection("__DWARF", "__debug_macro", MachO::S_ATTR_DEBUG,
304 SectionKind::getMetadata(), "debug_macro");
306 Ctx->getMachOSection("__DWARF", "__debug_inlined", MachO::S_ATTR_DEBUG,
309 Ctx->getMachOSection("__DWARF", "__debug_cu_index", MachO::S_ATTR_DEBUG,
312 Ctx->getMachOSection("__DWARF", "__debug_tu_index", MachO::S_ATTR_DEBUG,
314 StackMapSection = Ctx->getMachOSection("__LLVM_STACKMAPS", "__llvm_stackmaps",
316
317 FaultMapSection = Ctx->getMachOSection("__LLVM_FAULTMAPS", "__llvm_faultmaps",
319
321 "__LLVM", "__remarks", MachO::S_ATTR_DEBUG, SectionKind::getMetadata());
322
323 // The architecture of dsymutil makes it very difficult to copy the Swift
324 // reflection metadata sections into the __TEXT segment, so dsymutil creates
325 // these sections in the __DWARF segment instead.
327#define HANDLE_SWIFT_SECTION(KIND, MACHO, ELF, COFF) \
328 Swift5ReflectionSections \
329 [llvm::binaryformat::Swift5ReflectionSectionKind::KIND] = \
330 Ctx->getMachOSection(Ctx->getSwift5ReflectionSegmentName().data(), \
331 MACHO, 0, SectionKind::getMetadata());
332#include "llvm/BinaryFormat/Swift.def"
333 }
334
336}
337
338void MCObjectFileInfo::initELFMCObjectFileInfo(const Triple &T, bool Large) {
339 switch (T.getArch()) {
340 case Triple::mips:
341 case Triple::mipsel:
342 case Triple::mips64:
343 case Triple::mips64el:
344 // We cannot use DW_EH_PE_sdata8 for the large PositionIndependent case
345 // since there is no R_MIPS_PC64 relocation (only a 32-bit version).
346 // In fact DW_EH_PE_sdata4 is enough for us now, and GNU ld doesn't
347 // support pcrel|sdata8 well. Let's use sdata4 for now.
348 if (PositionIndependent)
350 else
354 break;
355 case Triple::ppc64:
356 case Triple::ppc64le:
357 case Triple::aarch64:
359 case Triple::x86_64:
362 break;
363 case Triple::bpfel:
364 case Triple::bpfeb:
366 break;
367 case Triple::hexagon:
369 PositionIndependent ? dwarf::DW_EH_PE_pcrel : dwarf::DW_EH_PE_absptr;
370 break;
371 case Triple::xtensa:
373 break;
374 default:
376 break;
377 }
378
379 unsigned EHSectionType = T.getArch() == Triple::x86_64
382
383 // Solaris requires different flags for .eh_frame to seemingly every other
384 // platform.
385 unsigned EHSectionFlags = ELF::SHF_ALLOC;
386 if (T.isOSSolaris() && T.getArch() != Triple::x86_64)
387 EHSectionFlags |= ELF::SHF_WRITE;
388
389 // ELF
392
395
398
401
403 Ctx->getELFSection(".tdata", ELF::SHT_PROGBITS,
405
408
409 DataRelROSection = Ctx->getELFSection(".data.rel.ro", ELF::SHT_PROGBITS,
411
413 Ctx->getELFSection(".rodata.cst4", ELF::SHT_PROGBITS,
415
417 Ctx->getELFSection(".rodata.cst8", ELF::SHT_PROGBITS,
419
421 Ctx->getELFSection(".rodata.cst16", ELF::SHT_PROGBITS,
423
425 Ctx->getELFSection(".rodata.cst32", ELF::SHT_PROGBITS,
427
428 // Exception Handling Sections.
429
430 // FIXME: We're emitting LSDA info into a readonly section on ELF, even though
431 // it contains relocatable pointers. In PIC mode, this is probably a big
432 // runtime hit for C++ apps. Either the contents of the LSDA need to be
433 // adjusted or this should be a data section.
434 LSDASection = Ctx->getELFSection(".gcc_except_table", ELF::SHT_PROGBITS,
436
437 COFFDebugSymbolsSection = nullptr;
438 COFFDebugTypesSection = nullptr;
439
440 unsigned DebugSecType = ELF::SHT_PROGBITS;
441
442 // MIPS .debug_* sections should have SHT_MIPS_DWARF section type
443 // to distinguish among sections contain DWARF and ECOFF debug formats.
444 // Sections with ECOFF debug format are obsoleted and marked by SHT_PROGBITS.
445 if (T.isMIPS())
446 DebugSecType = ELF::SHT_MIPS_DWARF;
447
448 // Debug Info Sections.
450 Ctx->getELFSection(".debug_abbrev", DebugSecType, 0);
451 DwarfInfoSection = Ctx->getELFSection(".debug_info", DebugSecType, 0);
452 DwarfLineSection = Ctx->getELFSection(".debug_line", DebugSecType, 0);
454 Ctx->getELFSection(".debug_line_str", DebugSecType,
456 DwarfFrameSection = Ctx->getELFSection(".debug_frame", DebugSecType, 0);
458 Ctx->getELFSection(".debug_pubnames", DebugSecType, 0);
460 Ctx->getELFSection(".debug_pubtypes", DebugSecType, 0);
462 Ctx->getELFSection(".debug_gnu_pubnames", DebugSecType, 0);
464 Ctx->getELFSection(".debug_gnu_pubtypes", DebugSecType, 0);
466 Ctx->getELFSection(".debug_str", DebugSecType,
468 DwarfLocSection = Ctx->getELFSection(".debug_loc", DebugSecType, 0);
470 Ctx->getELFSection(".debug_aranges", DebugSecType, 0);
472 Ctx->getELFSection(".debug_ranges", DebugSecType, 0);
474 Ctx->getELFSection(".debug_macinfo", DebugSecType, 0);
475 DwarfMacroSection = Ctx->getELFSection(".debug_macro", DebugSecType, 0);
476
477 // DWARF5 Experimental Debug Info
478
479 // Accelerator Tables
481 Ctx->getELFSection(".debug_names", ELF::SHT_PROGBITS, 0);
483 Ctx->getELFSection(".apple_names", ELF::SHT_PROGBITS, 0);
485 Ctx->getELFSection(".apple_objc", ELF::SHT_PROGBITS, 0);
487 Ctx->getELFSection(".apple_namespaces", ELF::SHT_PROGBITS, 0);
489 Ctx->getELFSection(".apple_types", ELF::SHT_PROGBITS, 0);
490
491 // String Offset and Address Sections
493 Ctx->getELFSection(".debug_str_offsets", DebugSecType, 0);
494 DwarfAddrSection = Ctx->getELFSection(".debug_addr", DebugSecType, 0);
495 DwarfRnglistsSection = Ctx->getELFSection(".debug_rnglists", DebugSecType, 0);
496 DwarfLoclistsSection = Ctx->getELFSection(".debug_loclists", DebugSecType, 0);
497
498 // Fission Sections
500 Ctx->getELFSection(".debug_info.dwo", DebugSecType, ELF::SHF_EXCLUDE);
502 Ctx->getELFSection(".debug_types.dwo", DebugSecType, ELF::SHF_EXCLUDE);
504 Ctx->getELFSection(".debug_abbrev.dwo", DebugSecType, ELF::SHF_EXCLUDE);
506 ".debug_str.dwo", DebugSecType,
509 Ctx->getELFSection(".debug_line.dwo", DebugSecType, ELF::SHF_EXCLUDE);
511 Ctx->getELFSection(".debug_loc.dwo", DebugSecType, ELF::SHF_EXCLUDE);
512 DwarfStrOffDWOSection = Ctx->getELFSection(".debug_str_offsets.dwo",
513 DebugSecType, ELF::SHF_EXCLUDE);
515 Ctx->getELFSection(".debug_rnglists.dwo", DebugSecType, ELF::SHF_EXCLUDE);
517 Ctx->getELFSection(".debug_macinfo.dwo", DebugSecType, ELF::SHF_EXCLUDE);
519 Ctx->getELFSection(".debug_macro.dwo", DebugSecType, ELF::SHF_EXCLUDE);
520
522 Ctx->getELFSection(".debug_loclists.dwo", DebugSecType, ELF::SHF_EXCLUDE);
523
524 // DWP Sections
526 Ctx->getELFSection(".debug_cu_index", DebugSecType, 0);
528 Ctx->getELFSection(".debug_tu_index", DebugSecType, 0);
529
531 Ctx->getELFSection(".llvm_stackmaps", ELF::SHT_PROGBITS, ELF::SHF_ALLOC);
532
534 Ctx->getELFSection(".llvm_faultmaps", ELF::SHT_PROGBITS, ELF::SHF_ALLOC);
535
537 Ctx->getELFSection(".eh_frame", EHSectionType, EHSectionFlags);
538
539 StackSizesSection = Ctx->getELFSection(".stack_sizes", ELF::SHT_PROGBITS, 0);
540
541 PseudoProbeSection = Ctx->getELFSection(".pseudo_probe", DebugSecType, 0);
543 Ctx->getELFSection(".pseudo_probe_desc", DebugSecType, 0);
544
545 LLVMStatsSection = Ctx->getELFSection(".llvm_stats", ELF::SHT_PROGBITS, 0);
546}
547
548void MCObjectFileInfo::initGOFFMCObjectFileInfo(const Triple &T) {
550 Ctx->getGOFFSection(".text", SectionKind::getText(), nullptr, nullptr);
551 BSSSection =
552 Ctx->getGOFFSection(".bss", SectionKind::getBSS(), nullptr, nullptr);
559
561 Ctx->getGOFFSection(".ppa2list", SectionKind::getData(),
562 nullptr, nullptr);
563
564 ADASection =
565 Ctx->getGOFFSection(".ada", SectionKind::getData(), nullptr, nullptr);
567 Ctx->getGOFFSection("B_IDRL", SectionKind::getData(), nullptr, nullptr);
568}
569
570void MCObjectFileInfo::initCOFFMCObjectFileInfo(const Triple &T) {
575
576 // Set the `IMAGE_SCN_MEM_16BIT` flag when compiling for thumb mode. This is
577 // used to indicate to the linker that the text segment contains thumb instructions
578 // and to set the ISA selection bit for calls accordingly.
579 const bool IsThumb = T.getArch() == Triple::thumb;
580
581 // COFF
587 ".text",
599
600 if (T.getArch() == Triple::x86_64 || T.getArch() == Triple::aarch64 ||
601 T.getArch() == Triple::arm || T.getArch() == Triple::thumb) {
602 // On Windows with SEH, the LSDA is emitted into the .xdata section
603 LSDASection = nullptr;
604 } else {
605 LSDASection = Ctx->getCOFFSection(".gcc_except_table",
609 }
610
611 // Debug info.
623 ".debug$H",
627
629 ".debug_abbrev",
632 SectionKind::getMetadata(), "section_abbrev");
634 ".debug_info",
637 SectionKind::getMetadata(), "section_info");
639 ".debug_line",
642 SectionKind::getMetadata(), "section_line");
644 ".debug_line_str",
647 SectionKind::getMetadata(), "section_line_str");
649 ".debug_frame",
654 ".debug_pubnames",
659 ".debug_pubtypes",
664 ".debug_gnu_pubnames",
669 ".debug_gnu_pubtypes",
674 ".debug_str",
677 SectionKind::getMetadata(), "info_string");
679 ".debug_str_offsets",
682 SectionKind::getMetadata(), "section_str_off");
684 ".debug_loc",
687 SectionKind::getMetadata(), "section_debug_loc");
689 ".debug_loclists",
692 SectionKind::getMetadata(), "section_debug_loclists");
694 ".debug_aranges",
699 ".debug_ranges",
702 SectionKind::getMetadata(), "debug_range");
704 ".debug_rnglists",
707 SectionKind::getMetadata(), "debug_rnglists");
709 ".debug_macinfo",
712 SectionKind::getMetadata(), "debug_macinfo");
714 ".debug_macro",
717 SectionKind::getMetadata(), "debug_macro");
719 ".debug_macinfo.dwo",
722 SectionKind::getMetadata(), "debug_macinfo.dwo");
724 ".debug_macro.dwo",
727 SectionKind::getMetadata(), "debug_macro.dwo");
729 ".debug_info.dwo",
732 SectionKind::getMetadata(), "section_info_dwo");
734 ".debug_types.dwo",
737 SectionKind::getMetadata(), "section_types_dwo");
739 ".debug_abbrev.dwo",
742 SectionKind::getMetadata(), "section_abbrev_dwo");
744 ".debug_str.dwo",
747 SectionKind::getMetadata(), "skel_string");
749 ".debug_line.dwo",
754 ".debug_loc.dwo",
757 SectionKind::getMetadata(), "skel_loc");
759 ".debug_str_offsets.dwo",
762 SectionKind::getMetadata(), "section_str_off_dwo");
764 ".debug_addr",
767 SectionKind::getMetadata(), "addr_sec");
769 ".debug_cu_index",
774 ".debug_tu_index",
779 ".debug_names",
782 SectionKind::getMetadata(), "debug_names_begin");
784 ".apple_names",
787 SectionKind::getMetadata(), "names_begin");
789 ".apple_namespaces",
792 SectionKind::getMetadata(), "namespac_begin");
794 ".apple_types",
797 SectionKind::getMetadata(), "types_begin");
799 ".apple_objc",
802 SectionKind::getMetadata(), "objc_begin");
803
807
811
815
818
819 GEHContSection = Ctx->getCOFFSection(".gehcont$y",
823
824 GFIDsSection = Ctx->getCOFFSection(".gfids$y",
828
829 GIATsSection = Ctx->getCOFFSection(".giats$y",
833
834 GLJMPSection = Ctx->getCOFFSection(".gljmp$y",
838
843
844 StackMapSection = Ctx->getCOFFSection(".llvm_stackmaps",
848}
849
850void MCObjectFileInfo::initSPIRVMCObjectFileInfo(const Triple &T) {
851 // Put everything in a single binary section.
853}
854
855void MCObjectFileInfo::initWasmMCObjectFileInfo(const Triple &T) {
858
860 Ctx->getWasmSection(".debug_line", SectionKind::getMetadata());
862 Ctx->getWasmSection(".debug_line_str", SectionKind::getMetadata(),
867 Ctx->getWasmSection(".debug_loc", SectionKind::getMetadata());
869 Ctx->getWasmSection(".debug_abbrev", SectionKind::getMetadata());
872 Ctx->getWasmSection(".debug_ranges", SectionKind::getMetadata());
874 Ctx->getWasmSection(".debug_macinfo", SectionKind::getMetadata());
876 Ctx->getWasmSection(".debug_macro", SectionKind::getMetadata());
880 Ctx->getWasmSection(".debug_info", SectionKind::getMetadata());
885 Ctx->getWasmSection(".debug_gnu_pubnames", SectionKind::getMetadata());
887 Ctx->getWasmSection(".debug_gnu_pubtypes", SectionKind::getMetadata());
888
890 Ctx->getWasmSection(".debug_names", SectionKind::getMetadata());
892 Ctx->getWasmSection(".debug_str_offsets", SectionKind::getMetadata());
894 Ctx->getWasmSection(".debug_addr", SectionKind::getMetadata());
896 Ctx->getWasmSection(".debug_rnglists", SectionKind::getMetadata());
898 Ctx->getWasmSection(".debug_loclists", SectionKind::getMetadata());
899
900 // Fission Sections
902 Ctx->getWasmSection(".debug_info.dwo", SectionKind::getMetadata());
904 Ctx->getWasmSection(".debug_types.dwo", SectionKind::getMetadata());
906 Ctx->getWasmSection(".debug_abbrev.dwo", SectionKind::getMetadata());
908 Ctx->getWasmSection(".debug_str.dwo", SectionKind::getMetadata(),
911 Ctx->getWasmSection(".debug_line.dwo", SectionKind::getMetadata());
913 Ctx->getWasmSection(".debug_loc.dwo", SectionKind::getMetadata());
915 Ctx->getWasmSection(".debug_str_offsets.dwo", SectionKind::getMetadata());
917 Ctx->getWasmSection(".debug_rnglists.dwo", SectionKind::getMetadata());
919 Ctx->getWasmSection(".debug_macinfo.dwo", SectionKind::getMetadata());
921 Ctx->getWasmSection(".debug_macro.dwo", SectionKind::getMetadata());
922
924 Ctx->getWasmSection(".debug_loclists.dwo", SectionKind::getMetadata());
925
926 // DWP Sections
928 Ctx->getWasmSection(".debug_cu_index", SectionKind::getMetadata());
930 Ctx->getWasmSection(".debug_tu_index", SectionKind::getMetadata());
931
932 // Wasm use data section for LSDA.
933 // TODO Consider putting each function's exception table in a separate
934 // section, as in -function-sections, to facilitate lld's --gc-section.
935 LSDASection = Ctx->getWasmSection(".rodata.gcc_except_table",
937
938 // TODO: Define more sections.
939}
940
941void MCObjectFileInfo::initXCOFFMCObjectFileInfo(const Triple &T) {
942 // The default csect for program code. Functions without a specified section
943 // get placed into this csect. The choice of csect name is not a property of
944 // the ABI or object file format, but various tools rely on the section
945 // name being empty (considering named symbols to be "user symbol names").
947 "..text..", // Use a non-null name to work around an AIX assembler bug...
950 /* MultiSymbolsAllowed*/ true);
951
952 // ... but use a null name when generating the symbol table.
953 MCSectionXCOFF *TS = static_cast<MCSectionXCOFF *>(TextSection);
955 TS->setSymbolTableName("");
956
958 ".data", SectionKind::getData(),
960 /* MultiSymbolsAllowed*/ true);
961
963 ".rodata", SectionKind::getReadOnly(),
965 /* MultiSymbolsAllowed*/ true);
967
969 ".rodata.8", SectionKind::getReadOnly(),
971 /* MultiSymbolsAllowed*/ true);
973
975 ".rodata.16", SectionKind::getReadOnly(),
977 /* MultiSymbolsAllowed*/ true);
979
981 ".tdata", SectionKind::getThreadData(),
983 /* MultiSymbolsAllowed*/ true);
984
986 "TOC", SectionKind::getData(),
989
990 // The TOC-base always has 0 size, but 4 byte alignment.
992
994 ".gcc_except_table", SectionKind::getReadOnly(),
997
999 ".eh_info_table", SectionKind::getData(),
1001 XCOFF::XTY_SD));
1002
1003 // DWARF sections for XCOFF are not csects. They are special STYP_DWARF
1004 // sections, and the individual DWARF sections are distinguished by their
1005 // section subtype.
1007 ".dwabrev", SectionKind::getMetadata(),
1008 /* CsectProperties */ std::nullopt,
1009 /* MultiSymbolsAllowed */ true, ".dwabrev", XCOFF::SSUBTYP_DWABREV);
1010
1012 ".dwinfo", SectionKind::getMetadata(), /* CsectProperties */ std::nullopt,
1013 /* MultiSymbolsAllowed */ true, ".dwinfo", XCOFF::SSUBTYP_DWINFO);
1014
1016 ".dwline", SectionKind::getMetadata(), /* CsectProperties */ std::nullopt,
1017 /* MultiSymbolsAllowed */ true, ".dwline", XCOFF::SSUBTYP_DWLINE);
1018
1020 ".dwframe", SectionKind::getMetadata(),
1021 /* CsectProperties */ std::nullopt,
1022 /* MultiSymbolsAllowed */ true, ".dwframe", XCOFF::SSUBTYP_DWFRAME);
1023
1025 ".dwpbnms", SectionKind::getMetadata(),
1026 /* CsectProperties */ std::nullopt,
1027 /* MultiSymbolsAllowed */ true, ".dwpbnms", XCOFF::SSUBTYP_DWPBNMS);
1028
1030 ".dwpbtyp", SectionKind::getMetadata(),
1031 /* CsectProperties */ std::nullopt,
1032 /* MultiSymbolsAllowed */ true, ".dwpbtyp", XCOFF::SSUBTYP_DWPBTYP);
1033
1035 ".dwstr", SectionKind::getMetadata(), /* CsectProperties */ std::nullopt,
1036 /* MultiSymbolsAllowed */ true, ".dwstr", XCOFF::SSUBTYP_DWSTR);
1037
1039 ".dwloc", SectionKind::getMetadata(), /* CsectProperties */ std::nullopt,
1040 /* MultiSymbolsAllowed */ true, ".dwloc", XCOFF::SSUBTYP_DWLOC);
1041
1043 ".dwarnge", SectionKind::getMetadata(),
1044 /* CsectProperties */ std::nullopt,
1045 /* MultiSymbolsAllowed */ true, ".dwarnge", XCOFF::SSUBTYP_DWARNGE);
1046
1048 ".dwrnges", SectionKind::getMetadata(),
1049 /* CsectProperties */ std::nullopt,
1050 /* MultiSymbolsAllowed */ true, ".dwrnges", XCOFF::SSUBTYP_DWRNGES);
1051
1053 ".dwmac", SectionKind::getMetadata(), /* CsectProperties */ std::nullopt,
1054 /* MultiSymbolsAllowed */ true, ".dwmac", XCOFF::SSUBTYP_DWMAC);
1055}
1056
1057void MCObjectFileInfo::initDXContainerObjectFileInfo(const Triple &T) {
1058 // At the moment the DXBC section should end up empty.
1060}
1061
1063
1065 bool LargeCodeModel) {
1066 PositionIndependent = PIC;
1067 Ctx = &MCCtx;
1068
1069 // Common.
1073
1075
1077
1078 EHFrameSection = nullptr; // Created on demand.
1079 CompactUnwindSection = nullptr; // Used only by selected targets.
1080 DwarfAccelNamesSection = nullptr; // Used only by selected targets.
1081 DwarfAccelObjCSection = nullptr; // Used only by selected targets.
1082 DwarfAccelNamespaceSection = nullptr; // Used only by selected targets.
1083 DwarfAccelTypesSection = nullptr; // Used only by selected targets.
1084
1085 Triple TheTriple = Ctx->getTargetTriple();
1086 switch (Ctx->getObjectFileType()) {
1087 case MCContext::IsMachO:
1088 initMachOMCObjectFileInfo(TheTriple);
1089 break;
1090 case MCContext::IsCOFF:
1091 initCOFFMCObjectFileInfo(TheTriple);
1092 break;
1093 case MCContext::IsELF:
1094 initELFMCObjectFileInfo(TheTriple, LargeCodeModel);
1095 break;
1096 case MCContext::IsGOFF:
1097 initGOFFMCObjectFileInfo(TheTriple);
1098 break;
1099 case MCContext::IsSPIRV:
1100 initSPIRVMCObjectFileInfo(TheTriple);
1101 break;
1102 case MCContext::IsWasm:
1103 initWasmMCObjectFileInfo(TheTriple);
1104 break;
1105 case MCContext::IsXCOFF:
1106 initXCOFFMCObjectFileInfo(TheTriple);
1107 break;
1109 initDXContainerObjectFileInfo(TheTriple);
1110 break;
1111 }
1112}
1113
1114MCSection *MCObjectFileInfo::getDwarfComdatSection(const char *Name,
1115 uint64_t Hash) const {
1116 switch (Ctx->getTargetTriple().getObjectFormat()) {
1117 case Triple::ELF:
1119 utostr(Hash), /*IsComdat=*/true);
1120 case Triple::Wasm:
1122 utostr(Hash), MCContext::GenericSectionID);
1123 case Triple::MachO:
1124 case Triple::COFF:
1125 case Triple::GOFF:
1126 case Triple::SPIRV:
1127 case Triple::XCOFF:
1130 report_fatal_error("Cannot get DWARF comdat section for this object file "
1131 "format: not implemented.");
1132 break;
1133 }
1134 llvm_unreachable("Unknown ObjectFormatType");
1135}
1136
1137MCSection *
1139 if ((Ctx->getObjectFileType() != MCContext::IsELF) ||
1140 Ctx->getTargetTriple().isPS4())
1141 return StackSizesSection;
1142
1143 const MCSectionELF &ElfSec = static_cast<const MCSectionELF &>(TextSec);
1144 unsigned Flags = ELF::SHF_LINK_ORDER;
1145 StringRef GroupName;
1146 if (const MCSymbol *Group = ElfSec.getGroup()) {
1147 GroupName = Group->getName();
1148 Flags |= ELF::SHF_GROUP;
1149 }
1150
1151 return Ctx->getELFSection(".stack_sizes", ELF::SHT_PROGBITS, Flags, 0,
1152 GroupName, true, ElfSec.getUniqueID(),
1153 cast<MCSymbolELF>(TextSec.getBeginSymbol()));
1154}
1155
1156MCSection *
1158 if (Ctx->getObjectFileType() != MCContext::IsELF)
1159 return nullptr;
1160
1161 const MCSectionELF &ElfSec = static_cast<const MCSectionELF &>(TextSec);
1162 unsigned Flags = ELF::SHF_LINK_ORDER;
1163 StringRef GroupName;
1164 if (const MCSymbol *Group = ElfSec.getGroup()) {
1165 GroupName = Group->getName();
1166 Flags |= ELF::SHF_GROUP;
1167 }
1168
1169 // Use the text section's begin symbol and unique ID to create a separate
1170 // .llvm_bb_addr_map section associated with every unique text section.
1171 return Ctx->getELFSection(".llvm_bb_addr_map", ELF::SHT_LLVM_BB_ADDR_MAP,
1172 Flags, 0, GroupName, true, ElfSec.getUniqueID(),
1173 cast<MCSymbolELF>(TextSec.getBeginSymbol()));
1174}
1175
1176MCSection *
1178 if (Ctx->getObjectFileType() != MCContext::IsELF)
1179 return nullptr;
1180
1181 const MCSectionELF &ElfSec = static_cast<const MCSectionELF &>(TextSec);
1182 unsigned Flags = ELF::SHF_LINK_ORDER | ELF::SHF_ALLOC;
1183 StringRef GroupName;
1184 if (const MCSymbol *Group = ElfSec.getGroup()) {
1185 GroupName = Group->getName();
1186 Flags |= ELF::SHF_GROUP;
1187 }
1188
1189 return Ctx->getELFSection(".kcfi_traps", ELF::SHT_PROGBITS, Flags, 0,
1190 GroupName,
1191 /*IsComdat=*/true, ElfSec.getUniqueID(),
1192 cast<MCSymbolELF>(TextSec.getBeginSymbol()));
1193}
1194
1195MCSection *
1197 if (Ctx->getObjectFileType() != MCContext::IsELF)
1198 return PseudoProbeSection;
1199
1200 const auto &ElfSec = static_cast<const MCSectionELF &>(TextSec);
1201 unsigned Flags = ELF::SHF_LINK_ORDER;
1202 StringRef GroupName;
1203 if (const MCSymbol *Group = ElfSec.getGroup()) {
1204 GroupName = Group->getName();
1205 Flags |= ELF::SHF_GROUP;
1206 }
1207
1209 Flags, 0, GroupName, true, ElfSec.getUniqueID(),
1210 cast<MCSymbolELF>(TextSec.getBeginSymbol()));
1211}
1212
1213MCSection *
1215 if (Ctx->getObjectFileType() == MCContext::IsELF) {
1216 // Create a separate comdat group for each function's descriptor in order
1217 // for the linker to deduplicate. The duplication, must be from different
1218 // tranlation unit, can come from:
1219 // 1. Inline functions defined in header files;
1220 // 2. ThinLTO imported funcions;
1221 // 3. Weak-linkage definitions.
1222 // Use a concatenation of the section name and the function name as the
1223 // group name so that descriptor-only groups won't be folded with groups of
1224 // code.
1225 if (Ctx->getTargetTriple().supportsCOMDAT() && !FuncName.empty()) {
1226 auto *S = static_cast<MCSectionELF *>(PseudoProbeDescSection);
1227 auto Flags = S->getFlags() | ELF::SHF_GROUP;
1228 return Ctx->getELFSection(S->getName(), S->getType(), Flags,
1229 S->getEntrySize(),
1230 S->getName() + "_" + FuncName,
1231 /*IsComdat=*/true);
1232 }
1233 }
1235}
1236
1238 return LLVMStatsSection;
1239}
1240
1242 const MCSection *TextSec) const {
1243 if (Ctx->getObjectFileType() != MCContext::IsELF)
1244 return nullptr;
1245
1246 // SHF_WRITE for relocations, and let user post-process data in-place.
1248
1249 if (!TextSec)
1250 TextSec = getTextSection();
1251
1252 StringRef GroupName;
1253 const auto &ElfSec = static_cast<const MCSectionELF &>(*TextSec);
1254 if (const MCSymbol *Group = ElfSec.getGroup()) {
1255 GroupName = Group->getName();
1256 Flags |= ELF::SHF_GROUP;
1257 }
1258 return Ctx->getELFSection(Name, ELF::SHT_PROGBITS, Flags, 0, GroupName, true,
1259 ElfSec.getUniqueID(),
1260 cast<MCSymbolELF>(TextSec->getBeginSymbol()));
1261}
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:546
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:81
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:442
Environment getObjectFileType() const
Definition: MCContext.h:420
MCSectionWasm * getWasmSection(const Twine &Section, SectionKind K, unsigned Flags=0)
Definition: MCContext.h:643
MCSectionELF * getELFSection(const Twine &Section, unsigned Type, unsigned Flags)
Definition: MCContext.h:562
const StringRef & getSwift5ReflectionSegmentName() const
Definition: MCContext.h:422
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:788
const MCAsmInfo * getAsmInfo() const
Definition: MCContext.h:437
MCSectionCOFF * getCOFFSection(StringRef Section, unsigned Characteristics, SectionKind Kind, StringRef COMDATSymName, int Selection, unsigned UniqueID=GenericSectionID, const char *BeginSymName=nullptr)
Definition: MCContext.cpp:676
MCSectionDXContainer * getDXContainerSection(StringRef Section, SectionKind K)
Get the section for the provided Section name.
Definition: MCContext.cpp:870
@ GenericSectionID
Pass this value as the UniqueID during section creation to get the generic section with the given nam...
Definition: MCContext.h:545
MCSectionSPIRV * getSPIRVSection()
Definition: MCContext.cpp:858
EmitDwarfUnwindType emitDwarfUnwindInfo() const
Definition: MCContext.cpp:937
MCSectionGOFF * getGOFFSection(StringRef Section, SectionKind Kind, MCSection *Parent, const MCExpr *SubsectionId)
Definition: MCContext.cpp:658
const Triple & getTargetTriple() const
Definition: MCContext.h:425
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
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:39
void setAlignment(Align Value)
Definition: MCSection.h:141
StringRef getName() const
Definition: MCSection.h:124
MCSymbol * getBeginSymbol()
Definition: MCSection.h:129
void setSymbolTableName(StringRef STN)
Definition: MCSymbolXCOFF.h:62
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:40
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:752
ObjectFormatType getObjectFormat() const
Get the object format for this triple.
Definition: Triple.h:399
bool supportsCOMDAT() const
Tests whether the target supports comdat.
Definition: Triple.h:1048
@ aarch64_be
Definition: Triple.h:52
@ mips64el
Definition: Triple.h:67
@ aarch64_32
Definition: Triple.h:53
@ DXContainer
Definition: Triple.h:301
@ UnknownObjectFormat
Definition: Triple.h:298
#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
@ SHF_MERGE
Definition: ELF.h:1163
@ SHF_STRINGS
Definition: ELF.h:1166
@ SHF_EXCLUDE
Definition: ELF.h:1191
@ SHF_ALLOC
Definition: ELF.h:1157
@ SHF_LINK_ORDER
Definition: ELF.h:1172
@ SHF_GROUP
Definition: ELF.h:1179
@ SHF_WRITE
Definition: ELF.h:1154
@ SHF_TLS
Definition: ELF.h:1182
@ SHF_EXECINSTR
Definition: ELF.h:1160
@ SHT_PROGBITS
Definition: ELF.h:1063
@ SHT_NOBITS
Definition: ELF.h:1070
@ SHT_MIPS_DWARF
Definition: ELF.h:1135
@ SHT_LLVM_BB_ADDR_MAP
Definition: ELF.h:1100
@ SHT_X86_64_UNWIND
Definition: ELF.h:1131
@ SK_PPA1
Definition: GOFF.h:169
@ SK_PPA2
Definition: GOFF.h:170
@ 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:159
@ SSUBTYP_DWFRAME
DWARF frame section.
Definition: XCOFF.h:164
@ SSUBTYP_DWABREV
DWARF abbrev section.
Definition: XCOFF.h:160
@ SSUBTYP_DWINFO
DWARF info section.
Definition: XCOFF.h:155
@ SSUBTYP_DWRNGES
DWARF ranges section.
Definition: XCOFF.h:162
@ SSUBTYP_DWLOC
DWARF loc section.
Definition: XCOFF.h:163
@ SSUBTYP_DWMAC
DWARF macinfo section.
Definition: XCOFF.h:165
@ SSUBTYP_DWPBNMS
DWARF pubnames section.
Definition: XCOFF.h:157
@ SSUBTYP_DWPBTYP
DWARF pubtypes section.
Definition: XCOFF.h:158
@ SSUBTYP_DWLINE
DWARF line section.
Definition: XCOFF.h:156
@ SSUBTYP_DWSTR
DWARF str section.
Definition: XCOFF.h:161
@ XMC_TC0
TOC Anchor for TOC Addressability.
Definition: XCOFF.h:118
@ XMC_RW
Read Write Data.
Definition: XCOFF.h:117
@ XMC_TL
Initialized thread-local variable.
Definition: XCOFF.h:126
@ XMC_RO
Read Only Constant.
Definition: XCOFF.h:106
@ XMC_PR
Program Code.
Definition: XCOFF.h:105
@ XTY_SD
Csect definition for initialized storage.
Definition: XCOFF.h:242
@ DW_EH_PE_pcrel
Definition: Dwarf.h:848
@ DW_EH_PE_sdata4
Definition: Dwarf.h:845
@ DW_EH_PE_sdata8
Definition: Dwarf.h:846
@ DW_EH_PE_absptr
Definition: Dwarf.h:837
@ WASM_SEG_FLAG_STRINGS
Definition: Wasm.h:217
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