LLVM  4.0.0
MCObjectFileInfo.cpp
Go to the documentation of this file.
1 //===-- MCObjectFileInfo.cpp - Object File Information --------------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
11 #include "llvm/ADT/StringExtras.h"
12 #include "llvm/ADT/Triple.h"
13 #include "llvm/MC/MCAsmInfo.h"
14 #include "llvm/MC/MCContext.h"
15 #include "llvm/MC/MCSection.h"
16 #include "llvm/MC/MCSectionCOFF.h"
17 #include "llvm/MC/MCSectionELF.h"
18 #include "llvm/MC/MCSectionMachO.h"
19 #include "llvm/Support/COFF.h"
20 
21 using namespace llvm;
22 
23 static bool useCompactUnwind(const Triple &T) {
24  // Only on darwin.
25  if (!T.isOSDarwin())
26  return false;
27 
28  // aarch64 always has it.
29  if (T.getArch() == Triple::aarch64)
30  return true;
31 
32  // armv7k always has it.
33  if (T.isWatchABI())
34  return true;
35 
36  // Use it on newer version of OS X.
37  if (T.isMacOSX() && !T.isMacOSXVersionLT(10, 6))
38  return true;
39 
40  // And the iOS simulator.
41  if (T.isiOS() &&
42  (T.getArch() == Triple::x86_64 || T.getArch() == Triple::x86))
43  return true;
44 
45  return false;
46 }
47 
48 void MCObjectFileInfo::initMachOMCObjectFileInfo(const Triple &T) {
49  // MachO
51 
53  "__TEXT", "__eh_frame",
57 
58  if (T.isOSDarwin() && T.getArch() == Triple::aarch64)
60 
61  if (T.isWatchABI())
63 
69 
70  // .comm doesn't support alignment before Leopard.
71  if (T.isMacOSX() && T.isMacOSXVersionLT(10, 5))
73 
74  TextSection // .text
75  = Ctx->getMachOSection("__TEXT", "__text",
78  DataSection // .data
79  = Ctx->getMachOSection("__DATA", "__data", 0, SectionKind::getData());
80 
81  // BSSSection might not be expected initialized on msvc.
82  BSSSection = nullptr;
83 
84  TLSDataSection // .tdata
85  = Ctx->getMachOSection("__DATA", "__thread_data",
88  TLSBSSSection // .tbss
89  = Ctx->getMachOSection("__DATA", "__thread_bss",
92 
93  // TODO: Verify datarel below.
94  TLSTLVSection // .tlv
95  = Ctx->getMachOSection("__DATA", "__thread_vars",
98 
100  "__DATA", "__thread_init", MachO::S_THREAD_LOCAL_INIT_FUNCTION_POINTERS,
102 
103  CStringSection // .cstring
104  = Ctx->getMachOSection("__TEXT", "__cstring",
108  = Ctx->getMachOSection("__TEXT","__ustring", 0,
110  FourByteConstantSection // .literal4
111  = Ctx->getMachOSection("__TEXT", "__literal4",
114  EightByteConstantSection // .literal8
115  = Ctx->getMachOSection("__TEXT", "__literal8",
118 
119  SixteenByteConstantSection // .literal16
120  = Ctx->getMachOSection("__TEXT", "__literal16",
123 
124  ReadOnlySection // .const
125  = Ctx->getMachOSection("__TEXT", "__const", 0,
127 
128  // If the target is not powerpc, map the coal sections to the non-coal
129  // sections.
130  //
131  // "__TEXT/__textcoal_nt" => section "__TEXT/__text"
132  // "__TEXT/__const_coal" => section "__TEXT/__const"
133  // "__DATA/__datacoal_nt" => section "__DATA/__data"
134  Triple::ArchType ArchTy = T.getArch();
135 
136  if (ArchTy == Triple::ppc || ArchTy == Triple::ppc64) {
138  = Ctx->getMachOSection("__TEXT", "__textcoal_nt",
143  = Ctx->getMachOSection("__TEXT", "__const_coal",
147  "__DATA", "__datacoal_nt", MachO::S_COALESCED, SectionKind::getData());
148  } else {
152  }
153 
154  ConstDataSection // .const_data
155  = Ctx->getMachOSection("__DATA", "__const", 0,
158  = Ctx->getMachOSection("__DATA","__common",
162  = Ctx->getMachOSection("__DATA","__bss", MachO::S_ZEROFILL,
164 
165 
167  = Ctx->getMachOSection("__DATA", "__la_symbol_ptr",
171  = Ctx->getMachOSection("__DATA", "__nl_symbol_ptr",
174 
176  = Ctx->getMachOSection("__DATA", "__thread_ptr",
179 
180  // Exception Handling.
181  LSDASection = Ctx->getMachOSection("__TEXT", "__gcc_except_tab", 0,
183 
184  COFFDebugSymbolsSection = nullptr;
185  COFFDebugTypesSection = nullptr;
186 
187  if (useCompactUnwind(T)) {
189  Ctx->getMachOSection("__LD", "__compact_unwind", MachO::S_ATTR_DEBUG,
191 
192  if (T.getArch() == Triple::x86_64 || T.getArch() == Triple::x86)
193  CompactUnwindDwarfEHFrameOnly = 0x04000000; // UNWIND_X86_64_MODE_DWARF
194  else if (T.getArch() == Triple::aarch64)
195  CompactUnwindDwarfEHFrameOnly = 0x03000000; // UNWIND_ARM64_MODE_DWARF
196  else if (T.getArch() == Triple::arm || T.getArch() == Triple::thumb)
197  CompactUnwindDwarfEHFrameOnly = 0x04000000; // UNWIND_ARM_MODE_DWARF
198  }
199 
200  // Debug Information.
202  Ctx->getMachOSection("__DWARF", "__apple_names", MachO::S_ATTR_DEBUG,
203  SectionKind::getMetadata(), "names_begin");
205  Ctx->getMachOSection("__DWARF", "__apple_objc", MachO::S_ATTR_DEBUG,
206  SectionKind::getMetadata(), "objc_begin");
207  // 16 character section limit...
209  Ctx->getMachOSection("__DWARF", "__apple_namespac", MachO::S_ATTR_DEBUG,
210  SectionKind::getMetadata(), "namespac_begin");
212  Ctx->getMachOSection("__DWARF", "__apple_types", MachO::S_ATTR_DEBUG,
213  SectionKind::getMetadata(), "types_begin");
214 
216  Ctx->getMachOSection("__DWARF", "__debug_abbrev", MachO::S_ATTR_DEBUG,
217  SectionKind::getMetadata(), "section_abbrev");
219  Ctx->getMachOSection("__DWARF", "__debug_info", MachO::S_ATTR_DEBUG,
220  SectionKind::getMetadata(), "section_info");
222  Ctx->getMachOSection("__DWARF", "__debug_line", MachO::S_ATTR_DEBUG,
223  SectionKind::getMetadata(), "section_line");
225  Ctx->getMachOSection("__DWARF", "__debug_frame", MachO::S_ATTR_DEBUG,
228  Ctx->getMachOSection("__DWARF", "__debug_pubnames", MachO::S_ATTR_DEBUG,
231  Ctx->getMachOSection("__DWARF", "__debug_pubtypes", MachO::S_ATTR_DEBUG,
234  Ctx->getMachOSection("__DWARF", "__debug_gnu_pubn", MachO::S_ATTR_DEBUG,
237  Ctx->getMachOSection("__DWARF", "__debug_gnu_pubt", MachO::S_ATTR_DEBUG,
240  Ctx->getMachOSection("__DWARF", "__debug_str", MachO::S_ATTR_DEBUG,
241  SectionKind::getMetadata(), "info_string");
243  Ctx->getMachOSection("__DWARF", "__debug_loc", MachO::S_ATTR_DEBUG,
244  SectionKind::getMetadata(), "section_debug_loc");
246  Ctx->getMachOSection("__DWARF", "__debug_aranges", MachO::S_ATTR_DEBUG,
249  Ctx->getMachOSection("__DWARF", "__debug_ranges", MachO::S_ATTR_DEBUG,
250  SectionKind::getMetadata(), "debug_range");
252  Ctx->getMachOSection("__DWARF", "__debug_macinfo", MachO::S_ATTR_DEBUG,
253  SectionKind::getMetadata(), "debug_macinfo");
255  Ctx->getMachOSection("__DWARF", "__debug_inlined", MachO::S_ATTR_DEBUG,
258  Ctx->getMachOSection("__DWARF", "__debug_cu_index", MachO::S_ATTR_DEBUG,
261  Ctx->getMachOSection("__DWARF", "__debug_tu_index", MachO::S_ATTR_DEBUG,
263  StackMapSection = Ctx->getMachOSection("__LLVM_STACKMAPS", "__llvm_stackmaps",
265 
266  FaultMapSection = Ctx->getMachOSection("__LLVM_FAULTMAPS", "__llvm_faultmaps",
268 
270 }
271 
272 void MCObjectFileInfo::initELFMCObjectFileInfo(const Triple &T) {
273  switch (T.getArch()) {
274  case Triple::mips:
275  case Triple::mipsel:
277  break;
278  case Triple::mips64:
279  case Triple::mips64el:
281  break;
282  case Triple::x86_64:
286  break;
287  default:
289  break;
290  }
291 
292  switch (T.getArch()) {
293  case Triple::arm:
294  case Triple::armeb:
295  case Triple::thumb:
296  case Triple::thumbeb:
298  break;
299  // Fallthrough if not using EHABI
301  case Triple::ppc:
302  case Triple::x86:
303  PersonalityEncoding = PositionIndependent
308  LSDAEncoding = PositionIndependent
311  TTypeEncoding = PositionIndependent
315  break;
316  case Triple::x86_64:
317  if (PositionIndependent) {
319  ((CMModel == CodeModel::Small || CMModel == CodeModel::Medium)
322  (CMModel == CodeModel::Small
325  ((CMModel == CodeModel::Small || CMModel == CodeModel::Medium)
326  ? dwarf::DW_EH_PE_sdata4 : dwarf::DW_EH_PE_sdata8);
327  } else {
329  (CMModel == CodeModel::Small || CMModel == CodeModel::Medium)
331  LSDAEncoding = (CMModel == CodeModel::Small)
333  TTypeEncoding = (CMModel == CodeModel::Small)
335  }
336  break;
337  case Triple::hexagon:
342  if (PositionIndependent) {
347  }
348  break;
349  case Triple::aarch64:
350  case Triple::aarch64_be:
351  // The small model guarantees static code/data size < 4GB, but not where it
352  // will be in memory. Most of these could end up >2GB away so even a signed
353  // pc-relative 32-bit address is insufficient, theoretically.
354  if (PositionIndependent) {
360  } else {
364  }
365  break;
366  case Triple::lanai:
370  break;
371  case Triple::mips:
372  case Triple::mipsel:
373  case Triple::mips64:
374  case Triple::mips64el:
375  // MIPS uses indirect pointer to refer personality functions and types, so
376  // that the eh_frame section can be read-only. DW.ref.personality will be
377  // generated for relocation.
379  // FIXME: The N64 ABI probably ought to use DW_EH_PE_sdata8 but we can't
380  // identify N64 from just a triple.
383  // We don't support PC-relative LSDA references in GAS so we use the default
384  // DW_EH_PE_absptr for those.
385 
386  // FreeBSD must be explicit about the data size and using pcrel since it's
387  // assembler/linker won't do the automatic conversion that the Linux tools
388  // do.
389  if (T.isOSFreeBSD()) {
392  }
393  break;
394  case Triple::ppc64:
395  case Triple::ppc64le:
401  break;
402  case Triple::sparcel:
403  case Triple::sparc:
404  if (PositionIndependent) {
410  } else {
414  }
415  break;
416  case Triple::sparcv9:
418  if (PositionIndependent) {
423  } else {
426  }
427  break;
428  case Triple::systemz:
429  // All currently-defined code models guarantee that 4-byte PC-relative
430  // values will be in range.
431  if (PositionIndependent) {
437  } else {
441  }
442  break;
443  default:
444  break;
445  }
446 
447  unsigned EHSectionType = T.getArch() == Triple::x86_64
450 
451  // Solaris requires different flags for .eh_frame to seemingly every other
452  // platform.
453  unsigned EHSectionFlags = ELF::SHF_ALLOC;
454  if (T.isOSSolaris() && T.getArch() != Triple::x86_64)
455  EHSectionFlags |= ELF::SHF_WRITE;
456 
457  // ELF
460 
463 
466 
469 
471  Ctx->getELFSection(".tdata", ELF::SHT_PROGBITS,
473 
476 
477  DataRelROSection = Ctx->getELFSection(".data.rel.ro", ELF::SHT_PROGBITS,
479 
481  Ctx->getELFSection(".rodata.cst4", ELF::SHT_PROGBITS,
482  ELF::SHF_ALLOC | ELF::SHF_MERGE, 4, "");
483 
485  Ctx->getELFSection(".rodata.cst8", ELF::SHT_PROGBITS,
486  ELF::SHF_ALLOC | ELF::SHF_MERGE, 8, "");
487 
489  Ctx->getELFSection(".rodata.cst16", ELF::SHT_PROGBITS,
490  ELF::SHF_ALLOC | ELF::SHF_MERGE, 16, "");
491 
493  Ctx->getELFSection(".rodata.cst32", ELF::SHT_PROGBITS,
494  ELF::SHF_ALLOC | ELF::SHF_MERGE, 32, "");
495 
496  // Exception Handling Sections.
497 
498  // FIXME: We're emitting LSDA info into a readonly section on ELF, even though
499  // it contains relocatable pointers. In PIC mode, this is probably a big
500  // runtime hit for C++ apps. Either the contents of the LSDA need to be
501  // adjusted or this should be a data section.
502  LSDASection = Ctx->getELFSection(".gcc_except_table", ELF::SHT_PROGBITS,
504 
505  COFFDebugSymbolsSection = nullptr;
506  COFFDebugTypesSection = nullptr;
507 
508  // Debug Info Sections.
509  DwarfAbbrevSection = Ctx->getELFSection(".debug_abbrev", ELF::SHT_PROGBITS, 0,
510  "section_abbrev");
512  Ctx->getELFSection(".debug_info", ELF::SHT_PROGBITS, 0, "section_info");
513  DwarfLineSection = Ctx->getELFSection(".debug_line", ELF::SHT_PROGBITS, 0);
514  DwarfFrameSection = Ctx->getELFSection(".debug_frame", ELF::SHT_PROGBITS, 0);
516  Ctx->getELFSection(".debug_pubnames", ELF::SHT_PROGBITS, 0);
518  Ctx->getELFSection(".debug_pubtypes", ELF::SHT_PROGBITS, 0);
520  Ctx->getELFSection(".debug_gnu_pubnames", ELF::SHT_PROGBITS, 0);
522  Ctx->getELFSection(".debug_gnu_pubtypes", ELF::SHT_PROGBITS, 0);
524  Ctx->getELFSection(".debug_str", ELF::SHT_PROGBITS,
526  DwarfLocSection = Ctx->getELFSection(".debug_loc", ELF::SHT_PROGBITS, 0);
528  Ctx->getELFSection(".debug_aranges", ELF::SHT_PROGBITS, 0);
530  Ctx->getELFSection(".debug_ranges", ELF::SHT_PROGBITS, 0, "debug_range");
531  DwarfMacinfoSection = Ctx->getELFSection(".debug_macinfo", ELF::SHT_PROGBITS,
532  0, "debug_macinfo");
533 
534  // DWARF5 Experimental Debug Info
535 
536  // Accelerator Tables
538  Ctx->getELFSection(".apple_names", ELF::SHT_PROGBITS, 0, "names_begin");
540  Ctx->getELFSection(".apple_objc", ELF::SHT_PROGBITS, 0, "objc_begin");
542  ".apple_namespaces", ELF::SHT_PROGBITS, 0, "namespac_begin");
544  Ctx->getELFSection(".apple_types", ELF::SHT_PROGBITS, 0, "types_begin");
545 
546  // Fission Sections
548  Ctx->getELFSection(".debug_info.dwo", ELF::SHT_PROGBITS, 0);
550  Ctx->getELFSection(".debug_types.dwo", ELF::SHT_PROGBITS, 0);
552  Ctx->getELFSection(".debug_abbrev.dwo", ELF::SHT_PROGBITS, 0);
554  Ctx->getELFSection(".debug_str.dwo", ELF::SHT_PROGBITS,
557  Ctx->getELFSection(".debug_line.dwo", ELF::SHT_PROGBITS, 0);
559  Ctx->getELFSection(".debug_loc.dwo", ELF::SHT_PROGBITS, 0, "skel_loc");
561  Ctx->getELFSection(".debug_str_offsets.dwo", ELF::SHT_PROGBITS, 0);
563  Ctx->getELFSection(".debug_addr", ELF::SHT_PROGBITS, 0, "addr_sec");
564 
565  // DWP Sections
567  Ctx->getELFSection(".debug_cu_index", ELF::SHT_PROGBITS, 0);
569  Ctx->getELFSection(".debug_tu_index", ELF::SHT_PROGBITS, 0);
570 
572  Ctx->getELFSection(".llvm_stackmaps", ELF::SHT_PROGBITS, ELF::SHF_ALLOC);
573 
575  Ctx->getELFSection(".llvm_faultmaps", ELF::SHT_PROGBITS, ELF::SHF_ALLOC);
576 
578  Ctx->getELFSection(".eh_frame", EHSectionType, EHSectionFlags);
579 }
580 
581 void MCObjectFileInfo::initCOFFMCObjectFileInfo(const Triple &T) {
586 
587  // Set the `IMAGE_SCN_MEM_16BIT` flag when compiling for thumb mode. This is
588  // used to indicate to the linker that the text segment contains thumb instructions
589  // and to set the ISA selection bit for calls accordingly.
590  const bool IsThumb = T.getArch() == Triple::thumb;
591 
593 
594  // COFF
595  BSSSection = Ctx->getCOFFSection(
600  ".text",
612 
613  // FIXME: We're emitting LSDA info into a readonly section on COFF, even
614  // though it contains relocatable pointers. In PIC mode, this is probably a
615  // big runtime hit for C++ apps. Either the contents of the LSDA need to be
616  // adjusted or this should be a data section.
617  if (T.getArch() == Triple::x86_64) {
618  // On Windows 64 with SEH, the LSDA is emitted into the .xdata section
619  LSDASection = nullptr;
620  } else {
621  LSDASection = Ctx->getCOFFSection(".gcc_except_table",
625  }
626 
627  // Debug info.
638 
640  ".debug_abbrev",
643  SectionKind::getMetadata(), "section_abbrev");
645  ".debug_info",
648  SectionKind::getMetadata(), "section_info");
650  ".debug_line",
653  SectionKind::getMetadata(), "section_line");
654 
656  ".debug_frame",
661  ".debug_pubnames",
666  ".debug_pubtypes",
671  ".debug_gnu_pubnames",
676  ".debug_gnu_pubtypes",
681  ".debug_str",
684  SectionKind::getMetadata(), "info_string");
686  ".debug_loc",
689  SectionKind::getMetadata(), "section_debug_loc");
691  ".debug_aranges",
696  ".debug_ranges",
699  SectionKind::getMetadata(), "debug_range");
701  ".debug_macinfo",
704  SectionKind::getMetadata(), "debug_macinfo");
706  ".debug_info.dwo",
709  SectionKind::getMetadata(), "section_info_dwo");
711  ".debug_types.dwo",
714  SectionKind::getMetadata(), "section_types_dwo");
716  ".debug_abbrev.dwo",
719  SectionKind::getMetadata(), "section_abbrev_dwo");
721  ".debug_str.dwo",
724  SectionKind::getMetadata(), "skel_string");
726  ".debug_line.dwo",
731  ".debug_loc.dwo",
734  SectionKind::getMetadata(), "skel_loc");
736  ".debug_str_offsets.dwo",
741  ".debug_addr",
744  SectionKind::getMetadata(), "addr_sec");
746  ".debug_cu_index",
751  ".debug_tu_index",
756  ".apple_names",
759  SectionKind::getMetadata(), "names_begin");
761  ".apple_namespaces",
764  SectionKind::getMetadata(), "namespac_begin");
766  ".apple_types",
769  SectionKind::getMetadata(), "types_begin");
771  ".apple_objc",
774  SectionKind::getMetadata(), "objc_begin");
775 
779 
783 
787 
790 
795 
796  StackMapSection = Ctx->getCOFFSection(".llvm_stackmaps",
800 }
801 
802 void MCObjectFileInfo::InitMCObjectFileInfo(const Triple &TheTriple, bool PIC,
803  CodeModel::Model cm,
804  MCContext &ctx) {
805  PositionIndependent = PIC;
806  CMModel = cm;
807  Ctx = &ctx;
808 
809  // Common.
814 
817 
819 
820  EHFrameSection = nullptr; // Created on demand.
821  CompactUnwindSection = nullptr; // Used only by selected targets.
822  DwarfAccelNamesSection = nullptr; // Used only by selected targets.
823  DwarfAccelObjCSection = nullptr; // Used only by selected targets.
824  DwarfAccelNamespaceSection = nullptr; // Used only by selected targets.
825  DwarfAccelTypesSection = nullptr; // Used only by selected targets.
826 
827  TT = TheTriple;
828 
829  switch (TT.getObjectFormat()) {
830  case Triple::MachO:
831  Env = IsMachO;
832  initMachOMCObjectFileInfo(TT);
833  break;
834  case Triple::COFF:
835  if (!TT.isOSWindows())
837  "Cannot initialize MC for non-Windows COFF object files.");
838 
839  Env = IsCOFF;
840  initCOFFMCObjectFileInfo(TT);
841  break;
842  case Triple::ELF:
843  Env = IsELF;
844  initELFMCObjectFileInfo(TT);
845  break;
847  report_fatal_error("Cannot initialize MC for unknown object file format.");
848  break;
849  }
850 }
851 
853  return Ctx->getELFSection(".debug_types", ELF::SHT_PROGBITS, ELF::SHF_GROUP,
854  0, utostr(Hash));
855 }
Instances of this class represent a uniqued identifier for a section in the current translation unit...
Definition: MCSection.h:40
MCSection * MergeableConst4Section
static SectionKind getData()
Definition: SectionKind.h:202
S_NON_LAZY_SYMBOL_POINTERS - Section with non-lazy symbol pointers.
const MCAsmInfo * getAsmInfo() const
Definition: MCContext.h:243
S_ATTR_STRIP_STATIC_SYMS - Ok to strip static symbols in this section in files with the MY_DYLDLINK f...
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
MCSection * DwarfPubTypesSection
MCSection * DwarfGnuPubTypesSection
Section for newer gnu pubtypes.
MCSection * StackMapSection
StackMap section.
MCSection * SixteenByteConstantSection
unsigned PersonalityEncoding
PersonalityEncoding, LSDAEncoding, TTypeEncoding - Some encoding values for EH.
MCSection * TextSection
Section directive for standard text.
MCSection * ConstTextCoalSection
bool isMacOSXVersionLT(unsigned Major, unsigned Minor=0, unsigned Micro=0) const
isMacOSXVersionLT - Comparison function for checking OS X version compatibility, which handles suppor...
Definition: Triple.h:412
S_ATTR_LIVE_SUPPORT - Blocks are live if they reference live blocks.
S_ATTR_DEBUG - A debug section.
MCSection * LazySymbolPointerSection
static SectionKind getMergeableConst8()
Definition: SectionKind.h:193
static SectionKind getMergeableConst16()
Definition: SectionKind.h:194
static SectionKind getMergeable1ByteCString()
Definition: SectionKind.h:183
S_THREAD_LOCAL_VARIABLES - Section with thread local variable structure data.
setjmp/longjmp based exceptions
MCSection * getDwarfTypesSection(uint64_t Hash) const
static SectionKind getMergeableConst4()
Definition: SectionKind.h:192
static bool useCompactUnwind(const Triple &T)
MCSectionCOFF * getCOFFSection(StringRef Section, unsigned Characteristics, SectionKind Kind, StringRef COMDATSymName, int Selection, unsigned UniqueID=GenericSectionID, const char *BeginSymName=nullptr)
Definition: MCContext.cpp:396
bool isOSWindows() const
Tests whether the OS is Windows.
Definition: Triple.h:540
void InitMCObjectFileInfo(const Triple &TT, bool PIC, CodeModel::Model CM, MCContext &ctx)
bool isMacOSX() const
isMacOSX - Is this a Mac OS X triple.
Definition: Triple.h:427
MCSection * MergeableConst32Section
S_4BYTE_LITERALS - Section with 4 byte literals.
static SectionKind getBSS()
Definition: SectionKind.h:198
MCSection * COFFDebugTypesSection
MCSection * MergeableConst16Section
MCSection * DwarfPubNamesSection
S_8BYTE_LITERALS - Section with 8 byte literals.
ObjectFormatType getObjectFormat() const
getFormat - Get the object format for this triple.
Definition: Triple.h:300
MCSection * EightByteConstantSection
MCSection * TLSDataSection
Section directive for Thread Local data. ELF, MachO and COFF.
Context object for machine code objects.
Definition: MCContext.h:51
S_ATTR_NO_TOC - Section contains coalesced symbols that are not to be in a ranlib table of contents...
const MCSection * DwarfDebugInlineSection
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:274
MCSection * DrectveSection
COFF specific sections.
static std::string utostr(uint64_t X, bool isNeg=false)
Definition: StringExtras.h:79
MCSection * DwarfAccelNamesSection
DWARF5 Experimental Debug Info Sections DwarfAccelNamesSection, DwarfAccelObjCSection, DwarfAccelNamespaceSection, DwarfAccelTypesSection - If we use the DWARF accelerated hash tables then we want to emit these sections.
ArchType getArch() const
getArch - Get the parsed architecture type of this triple.
Definition: Triple.h:270
MCSection * DataSection
Section directive for standard data.
S_ATTR_PURE_INSTRUCTIONS - Section contains only true machine instructions.
bool isiOS() const
Is this an iOS triple.
Definition: Triple.h:436
MCSection * ThreadLocalPointerSection
MCSection * TLSTLVSection
Section for thread local structure information.
S_THREAD_LOCAL_ZEROFILL - Thread local zerofill section.
MCSection * DwarfAccelNamespaceSection
ExceptionHandling getExceptionHandlingType() const
Definition: MCAsmInfo.h:538
S_THREAD_LOCAL_REGULAR - Thread local data section.
bool SupportsCompactUnwindWithoutEHFrame
True if the target object file supports emitting a compact unwind section without an associated EH fr...
S_CSTRING_LITERALS - Section with literal C strings.
bool CommDirectiveSupportsAlignment
True if .comm supports alignment.
bool isOSSolaris() const
Definition: Triple.h:477
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
MCSection * COFFDebugSymbolsSection
MCSection * DwarfAbbrevSection
bool isOSDarwin() const
isOSDarwin - Is this a "Darwin" OS (OS X, iOS, or watchOS).
Definition: Triple.h:455
MCSection * EHFrameSection
EH frame section.
S_LAZY_SYMBOL_POINTERS - Section with lazy symbol pointers.
MCSection * DwarfTypesDWOSection
static SectionKind getThreadBSS()
Definition: SectionKind.h:196
MCSection * DwarfRangesSection
S_THREAD_LOCAL_VARIABLE_POINTERS - Section with pointers to thread local structures.
static SectionKind getMetadata()
Definition: SectionKind.h:179
static SectionKind getReadOnlyWithRel()
Definition: SectionKind.h:203
MCSection * DwarfARangesSection
MCSection * CompactUnwindSection
If exception handling is supported by the target and the target can support a compact representation ...
MCSection * DwarfAccelTypesSection
S_THREAD_LOCAL_INIT_FUNCTION_POINTERS - Section with thread local variable initialization pointers to...
MCSection * DwarfStrOffDWOSection
S_16BYTE_LITERALS - Section with only 16 byte literals.
MCSection * DwarfGnuPubNamesSection
Section for newer gnu pubnames.
MCSection * DwarfAbbrevDWOSection
MCSection * FaultMapSection
FaultMap section.
bool OmitDwarfIfHaveCompactUnwind
OmitDwarfIfHaveCompactUnwind - True if the target object file supports having some functions with com...
MCSection * FourByteConstantSection
bool isWatchABI() const
Definition: Triple.h:450
static SectionKind getMergeable2ByteCString()
Definition: SectionKind.h:186
MCSection * LSDASection
If exception handling is supported by the target, this is the section the Language Specific Data Area...
MCSection * TLSExtraDataSection
Extra TLS Variable Data section.
unsigned CompactUnwindDwarfEHFrameOnly
Compact unwind encoding indicating that we should emit only an EH frame.
bool isOSFreeBSD() const
Definition: Triple.h:467
MCSection * DwarfAccelObjCSection
S_COALESCED - Section contains symbols that are to be coalesced.
MCSection * TLSBSSSection
Section directive for Thread Local uninitialized data.
MCSection * NonLazySymbolPointerSection
MCSectionELF * getELFSection(const Twine &Section, unsigned Type, unsigned Flags)
Definition: MCContext.h:341
const MCSection * TLSThreadInitSection
Section for thread local data initialization functions.
#define LLVM_FALLTHROUGH
LLVM_FALLTHROUGH - Mark fallthrough cases in switch statements.
Definition: Compiler.h:239
bool SupportsWeakOmittedEHFrame
True if target object file supports a weak_definition of constant 0 for an omitted EH frame...
std::string Hash(const Unit &U)
Definition: FuzzerSHA1.cpp:216
MCSection * BSSSection
Section that is default initialized to zero.
MCSection * ReadOnlySection
Section that is readonly and can contain arbitrary initialized data.
S_ZEROFILL - Zero fill on demand section.
MCSection * DwarfMacinfoSection
static SectionKind getReadOnly()
Definition: SectionKind.h:182
static SectionKind getText()
Definition: SectionKind.h:180
MCSection * MergeableConst8Section