LLVM 22.0.0git
MCMachOStreamer.cpp
Go to the documentation of this file.
1//===- MCMachOStreamer.cpp - MachO Streamer -------------------------------===//
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
9#include "llvm/ADT/DenseMap.h"
11#include "llvm/ADT/StringRef.h"
14#include "llvm/MC/MCAssembler.h"
16#include "llvm/MC/MCContext.h"
18#include "llvm/MC/MCExpr.h"
19#include "llvm/MC/MCFixup.h"
25#include "llvm/MC/MCSection.h"
27#include "llvm/MC/MCSymbol.h"
29#include "llvm/MC/MCValue.h"
30#include "llvm/MC/SectionKind.h"
34#include <cassert>
35#include <vector>
36
37namespace llvm {
38class MCInst;
39class MCStreamer;
40class MCSubtargetInfo;
41class Triple;
42} // namespace llvm
43
44using namespace llvm;
45
46namespace {
47
48class MCMachOStreamer : public MCObjectStreamer {
49private:
50 /// LabelSections - true if each section change should emit a linker local
51 /// label for use in relocations for assembler local references. Obviates the
52 /// need for local relocations. False by default.
53 bool LabelSections;
54
55 /// HasSectionLabel - map of which sections have already had a non-local
56 /// label emitted to them. Used so we don't emit extraneous linker local
57 /// labels in the middle of the section.
58 DenseMap<const MCSection*, bool> HasSectionLabel;
59
60 void emitDataRegion(MachO::DataRegionType Kind);
61 void emitDataRegionEnd();
62
63public:
64 MCMachOStreamer(MCContext &Context, std::unique_ptr<MCAsmBackend> MAB,
65 std::unique_ptr<MCObjectWriter> OW,
66 std::unique_ptr<MCCodeEmitter> Emitter, bool label)
67 : MCObjectStreamer(Context, std::move(MAB), std::move(OW),
68 std::move(Emitter)),
69 LabelSections(label) {}
70
71 /// state management
72 void reset() override {
73 HasSectionLabel.clear();
75 }
76
77 MachObjectWriter &getWriter() {
78 return static_cast<MachObjectWriter &>(getAssembler().getWriter());
79 }
80
81 /// @name MCStreamer Interface
82 /// @{
83
84 void changeSection(MCSection *Sect, uint32_t Subsection = 0) override;
85 void emitLabel(MCSymbol *Symbol, SMLoc Loc = SMLoc()) override;
86 void emitAssignment(MCSymbol *Symbol, const MCExpr *Value) override;
87 void emitEHSymAttributes(const MCSymbol *Symbol, MCSymbol *EHSymbol) override;
88 void emitSubsectionsViaSymbols() override;
89 void emitLinkerOptions(ArrayRef<std::string> Options) override;
90 void emitDataRegion(MCDataRegionType Kind) override;
91 void emitVersionMin(MCVersionMinType Kind, unsigned Major, unsigned Minor,
92 unsigned Update, VersionTuple SDKVersion) override;
93 void emitBuildVersion(unsigned Platform, unsigned Major, unsigned Minor,
94 unsigned Update, VersionTuple SDKVersion) override;
95 void emitDarwinTargetVariantBuildVersion(unsigned Platform, unsigned Major,
96 unsigned Minor, unsigned Update,
97 VersionTuple SDKVersion) override;
98 bool emitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute) override;
99 void emitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) override;
100 void emitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
101 Align ByteAlignment) override;
102
103 void emitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
104 Align ByteAlignment) override;
105 void emitZerofill(MCSection *Section, MCSymbol *Symbol = nullptr,
106 uint64_t Size = 0, Align ByteAlignment = Align(1),
107 SMLoc Loc = SMLoc()) override;
108 void emitTBSSSymbol(MCSection *Section, MCSymbol *Symbol, uint64_t Size,
109 Align ByteAlignment = Align(1)) override;
110
111 void emitIdent(StringRef IdentString) override {
112 llvm_unreachable("macho doesn't support this directive");
113 }
114
115 void emitLOHDirective(MCLOHType Kind, const MCLOHArgs &Args) override {
116 getWriter().getLOHContainer().addDirective(Kind, Args);
117 }
118 void emitCGProfileEntry(const MCSymbolRefExpr *From,
119 const MCSymbolRefExpr *To, uint64_t Count) override {
120 if (!From->getSymbol().isTemporary() && !To->getSymbol().isTemporary())
121 getWriter().getCGProfile().push_back({From, To, Count});
122 }
123
124 void finishImpl() override;
125
126 void finalizeCGProfileEntry(const MCSymbolRefExpr *&SRE);
127 void finalizeCGProfile();
128 void createAddrSigSection();
129};
130
131} // end anonymous namespace.
132
133void MCMachOStreamer::changeSection(MCSection *Section, uint32_t Subsection) {
134 MCObjectStreamer::changeSection(Section, Subsection);
135
136 // Output a linker-local symbol so we don't need section-relative local
137 // relocations. The linker hates us when we do that.
138 if (LabelSections && !HasSectionLabel[Section] &&
139 !Section->getBeginSymbol()) {
140 MCSymbol *Label = getContext().createLinkerPrivateTempSymbol();
141 Section->setBeginSymbol(Label);
142 HasSectionLabel[Section] = true;
143 if (!Label->isInSection())
144 emitLabel(Label);
145 }
146}
147
148void MCMachOStreamer::emitEHSymAttributes(const MCSymbol *Symbol,
149 MCSymbol *EHSymbol) {
150 auto *Sym = static_cast<const MCSymbolMachO *>(Symbol);
151 getAssembler().registerSymbol(*Symbol);
152 if (Sym->isExternal())
153 emitSymbolAttribute(EHSymbol, MCSA_Global);
154 if (Sym->isWeakDefinition())
155 emitSymbolAttribute(EHSymbol, MCSA_WeakDefinition);
156 if (Sym->isPrivateExtern())
157 emitSymbolAttribute(EHSymbol, MCSA_PrivateExtern);
158}
159
160void MCMachOStreamer::emitLabel(MCSymbol *Symbol, SMLoc Loc) {
161 // We have to create a new fragment if this is an atom defining symbol,
162 // fragments cannot span atoms.
163 if (static_cast<MCSymbolMachO *>(Symbol)->isSymbolLinkerVisible())
164 newFragment();
165
166 MCObjectStreamer::emitLabel(Symbol, Loc);
167
168 // This causes the reference type flag to be cleared. Darwin 'as' was "trying"
169 // to clear the weak reference and weak definition bits too, but the
170 // implementation was buggy. For now we just try to match 'as', for
171 // diffability.
172 //
173 // FIXME: Cleanup this code, these bits should be emitted based on semantic
174 // properties, not on the order of definition, etc.
175 static_cast<MCSymbolMachO *>(Symbol)->clearReferenceType();
176}
177
178void MCMachOStreamer::emitAssignment(MCSymbol *Symbol, const MCExpr *Value) {
179 MCValue Res;
180
181 if (Value->evaluateAsRelocatable(Res, nullptr)) {
182 if (const auto *SymA = Res.getAddSym()) {
183 if (!Res.getSubSym() &&
184 (SymA->getName().empty() || Res.getConstant() != 0))
185 static_cast<MCSymbolMachO *>(Symbol)->setAltEntry();
186 }
187 }
189}
190
191void MCMachOStreamer::emitDataRegion(MachO::DataRegionType Kind) {
192 // Create a temporary label to mark the start of the data region.
193 MCSymbol *Start = getContext().createTempSymbol();
194 emitLabel(Start);
195 // Record the region for the object writer to use.
196 getWriter().getDataRegions().push_back({Kind, Start, nullptr});
197}
198
199void MCMachOStreamer::emitDataRegionEnd() {
200 auto &Regions = getWriter().getDataRegions();
201 assert(!Regions.empty() && "Mismatched .end_data_region!");
202 auto &Data = Regions.back();
203 assert(!Data.End && "Mismatched .end_data_region!");
204 // Create a temporary label to mark the end of the data region.
205 Data.End = getContext().createTempSymbol();
206 emitLabel(Data.End);
207}
208
209void MCMachOStreamer::emitSubsectionsViaSymbols() {
210 getWriter().setSubsectionsViaSymbols(true);
211}
212
213void MCMachOStreamer::emitLinkerOptions(ArrayRef<std::string> Options) {
214 getWriter().getLinkerOptions().push_back(Options);
215}
216
217void MCMachOStreamer::emitDataRegion(MCDataRegionType Kind) {
218 switch (Kind) {
219 case MCDR_DataRegion:
220 emitDataRegion(MachO::DataRegionType::DICE_KIND_DATA);
221 return;
223 emitDataRegion(MachO::DataRegionType::DICE_KIND_JUMP_TABLE8);
224 return;
226 emitDataRegion(MachO::DataRegionType::DICE_KIND_JUMP_TABLE16);
227 return;
229 emitDataRegion(MachO::DataRegionType::DICE_KIND_JUMP_TABLE32);
230 return;
232 emitDataRegionEnd();
233 return;
234 }
235}
236
237void MCMachOStreamer::emitVersionMin(MCVersionMinType Kind, unsigned Major,
238 unsigned Minor, unsigned Update,
239 VersionTuple SDKVersion) {
240 getWriter().setVersionMin(Kind, Major, Minor, Update, SDKVersion);
241}
242
243void MCMachOStreamer::emitBuildVersion(unsigned Platform, unsigned Major,
244 unsigned Minor, unsigned Update,
245 VersionTuple SDKVersion) {
246 getWriter().setBuildVersion((MachO::PlatformType)Platform, Major, Minor,
247 Update, SDKVersion);
248}
249
250void MCMachOStreamer::emitDarwinTargetVariantBuildVersion(
251 unsigned Platform, unsigned Major, unsigned Minor, unsigned Update,
252 VersionTuple SDKVersion) {
253 getWriter().setTargetVariantBuildVersion((MachO::PlatformType)Platform, Major,
254 Minor, Update, SDKVersion);
255}
256
257bool MCMachOStreamer::emitSymbolAttribute(MCSymbol *Sym,
259 auto *Symbol = static_cast<MCSymbolMachO *>(Sym);
260
261 // Indirect symbols are handled differently, to match how 'as' handles
262 // them. This makes writing matching .o files easier.
264 // Note that we intentionally cannot use the symbol data here; this is
265 // important for matching the string table that 'as' generates.
266 getWriter().getIndirectSymbols().push_back(
267 {Symbol, getCurrentSectionOnly()});
268 return true;
269 }
270
271 // Adding a symbol attribute always introduces the symbol, note that an
272 // important side effect of calling registerSymbol here is to register
273 // the symbol with the assembler.
274 getAssembler().registerSymbol(*Symbol);
275
276 // The implementation of symbol attributes is designed to match 'as', but it
277 // leaves much to desired. It doesn't really make sense to arbitrarily add and
278 // remove flags, but 'as' allows this (in particular, see .desc).
279 //
280 // In the future it might be worth trying to make these operations more well
281 // defined.
282 switch (Attribute) {
283 case MCSA_Invalid:
287 case MCSA_ELF_TypeTLS:
291 case MCSA_Extern:
292 case MCSA_Hidden:
294 case MCSA_Internal:
295 case MCSA_Protected:
296 case MCSA_Weak:
297 case MCSA_Local:
298 case MCSA_LGlobal:
299 case MCSA_Exported:
300 case MCSA_Memtag:
301 case MCSA_WeakAntiDep:
302 case MCSA_OSLinkage:
303 case MCSA_XPLinkage:
304 return false;
305
306 case MCSA_Global:
307 Symbol->setExternal(true);
308 // This effectively clears the undefined lazy bit, in Darwin 'as', although
309 // it isn't very consistent because it implements this as part of symbol
310 // lookup.
311 //
312 // FIXME: Cleanup this code, these bits should be emitted based on semantic
313 // properties, not on the order of definition, etc.
314 Symbol->setReferenceTypeUndefinedLazy(false);
315 break;
316
318 // FIXME: This requires -dynamic.
319 Symbol->setNoDeadStrip();
320 if (Symbol->isUndefined())
321 Symbol->setReferenceTypeUndefinedLazy(true);
322 break;
323
324 // Since .reference sets the no dead strip bit, it is equivalent to
325 // .no_dead_strip in practice.
326 case MCSA_Reference:
327 case MCSA_NoDeadStrip:
328 Symbol->setNoDeadStrip();
329 break;
330
332 Symbol->setSymbolResolver();
333 break;
334
335 case MCSA_AltEntry:
336 Symbol->setAltEntry();
337 break;
338
340 Symbol->setExternal(true);
341 Symbol->setPrivateExtern(true);
342 break;
343
345 // FIXME: This requires -dynamic.
346 if (Symbol->isUndefined())
347 Symbol->setWeakReference();
348 break;
349
351 // FIXME: 'as' enforces that this is defined and global. The manual claims
352 // it has to be in a coalesced section, but this isn't enforced.
353 Symbol->setWeakDefinition();
354 break;
355
357 Symbol->setWeakDefinition();
358 Symbol->setWeakReference();
359 break;
360
361 case MCSA_Cold:
362 Symbol->setCold();
363 break;
364 }
365
366 return true;
367}
368
369void MCMachOStreamer::emitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) {
370 // Encode the 'desc' value into the lowest implementation defined bits.
371 getAssembler().registerSymbol(*Symbol);
372 static_cast<MCSymbolMachO *>(Symbol)->setDesc(DescValue);
373}
374
375void MCMachOStreamer::emitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
376 Align ByteAlignment) {
377 auto &Sym = static_cast<MCSymbolMachO &>(*Symbol);
378 // FIXME: Darwin 'as' does appear to allow redef of a .comm by itself.
379 assert(Symbol->isUndefined() && "Cannot define a symbol twice!");
380
381 getAssembler().registerSymbol(Sym);
382 Sym.setExternal(true);
383 Sym.setCommon(Size, ByteAlignment);
384}
385
386void MCMachOStreamer::emitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
387 Align ByteAlignment) {
388 // '.lcomm' is equivalent to '.zerofill'.
389 return emitZerofill(getContext().getObjectFileInfo()->getDataBSSSection(),
390 Symbol, Size, ByteAlignment);
391}
392
393void MCMachOStreamer::emitZerofill(MCSection *Section, MCSymbol *Symbol,
394 uint64_t Size, Align ByteAlignment,
395 SMLoc Loc) {
396 // On darwin all virtual sections have zerofill type. Disallow the usage of
397 // .zerofill in non-virtual functions. If something similar is needed, use
398 // .space or .zero.
399 if (!Section->isBssSection()) {
400 getContext().reportError(
401 Loc, "The usage of .zerofill is restricted to sections of "
402 "ZEROFILL type. Use .zero or .space instead.");
403 return; // Early returning here shouldn't harm. EmitZeros should work on any
404 // section.
405 }
406
407 pushSection();
408 switchSection(Section);
409
410 // The symbol may not be present, which only creates the section.
411 if (Symbol) {
412 emitValueToAlignment(ByteAlignment, 0, 1, 0);
413 emitLabel(Symbol);
414 emitZeros(Size);
415 }
416 popSection();
417}
418
419// This should always be called with the thread local bss section. Like the
420// .zerofill directive this doesn't actually switch sections on us.
421void MCMachOStreamer::emitTBSSSymbol(MCSection *Section, MCSymbol *Symbol,
422 uint64_t Size, Align ByteAlignment) {
423 emitZerofill(Section, Symbol, Size, ByteAlignment);
424}
425
426void MCMachOStreamer::finishImpl() {
427 emitFrames();
428
429 // We have to set the fragment atom associations so we can relax properly for
430 // Mach-O.
431
432 // First, scan the symbol table to build a lookup table from fragments to
433 // defining symbols.
434 DenseMap<const MCFragment *, const MCSymbol *> DefiningSymbolMap;
435 for (const MCSymbol &Symbol : getAssembler().symbols()) {
436 auto &Sym = static_cast<const MCSymbolMachO &>(Symbol);
437 if (Sym.isSymbolLinkerVisible() && Sym.isInSection() && !Sym.isVariable() &&
438 !Sym.isAltEntry()) {
439 // An atom defining symbol should never be internal to a fragment.
440 assert(Symbol.getOffset() == 0 &&
441 "Invalid offset in atom defining symbol!");
442 DefiningSymbolMap[Symbol.getFragment()] = &Symbol;
443 }
444 }
445
446 // Set the fragment atom associations by tracking the last seen atom defining
447 // symbol.
448 for (MCSection &Sec : getAssembler()) {
449 static_cast<MCSectionMachO &>(Sec).allocAtoms();
450 const MCSymbol *CurrentAtom = nullptr;
451 size_t I = 0;
452 for (MCFragment &Frag : Sec) {
453 if (const MCSymbol *Symbol = DefiningSymbolMap.lookup(&Frag))
454 CurrentAtom = Symbol;
455 static_cast<MCSectionMachO &>(Sec).setAtom(I++, CurrentAtom);
456 }
457 }
458
459 finalizeCGProfile();
460
461 createAddrSigSection();
463}
464
465void MCMachOStreamer::finalizeCGProfileEntry(const MCSymbolRefExpr *&SRE) {
466 auto *S =
467 static_cast<MCSymbolMachO *>(const_cast<MCSymbol *>(&SRE->getSymbol()));
468 if (getAssembler().registerSymbol(*S))
469 S->setExternal(true);
470}
471
472void MCMachOStreamer::finalizeCGProfile() {
473 MCAssembler &Asm = getAssembler();
474 MCObjectWriter &W = getWriter();
475 if (W.getCGProfile().empty())
476 return;
477 for (auto &E : W.getCGProfile()) {
478 finalizeCGProfileEntry(E.From);
479 finalizeCGProfileEntry(E.To);
480 }
481 // We can't write the section out until symbol indices are finalized which
482 // doesn't happen until after section layout. We need to create the section
483 // and set its size now so that it's accounted for in layout.
484 MCSection *CGProfileSection = Asm.getContext().getMachOSection(
485 "__LLVM", "__cg_profile", 0, SectionKind::getMetadata());
486 // Call the base class changeSection to omit the linker-local label.
487 MCObjectStreamer::changeSection(CGProfileSection);
488 // For each entry, reserve space for 2 32-bit indices and a 64-bit count.
489 size_t SectionBytes =
490 W.getCGProfile().size() * (2 * sizeof(uint32_t) + sizeof(uint64_t));
491 (*CGProfileSection->begin())
492 .setVarContents(std::vector<char>(SectionBytes, 0));
493}
494
496 std::unique_ptr<MCAsmBackend> &&MAB,
497 std::unique_ptr<MCObjectWriter> &&OW,
498 std::unique_ptr<MCCodeEmitter> &&CE,
499 bool DWARFMustBeAtTheEnd,
500 bool LabelSections) {
501 return new MCMachOStreamer(Context, std::move(MAB), std::move(OW),
502 std::move(CE), LabelSections);
503}
504
505// The AddrSig section uses a series of relocations to refer to the symbols that
506// should be considered address-significant. The only interesting content of
507// these relocations is their symbol; the type, length etc will be ignored by
508// the linker. The reason we are not referring to the symbol indices directly is
509// that those indices will be invalidated by tools that update the symbol table.
510// Symbol relocations OTOH will have their indices updated by e.g. llvm-strip.
511void MCMachOStreamer::createAddrSigSection() {
512 MCAssembler &Asm = getAssembler();
513 MCObjectWriter &writer = Asm.getWriter();
514 if (!writer.getEmitAddrsigSection())
515 return;
516 // Create the AddrSig section and first data fragment here as its layout needs
517 // to be computed immediately after in order for it to be exported correctly.
518 MCSection *AddrSigSection =
519 Asm.getContext().getObjectFileInfo()->getAddrSigSection();
520 // Call the base class changeSection to omit the linker-local label.
521 MCObjectStreamer::changeSection(AddrSigSection);
522 auto *Frag = cast<MCFragment>(AddrSigSection->curFragList()->Head);
523 // We will generate a series of pointer-sized symbol relocations at offset
524 // 0x0. Set the section size to be large enough to contain a single pointer
525 // (instead of emitting a zero-sized section) so these relocations are
526 // technically valid, even though we don't expect these relocations to
527 // actually be applied by the linker.
528 constexpr char zero[8] = {};
529 Frag->setVarContents(zero);
530}
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
dxil DXContainer Global Emitter
This file defines the DenseMap class.
static void zero(T &Obj)
static LVOptions Options
Definition LVOptions.cpp:25
#define I(x, y, z)
Definition MD5.cpp:57
static bool isSymbolLinkerVisible(const MCSymbol &Symbol)
This file defines the SmallVector class.
ValueT lookup(const_arg_type_t< KeyT > Val) const
lookup - Return the entry for the specified key, or a default constructed value if no such entry exis...
Definition DenseMap.h:205
Context object for machine code objects.
Definition MCContext.h:83
Instances of this class represent a single low-level machine instruction.
Definition MCInst.h:188
void reset() override
state management
void emitAssignment(MCSymbol *Symbol, const MCExpr *Value) override
Emit an assignment of Value to Symbol.
void emitLabel(MCSymbol *Symbol, SMLoc Loc=SMLoc()) override
Emit a label for Symbol into the current section.
void finishImpl() override
Streamer specific finalization.
void changeSection(MCSection *Section, uint32_t Subsection=0) override
This is called by popSection and switchSection, if the current section changes.
Defines the object file and target independent interfaces used by the assembler backend to write nati...
Instances of this class represent a uniqued identifier for a section in the current translation unit.
Definition MCSection.h:517
FragList * curFragList() const
Definition MCSection.h:624
iterator begin() const
Definition MCSection.h:625
Streaming machine code generation interface.
Definition MCStreamer.h:220
Generic base class for all target subtargets.
const MCSymbol & getSymbol() const
Definition MCExpr.h:227
void setCommon(uint64_t Size, Align Alignment)
Mark this symbol as being 'common'.
Definition MCSymbol.h:311
bool isInSection() const
isInSection - Check if this symbol is defined in some section (i.e., it is defined but not absolute).
Definition MCSymbol.h:237
bool isVariable() const
isVariable - Check if this is a variable symbol.
Definition MCSymbol.h:267
bool isTemporary() const
isTemporary - Check if this is an assembler temporary symbol.
Definition MCSymbol.h:205
const MCSymbol * getAddSym() const
Definition MCValue.h:49
int64_t getConstant() const
Definition MCValue.h:44
const MCSymbol * getSubSym() const
Definition MCValue.h:51
static SectionKind getMetadata()
Triple - Helper class for working with autoconf configuration names.
Definition Triple.h:47
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
Context & getContext() const
Definition BasicBlock.h:99
This is an optimization pass for GlobalISel generic memory operations.
FunctionAddr VTableAddr Value
Definition InstrProf.h:137
MCDataRegionType
@ MCDR_DataRegionEnd
.end_data_region
@ MCDR_DataRegion
.data_region
@ MCDR_DataRegionJT8
.data_region jt8
@ MCDR_DataRegionJT32
.data_region jt32
@ MCDR_DataRegionJT16
.data_region jt16
LLVM_ABI MCStreamer * createMachOStreamer(MCContext &Ctx, std::unique_ptr< MCAsmBackend > &&TAB, std::unique_ptr< MCObjectWriter > &&OW, std::unique_ptr< MCCodeEmitter > &&CE, bool DWARFMustBeAtTheEnd, bool LabelSections=false)
MCLOHDirective::LOHArgs MCLOHArgs
MCVersionMinType
FunctionAddr VTableAddr Count
Definition InstrProf.h:139
FunctionAddr VTableAddr uintptr_t uintptr_t Data
Definition InstrProf.h:189
MCLOHType
Linker Optimization Hint Type.
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Definition STLExtras.h:1915
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
Definition Casting.h:559
@ MCSA_Local
.local (ELF)
@ MCSA_WeakDefAutoPrivate
.weak_def_can_be_hidden (MachO)
@ MCSA_Memtag
.memtag (ELF)
@ MCSA_Protected
.protected (ELF)
@ MCSA_OSLinkage
symbol uses OS linkage (GOFF)
@ MCSA_Exported
.globl _foo, exported (XCOFF)
@ MCSA_PrivateExtern
.private_extern (MachO)
@ MCSA_Internal
.internal (ELF)
@ MCSA_WeakReference
.weak_reference (MachO)
@ MCSA_AltEntry
.alt_entry (MachO)
@ MCSA_ELF_TypeIndFunction
.type _foo, STT_GNU_IFUNC
@ MCSA_LazyReference
.lazy_reference (MachO)
@ MCSA_ELF_TypeNoType
.type _foo, STT_NOTYPE # aka @notype
@ MCSA_Reference
.reference (MachO)
@ MCSA_SymbolResolver
.symbol_resolver (MachO)
@ MCSA_Weak
.weak
@ MCSA_ELF_TypeTLS
.type _foo, STT_TLS # aka @tls_object
@ MCSA_IndirectSymbol
.indirect_symbol (MachO)
@ MCSA_WeakDefinition
.weak_definition (MachO)
@ MCSA_ELF_TypeCommon
.type _foo, STT_COMMON # aka @common
@ MCSA_Global
.type _foo, @gnu_unique_object
@ MCSA_WeakAntiDep
.weak_anti_dep (COFF)
@ MCSA_XPLinkage
symbol uses XP linkage (GOFF)
@ MCSA_Extern
.extern (XCOFF)
@ MCSA_Cold
.cold (MachO)
@ MCSA_ELF_TypeObject
.type _foo, STT_OBJECT # aka @object
@ MCSA_ELF_TypeGnuUniqueObject
@ MCSA_ELF_TypeFunction
.type _foo, STT_FUNC # aka @function
@ MCSA_Hidden
.hidden (ELF)
@ MCSA_LGlobal
.lglobl (XCOFF)
@ MCSA_Invalid
Not a valid directive.
@ MCSA_NoDeadStrip
.no_dead_strip (MachO)