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