LLVM  3.7.0
MCMachOStreamer.cpp
Go to the documentation of this file.
1 //===-- MCMachOStreamer.cpp - MachO Streamer ------------------------------===//
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 
10 #include "llvm/MC/MCStreamer.h"
11 #include "llvm/ADT/DenseMap.h"
12 #include "llvm/ADT/SmallVector.h"
13 #include "llvm/MC/MCAsmBackend.h"
14 #include "llvm/MC/MCAssembler.h"
15 #include "llvm/MC/MCCodeEmitter.h"
16 #include "llvm/MC/MCContext.h"
17 #include "llvm/MC/MCDwarf.h"
18 #include "llvm/MC/MCExpr.h"
19 #include "llvm/MC/MCInst.h"
23 #include "llvm/MC/MCSection.h"
24 #include "llvm/MC/MCSectionMachO.h"
25 #include "llvm/MC/MCSymbolMachO.h"
26 #include "llvm/Support/Dwarf.h"
30 
31 using namespace llvm;
32 
33 namespace {
34 
35 class MCMachOStreamer : public MCObjectStreamer {
36 private:
37  /// LabelSections - true if each section change should emit a linker local
38  /// label for use in relocations for assembler local references. Obviates the
39  /// need for local relocations. False by default.
40  bool LabelSections;
41 
42  bool DWARFMustBeAtTheEnd;
43  bool CreatedADWARFSection;
44 
45  /// HasSectionLabel - map of which sections have already had a non-local
46  /// label emitted to them. Used so we don't emit extraneous linker local
47  /// labels in the middle of the section.
48  DenseMap<const MCSection*, bool> HasSectionLabel;
49 
50  void EmitInstToData(const MCInst &Inst, const MCSubtargetInfo &STI) override;
51 
52  void EmitDataRegion(DataRegionData::KindTy Kind);
53  void EmitDataRegionEnd();
54 
55 public:
56  MCMachOStreamer(MCContext &Context, MCAsmBackend &MAB, raw_pwrite_stream &OS,
57  MCCodeEmitter *Emitter, bool DWARFMustBeAtTheEnd, bool label)
58  : MCObjectStreamer(Context, MAB, OS, Emitter), LabelSections(label),
59  DWARFMustBeAtTheEnd(DWARFMustBeAtTheEnd), CreatedADWARFSection(false) {}
60 
61  /// state management
62  void reset() override {
63  HasSectionLabel.clear();
65  }
66 
67  /// @name MCStreamer Interface
68  /// @{
69 
70  void ChangeSection(MCSection *Sect, const MCExpr *Subsect) override;
71  void EmitLabel(MCSymbol *Symbol) override;
72  void EmitEHSymAttributes(const MCSymbol *Symbol, MCSymbol *EHSymbol) override;
73  void EmitAssemblerFlag(MCAssemblerFlag Flag) override;
74  void EmitLinkerOptions(ArrayRef<std::string> Options) override;
75  void EmitDataRegion(MCDataRegionType Kind) override;
76  void EmitVersionMin(MCVersionMinType Kind, unsigned Major,
77  unsigned Minor, unsigned Update) override;
78  void EmitThumbFunc(MCSymbol *Func) override;
79  bool EmitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute) override;
80  void EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) override;
81  void EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
82  unsigned ByteAlignment) override;
83  void BeginCOFFSymbolDef(const MCSymbol *Symbol) override {
84  llvm_unreachable("macho doesn't support this directive");
85  }
86  void EmitCOFFSymbolStorageClass(int StorageClass) override {
87  llvm_unreachable("macho doesn't support this directive");
88  }
89  void EmitCOFFSymbolType(int Type) override {
90  llvm_unreachable("macho doesn't support this directive");
91  }
92  void EndCOFFSymbolDef() override {
93  llvm_unreachable("macho doesn't support this directive");
94  }
95  void EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
96  unsigned ByteAlignment) override;
97  void EmitZerofill(MCSection *Section, MCSymbol *Symbol = nullptr,
98  uint64_t Size = 0, unsigned ByteAlignment = 0) override;
99  void EmitTBSSSymbol(MCSection *Section, MCSymbol *Symbol, uint64_t Size,
100  unsigned ByteAlignment = 0) override;
101 
102  void EmitFileDirective(StringRef Filename) override {
103  // FIXME: Just ignore the .file; it isn't important enough to fail the
104  // entire assembly.
105 
106  // report_fatal_error("unsupported directive: '.file'");
107  }
108 
109  void EmitIdent(StringRef IdentString) override {
110  llvm_unreachable("macho doesn't support this directive");
111  }
112 
113  void EmitLOHDirective(MCLOHType Kind, const MCLOHArgs &Args) override {
114  getAssembler().getLOHContainer().addDirective(Kind, Args);
115  }
116 
117  void FinishImpl() override;
118 };
119 
120 } // end anonymous namespace.
121 
122 static bool canGoAfterDWARF(const MCSectionMachO &MSec) {
123  // These sections are created by the assembler itself after the end of
124  // the .s file.
125  StringRef SegName = MSec.getSegmentName();
126  StringRef SecName = MSec.getSectionName();
127 
128  if (SegName == "__LD" && SecName == "__compact_unwind")
129  return true;
130 
131  if (SegName == "__IMPORT") {
132  if (SecName == "__jump_table")
133  return true;
134 
135  if (SecName == "__pointers")
136  return true;
137  }
138 
139  if (SegName == "__TEXT" && SecName == "__eh_frame")
140  return true;
141 
142  if (SegName == "__DATA" && SecName == "__nl_symbol_ptr")
143  return true;
144 
145  return false;
146 }
147 
148 void MCMachOStreamer::ChangeSection(MCSection *Section,
149  const MCExpr *Subsection) {
150  // Change the section normally.
151  bool Created = MCObjectStreamer::changeSectionImpl(Section, Subsection);
152  const MCSectionMachO &MSec = *cast<MCSectionMachO>(Section);
153  StringRef SegName = MSec.getSegmentName();
154  if (SegName == "__DWARF")
155  CreatedADWARFSection = true;
156  else if (Created && DWARFMustBeAtTheEnd && !canGoAfterDWARF(MSec))
157  assert(!CreatedADWARFSection && "Creating regular section after DWARF");
158 
159  // Output a linker-local symbol so we don't need section-relative local
160  // relocations. The linker hates us when we do that.
161  if (LabelSections && !HasSectionLabel[Section] &&
162  !Section->getBeginSymbol()) {
163  MCSymbol *Label = getContext().createLinkerPrivateTempSymbol();
164  Section->setBeginSymbol(Label);
165  HasSectionLabel[Section] = true;
166  }
167 }
168 
169 void MCMachOStreamer::EmitEHSymAttributes(const MCSymbol *Symbol,
170  MCSymbol *EHSymbol) {
171  getAssembler().registerSymbol(*Symbol);
172  if (Symbol->isExternal())
173  EmitSymbolAttribute(EHSymbol, MCSA_Global);
174  if (cast<MCSymbolMachO>(Symbol)->isWeakDefinition())
175  EmitSymbolAttribute(EHSymbol, MCSA_WeakDefinition);
176  if (Symbol->isPrivateExtern())
177  EmitSymbolAttribute(EHSymbol, MCSA_PrivateExtern);
178 }
179 
180 void MCMachOStreamer::EmitLabel(MCSymbol *Symbol) {
181  assert(Symbol->isUndefined() && "Cannot define a symbol twice!");
182 
183  // isSymbolLinkerVisible uses the section.
184  AssignSection(Symbol, getCurrentSection().first);
185  // We have to create a new fragment if this is an atom defining symbol,
186  // fragments cannot span atoms.
187  if (getAssembler().isSymbolLinkerVisible(*Symbol))
188  insert(new MCDataFragment());
189 
191 
192  // This causes the reference type flag to be cleared. Darwin 'as' was "trying"
193  // to clear the weak reference and weak definition bits too, but the
194  // implementation was buggy. For now we just try to match 'as', for
195  // diffability.
196  //
197  // FIXME: Cleanup this code, these bits should be emitted based on semantic
198  // properties, not on the order of definition, etc.
199  cast<MCSymbolMachO>(Symbol)->clearReferenceType();
200 }
201 
202 void MCMachOStreamer::EmitDataRegion(DataRegionData::KindTy Kind) {
203  if (!getAssembler().getBackend().hasDataInCodeSupport())
204  return;
205  // Create a temporary label to mark the start of the data region.
206  MCSymbol *Start = getContext().createTempSymbol();
207  EmitLabel(Start);
208  // Record the region for the object writer to use.
209  DataRegionData Data = { Kind, Start, nullptr };
210  std::vector<DataRegionData> &Regions = getAssembler().getDataRegions();
211  Regions.push_back(Data);
212 }
213 
214 void MCMachOStreamer::EmitDataRegionEnd() {
215  if (!getAssembler().getBackend().hasDataInCodeSupport())
216  return;
217  std::vector<DataRegionData> &Regions = getAssembler().getDataRegions();
218  assert(!Regions.empty() && "Mismatched .end_data_region!");
219  DataRegionData &Data = Regions.back();
220  assert(!Data.End && "Mismatched .end_data_region!");
221  // Create a temporary label to mark the end of the data region.
222  Data.End = getContext().createTempSymbol();
223  EmitLabel(Data.End);
224 }
225 
226 void MCMachOStreamer::EmitAssemblerFlag(MCAssemblerFlag Flag) {
227  // Let the target do whatever target specific stuff it needs to do.
228  getAssembler().getBackend().handleAssemblerFlag(Flag);
229  // Do any generic stuff we need to do.
230  switch (Flag) {
231  case MCAF_SyntaxUnified: return; // no-op here.
232  case MCAF_Code16: return; // Change parsing mode; no-op here.
233  case MCAF_Code32: return; // Change parsing mode; no-op here.
234  case MCAF_Code64: return; // Change parsing mode; no-op here.
236  getAssembler().setSubsectionsViaSymbols(true);
237  return;
238  }
239 }
240 
241 void MCMachOStreamer::EmitLinkerOptions(ArrayRef<std::string> Options) {
242  getAssembler().getLinkerOptions().push_back(Options);
243 }
244 
245 void MCMachOStreamer::EmitDataRegion(MCDataRegionType Kind) {
246  switch (Kind) {
247  case MCDR_DataRegion:
248  EmitDataRegion(DataRegionData::Data);
249  return;
250  case MCDR_DataRegionJT8:
251  EmitDataRegion(DataRegionData::JumpTable8);
252  return;
253  case MCDR_DataRegionJT16:
254  EmitDataRegion(DataRegionData::JumpTable16);
255  return;
256  case MCDR_DataRegionJT32:
257  EmitDataRegion(DataRegionData::JumpTable32);
258  return;
259  case MCDR_DataRegionEnd:
260  EmitDataRegionEnd();
261  return;
262  }
263 }
264 
265 void MCMachOStreamer::EmitVersionMin(MCVersionMinType Kind, unsigned Major,
266  unsigned Minor, unsigned Update) {
267  getAssembler().setVersionMinInfo(Kind, Major, Minor, Update);
268 }
269 
270 void MCMachOStreamer::EmitThumbFunc(MCSymbol *Symbol) {
271  // Remember that the function is a thumb function. Fixup and relocation
272  // values will need adjusted.
273  getAssembler().setIsThumbFunc(Symbol);
274  cast<MCSymbolMachO>(Symbol)->setThumbFunc();
275 }
276 
277 bool MCMachOStreamer::EmitSymbolAttribute(MCSymbol *Sym,
279  MCSymbolMachO *Symbol = cast<MCSymbolMachO>(Sym);
280 
281  // Indirect symbols are handled differently, to match how 'as' handles
282  // them. This makes writing matching .o files easier.
283  if (Attribute == MCSA_IndirectSymbol) {
284  // Note that we intentionally cannot use the symbol data here; this is
285  // important for matching the string table that 'as' generates.
286  IndirectSymbolData ISD;
287  ISD.Symbol = Symbol;
288  ISD.Section = getCurrentSectionOnly();
289  getAssembler().getIndirectSymbols().push_back(ISD);
290  return true;
291  }
292 
293  // Adding a symbol attribute always introduces the symbol, note that an
294  // important side effect of calling registerSymbol here is to register
295  // the symbol with the assembler.
296  getAssembler().registerSymbol(*Symbol);
297 
298  // The implementation of symbol attributes is designed to match 'as', but it
299  // leaves much to desired. It doesn't really make sense to arbitrarily add and
300  // remove flags, but 'as' allows this (in particular, see .desc).
301  //
302  // In the future it might be worth trying to make these operations more well
303  // defined.
304  switch (Attribute) {
305  case MCSA_Invalid:
308  case MCSA_ELF_TypeObject:
309  case MCSA_ELF_TypeTLS:
310  case MCSA_ELF_TypeCommon:
311  case MCSA_ELF_TypeNoType:
313  case MCSA_Hidden:
314  case MCSA_IndirectSymbol:
315  case MCSA_Internal:
316  case MCSA_Protected:
317  case MCSA_Weak:
318  case MCSA_Local:
319  return false;
320 
321  case MCSA_Global:
322  Symbol->setExternal(true);
323  // This effectively clears the undefined lazy bit, in Darwin 'as', although
324  // it isn't very consistent because it implements this as part of symbol
325  // lookup.
326  //
327  // FIXME: Cleanup this code, these bits should be emitted based on semantic
328  // properties, not on the order of definition, etc.
329  Symbol->setReferenceTypeUndefinedLazy(false);
330  break;
331 
332  case MCSA_LazyReference:
333  // FIXME: This requires -dynamic.
334  Symbol->setNoDeadStrip();
335  if (Symbol->isUndefined())
336  Symbol->setReferenceTypeUndefinedLazy(true);
337  break;
338 
339  // Since .reference sets the no dead strip bit, it is equivalent to
340  // .no_dead_strip in practice.
341  case MCSA_Reference:
342  case MCSA_NoDeadStrip:
343  Symbol->setNoDeadStrip();
344  break;
345 
346  case MCSA_SymbolResolver:
347  Symbol->setSymbolResolver();
348  break;
349 
350  case MCSA_PrivateExtern:
351  Symbol->setExternal(true);
352  Symbol->setPrivateExtern(true);
353  break;
354 
355  case MCSA_WeakReference:
356  // FIXME: This requires -dynamic.
357  if (Symbol->isUndefined())
358  Symbol->setWeakReference();
359  break;
360 
361  case MCSA_WeakDefinition:
362  // FIXME: 'as' enforces that this is defined and global. The manual claims
363  // it has to be in a coalesced section, but this isn't enforced.
364  Symbol->setWeakDefinition();
365  break;
366 
368  Symbol->setWeakDefinition();
369  Symbol->setWeakReference();
370  break;
371  }
372 
373  return true;
374 }
375 
376 void MCMachOStreamer::EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) {
377  // Encode the 'desc' value into the lowest implementation defined bits.
378  getAssembler().registerSymbol(*Symbol);
379  cast<MCSymbolMachO>(Symbol)->setDesc(DescValue);
380 }
381 
382 void MCMachOStreamer::EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
383  unsigned ByteAlignment) {
384  // FIXME: Darwin 'as' does appear to allow redef of a .comm by itself.
385  assert(Symbol->isUndefined() && "Cannot define a symbol twice!");
386 
387  AssignSection(Symbol, nullptr);
388 
389  getAssembler().registerSymbol(*Symbol);
390  Symbol->setExternal(true);
391  Symbol->setCommon(Size, ByteAlignment);
392 }
393 
394 void MCMachOStreamer::EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
395  unsigned ByteAlignment) {
396  // '.lcomm' is equivalent to '.zerofill'.
397  return EmitZerofill(getContext().getObjectFileInfo()->getDataBSSSection(),
398  Symbol, Size, ByteAlignment);
399 }
400 
401 void MCMachOStreamer::EmitZerofill(MCSection *Section, MCSymbol *Symbol,
402  uint64_t Size, unsigned ByteAlignment) {
403  getAssembler().registerSection(*Section);
404 
405  // The symbol may not be present, which only creates the section.
406  if (!Symbol)
407  return;
408 
409  // On darwin all virtual sections have zerofill type.
410  assert(Section->isVirtualSection() && "Section does not have zerofill type!");
411 
412  assert(Symbol->isUndefined() && "Cannot define a symbol twice!");
413 
414  getAssembler().registerSymbol(*Symbol);
415 
416  // Emit an align fragment if necessary.
417  if (ByteAlignment != 1)
418  new MCAlignFragment(ByteAlignment, 0, 0, ByteAlignment, Section);
419 
420  AssignSection(Symbol, Section);
421 
422  MCFragment *F = new MCFillFragment(0, 0, Size, Section);
423  Symbol->setFragment(F);
424 
425  // Update the maximum alignment on the zero fill section if necessary.
426  if (ByteAlignment > Section->getAlignment())
427  Section->setAlignment(ByteAlignment);
428 }
429 
430 // This should always be called with the thread local bss section. Like the
431 // .zerofill directive this doesn't actually switch sections on us.
432 void MCMachOStreamer::EmitTBSSSymbol(MCSection *Section, MCSymbol *Symbol,
433  uint64_t Size, unsigned ByteAlignment) {
434  EmitZerofill(Section, Symbol, Size, ByteAlignment);
435  return;
436 }
437 
438 void MCMachOStreamer::EmitInstToData(const MCInst &Inst,
439  const MCSubtargetInfo &STI) {
440  MCDataFragment *DF = getOrCreateDataFragment();
441 
444  raw_svector_ostream VecOS(Code);
445  getAssembler().getEmitter().encodeInstruction(Inst, VecOS, Fixups, STI);
446  VecOS.flush();
447 
448  // Add the fixups and data.
449  for (unsigned i = 0, e = Fixups.size(); i != e; ++i) {
450  Fixups[i].setOffset(Fixups[i].getOffset() + DF->getContents().size());
451  DF->getFixups().push_back(Fixups[i]);
452  }
453  DF->getContents().append(Code.begin(), Code.end());
454 }
455 
456 void MCMachOStreamer::FinishImpl() {
457  EmitFrames(&getAssembler().getBackend());
458 
459  // We have to set the fragment atom associations so we can relax properly for
460  // Mach-O.
461 
462  // First, scan the symbol table to build a lookup table from fragments to
463  // defining symbols.
465  for (const MCSymbol &Symbol : getAssembler().symbols()) {
466  if (getAssembler().isSymbolLinkerVisible(Symbol) && Symbol.getFragment()) {
467  // An atom defining symbol should never be internal to a fragment.
468  assert(Symbol.getOffset() == 0 &&
469  "Invalid offset in atom defining symbol!");
470  DefiningSymbolMap[Symbol.getFragment()] = &Symbol;
471  }
472  }
473 
474  // Set the fragment atom associations by tracking the last seen atom defining
475  // symbol.
476  for (MCAssembler::iterator it = getAssembler().begin(),
477  ie = getAssembler().end(); it != ie; ++it) {
478  const MCSymbol *CurrentAtom = nullptr;
479  for (MCSection::iterator it2 = it->begin(), ie2 = it->end(); it2 != ie2;
480  ++it2) {
481  if (const MCSymbol *Symbol = DefiningSymbolMap.lookup(it2))
482  CurrentAtom = Symbol;
483  it2->setAtom(CurrentAtom);
484  }
485  }
486 
488 }
489 
492  bool RelaxAll, bool DWARFMustBeAtTheEnd,
493  bool LabelSections) {
494  MCMachOStreamer *S = new MCMachOStreamer(Context, MAB, OS, CE,
495  DWARFMustBeAtTheEnd, LabelSections);
496  if (RelaxAll)
497  S->getAssembler().setRelaxAll(true);
498  return S;
499 }
Instances of this class represent a uniqued identifier for a section in the current translation unit...
Definition: MCSection.h:48
const_iterator end(StringRef path)
Get end iterator over path.
Definition: Path.cpp:240
void setPrivateExtern(bool Value)
Definition: MCSymbol.h:393
bool changeSectionImpl(MCSection *Section, const MCExpr *Subsection)
MCSectionMachO - This represents a section on a Mach-O system (used by Mac OS X). ...
ValueT lookup(const KeyT &Val) const
lookup - Return the entry for the specified key, or a default constructed value if no such entry exis...
Definition: DenseMap.h:159
void EmitLabel(MCSymbol *Symbol) override
Emit a label for Symbol into the current section.
.type _foo, STT_OBJECT # aka
Definition: MCDirectives.h:25
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:39
Not a valid directive.
Definition: MCDirectives.h:20
void setAlignment(unsigned Value)
Definition: MCSection.h:125
A raw_ostream that writes to an SmallVector or SmallString.
Definition: raw_ostream.h:488
const_iterator begin(StringRef path)
Get begin iterator over path.
Definition: Path.cpp:232
F(f)
MCDataRegionType
Definition: MCDirectives.h:55
bool isExternal() const
Definition: MCSymbol.h:389
.type _foo, STT_NOTYPE # aka
Definition: MCDirectives.h:28
unsigned getAlignment() const
Definition: MCSection.h:124
static std::error_code getOffset(const SymbolRef &Sym, SectionRef Sec, uint64_t &Result)
COFF::SymbolStorageClass StorageClass
Definition: COFFYAML.cpp:294
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition: ErrorHandling.h:98
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition: APInt.h:33
Base class for the full range of assembler expressions which are needed for parsing.
Definition: MCExpr.h:33
.data_region jt16
Definition: MCDirectives.h:58
void setCommon(uint64_t Size, unsigned Align)
Mark this symbol as being 'common'.
Definition: MCSymbol.h:343
.local (ELF)
Definition: MCDirectives.h:35
.no_dead_strip (MachO)
Definition: MCDirectives.h:36
#define false
Definition: ConvertUTF.c:65
Context object for machine code objects.
Definition: MCContext.h:48
void setWeakReference() const
Definition: MCSymbolMachO.h:73
.code16 (X86) / .code 16 (ARM)
Definition: MCDirectives.h:50
Streaming object file generation interface.
StringRef getSectionName() const
.type _foo, STT_GNU_IFUNC
Definition: MCDirectives.h:24
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
Definition: ArrayRef.h:31
.protected (ELF)
Definition: MCDirectives.h:39
void setWeakDefinition() const
Definition: MCSymbolMachO.h:80
void setExternal(bool Value) const
Definition: MCSymbol.h:390
.lazy_reference (MachO)
Definition: MCDirectives.h:34
SmallVectorImpl< char > & getContents()
Definition: MCAssembler.h:186
.reference (MachO)
Definition: MCDirectives.h:40
Instances of this class represent a single low-level machine instruction.
Definition: MCInst.h:150
Flag
These should be considered private to the implementation of the MCInstrDesc class.
Definition: MCInstrDesc.h:97
.hidden (ELF)
Definition: MCDirectives.h:31
.data_region jt32
Definition: MCDirectives.h:59
Streaming machine code generation interface.
Definition: MCStreamer.h:157
.weak_def_can_be_hidden (MachO)
Definition: MCDirectives.h:44
The instances of the Type class are immutable: once they are created, they are never changed...
Definition: Type.h:45
MCCodeEmitter - Generic instruction encoding interface.
Definition: MCCodeEmitter.h:23
SmallVectorImpl< MCFixup > & getFixups()
Definition: MCAssembler.h:211
MCLOHType
Linker Optimization Hint Type.
.subsections_via_symbols (MachO)
Definition: MCDirectives.h:49
void setReferenceTypeUndefinedLazy(bool Value) const
Definition: MCSymbolMachO.h:52
MCFragment * getFragment() const
Definition: MCSymbol.h:382
.weak_reference (MachO)
Definition: MCDirectives.h:43
void append(in_iter in_start, in_iter in_end)
Add the specified range to the end of the SmallVector.
Definition: SmallVector.h:416
static bool canGoAfterDWARF(const MCSectionMachO &MSec)
void setSymbolResolver() const
Definition: MCSymbolMachO.h:87
void setFragment(MCFragment *Value) const
Definition: MCSymbol.h:385
virtual bool isVirtualSection() const =0
Check whether this section is "virtual", that is has no actual object file contents.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
Definition: SmallVector.h:861
.indirect_symbol (MachO)
Definition: MCDirectives.h:32
An iterator type that allows iterating over the pointees via some other iterator. ...
Definition: iterator.h:231
.type _foo, STT_TLS # aka
Definition: MCDirectives.h:26
MCSymbol * getBeginSymbol()
Definition: MCSection.h:113
MCSymbolAttr
Definition: MCDirectives.h:19
void setNoDeadStrip() const
Definition: MCSymbolMachO.h:66
.syntax (ARM/ELF)
Definition: MCDirectives.h:48
.internal (ELF)
Definition: MCDirectives.h:33
StringRef getSegmentName() const
.code32 (X86) / .code 32 (ARM)
Definition: MCDirectives.h:51
.type _foo, STT_COMMON # aka
Definition: MCDirectives.h:27
.code64 (X86)
Definition: MCDirectives.h:52
.symbol_resolver (MachO)
Definition: MCDirectives.h:37
.type _foo,
Definition: MCDirectives.h:30
void FinishImpl() override
Streamer specific finalization.
uint64_t getOffset() const
Definition: MCSymbol.h:319
MCAssemblerFlag
Definition: MCDirectives.h:47
.type _foo, STT_FUNC # aka
Definition: MCDirectives.h:23
void reset() override
state management
MCSubtargetInfo - Generic base class for all target subtargets.
.weak_definition (MachO)
Definition: MCDirectives.h:42
An abstract base class for streams implementations that also support a pwrite operation.
Definition: raw_ostream.h:321
Fragment for data and encoded instructions.
Definition: MCAssembler.h:228
.private_extern (MachO)
Definition: MCDirectives.h:38
const ARM::ArchExtKind Kind
.data_region jt8
Definition: MCDirectives.h:57
bool isPrivateExtern() const
Definition: MCSymbol.h:392
cl::opt< bool > RelaxAll("mc-relax-all", cl::desc("When used with filetype=obj, ""relax all fixups in the emitted object file"))
MCStreamer * createMachOStreamer(MCContext &Ctx, MCAsmBackend &TAB, raw_pwrite_stream &OS, MCCodeEmitter *CE, bool RelaxAll, bool DWARFMustBeAtTheEnd, bool LabelSections=false)
MCVersionMinType
Definition: MCDirectives.h:63
Generic interface to target specific assembler backends.
Definition: MCAsmBackend.h:34
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:40
bool isUndefined() const
isUndefined - Check if this symbol undefined (i.e., implicitly defined).
Definition: MCSymbol.h:258
.end_data_region
Definition: MCDirectives.h:60
void setBeginSymbol(MCSymbol *Sym)
Definition: MCSection.h:117