LLVM  15.0.0git
ELFAsmParser.cpp
Go to the documentation of this file.
1 //===- ELFAsmParser.cpp - ELF Assembly Parser -----------------------------===//
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/StringRef.h"
10 #include "llvm/ADT/StringSwitch.h"
11 #include "llvm/BinaryFormat/ELF.h"
12 #include "llvm/MC/MCAsmInfo.h"
13 #include "llvm/MC/MCContext.h"
14 #include "llvm/MC/MCDirectives.h"
18 #include "llvm/MC/MCSectionELF.h"
19 #include "llvm/MC/MCStreamer.h"
20 #include "llvm/MC/MCSymbol.h"
21 #include "llvm/MC/MCSymbolELF.h"
22 #include "llvm/MC/SectionKind.h"
23 #include "llvm/Support/Casting.h"
25 #include "llvm/Support/SMLoc.h"
26 #include <cassert>
27 #include <cstdint>
28 #include <utility>
29 
30 using namespace llvm;
31 
32 namespace {
33 
34 class ELFAsmParser : public MCAsmParserExtension {
35  template<bool (ELFAsmParser::*HandlerMethod)(StringRef, SMLoc)>
36  void addDirectiveHandler(StringRef Directive) {
37  MCAsmParser::ExtensionDirectiveHandler Handler = std::make_pair(
38  this, HandleDirective<ELFAsmParser, HandlerMethod>);
39 
40  getParser().addDirectiveHandler(Directive, Handler);
41  }
42 
43  bool ParseSectionSwitch(StringRef Section, unsigned Type, unsigned Flags,
45 
46 public:
47  ELFAsmParser() { BracketExpressionsSupported = true; }
48 
49  void Initialize(MCAsmParser &Parser) override {
50  // Call the base implementation.
52 
53  addDirectiveHandler<&ELFAsmParser::ParseSectionDirectiveData>(".data");
54  addDirectiveHandler<&ELFAsmParser::ParseSectionDirectiveText>(".text");
55  addDirectiveHandler<&ELFAsmParser::ParseSectionDirectiveBSS>(".bss");
56  addDirectiveHandler<&ELFAsmParser::ParseSectionDirectiveRoData>(".rodata");
57  addDirectiveHandler<&ELFAsmParser::ParseSectionDirectiveTData>(".tdata");
58  addDirectiveHandler<&ELFAsmParser::ParseSectionDirectiveTBSS>(".tbss");
59  addDirectiveHandler<
60  &ELFAsmParser::ParseSectionDirectiveDataRel>(".data.rel");
61  addDirectiveHandler<
62  &ELFAsmParser::ParseSectionDirectiveDataRelRo>(".data.rel.ro");
63  addDirectiveHandler<
64  &ELFAsmParser::ParseSectionDirectiveEhFrame>(".eh_frame");
65  addDirectiveHandler<&ELFAsmParser::ParseDirectiveSection>(".section");
66  addDirectiveHandler<
67  &ELFAsmParser::ParseDirectivePushSection>(".pushsection");
68  addDirectiveHandler<&ELFAsmParser::ParseDirectivePopSection>(".popsection");
69  addDirectiveHandler<&ELFAsmParser::ParseDirectiveSize>(".size");
70  addDirectiveHandler<&ELFAsmParser::ParseDirectivePrevious>(".previous");
71  addDirectiveHandler<&ELFAsmParser::ParseDirectiveType>(".type");
72  addDirectiveHandler<&ELFAsmParser::ParseDirectiveIdent>(".ident");
73  addDirectiveHandler<&ELFAsmParser::ParseDirectiveSymver>(".symver");
74  addDirectiveHandler<&ELFAsmParser::ParseDirectiveVersion>(".version");
75  addDirectiveHandler<&ELFAsmParser::ParseDirectiveWeakref>(".weakref");
76  addDirectiveHandler<&ELFAsmParser::ParseDirectiveSymbolAttribute>(".weak");
77  addDirectiveHandler<&ELFAsmParser::ParseDirectiveSymbolAttribute>(".local");
78  addDirectiveHandler<
79  &ELFAsmParser::ParseDirectiveSymbolAttribute>(".protected");
80  addDirectiveHandler<
81  &ELFAsmParser::ParseDirectiveSymbolAttribute>(".internal");
82  addDirectiveHandler<
83  &ELFAsmParser::ParseDirectiveSymbolAttribute>(".hidden");
84  addDirectiveHandler<&ELFAsmParser::ParseDirectiveSubsection>(".subsection");
85  addDirectiveHandler<&ELFAsmParser::ParseDirectiveCGProfile>(".cg_profile");
86  }
87 
88  // FIXME: Part of this logic is duplicated in the MCELFStreamer. What is
89  // the best way for us to get access to it?
90  bool ParseSectionDirectiveData(StringRef, SMLoc) {
91  return ParseSectionSwitch(".data", ELF::SHT_PROGBITS,
94  }
95  bool ParseSectionDirectiveText(StringRef, SMLoc) {
96  return ParseSectionSwitch(".text", ELF::SHT_PROGBITS,
99  }
100  bool ParseSectionDirectiveBSS(StringRef, SMLoc) {
101  return ParseSectionSwitch(".bss", ELF::SHT_NOBITS,
104  }
105  bool ParseSectionDirectiveRoData(StringRef, SMLoc) {
106  return ParseSectionSwitch(".rodata", ELF::SHT_PROGBITS,
109  }
110  bool ParseSectionDirectiveTData(StringRef, SMLoc) {
111  return ParseSectionSwitch(".tdata", ELF::SHT_PROGBITS,
115  }
116  bool ParseSectionDirectiveTBSS(StringRef, SMLoc) {
117  return ParseSectionSwitch(".tbss", ELF::SHT_NOBITS,
121  }
122  bool ParseSectionDirectiveDataRel(StringRef, SMLoc) {
123  return ParseSectionSwitch(".data.rel", ELF::SHT_PROGBITS,
126  }
127  bool ParseSectionDirectiveDataRelRo(StringRef, SMLoc) {
128  return ParseSectionSwitch(".data.rel.ro", ELF::SHT_PROGBITS,
132  }
133  bool ParseSectionDirectiveEhFrame(StringRef, SMLoc) {
134  return ParseSectionSwitch(".eh_frame", ELF::SHT_PROGBITS,
137  }
138  bool ParseDirectivePushSection(StringRef, SMLoc);
139  bool ParseDirectivePopSection(StringRef, SMLoc);
140  bool ParseDirectiveSection(StringRef, SMLoc);
141  bool ParseDirectiveSize(StringRef, SMLoc);
142  bool ParseDirectivePrevious(StringRef, SMLoc);
143  bool ParseDirectiveType(StringRef, SMLoc);
144  bool ParseDirectiveIdent(StringRef, SMLoc);
145  bool ParseDirectiveSymver(StringRef, SMLoc);
146  bool ParseDirectiveVersion(StringRef, SMLoc);
147  bool ParseDirectiveWeakref(StringRef, SMLoc);
148  bool ParseDirectiveSymbolAttribute(StringRef, SMLoc);
149  bool ParseDirectiveSubsection(StringRef, SMLoc);
150  bool ParseDirectiveCGProfile(StringRef, SMLoc);
151 
152 private:
153  bool ParseSectionName(StringRef &SectionName);
154  bool ParseSectionArguments(bool IsPush, SMLoc loc);
155  unsigned parseSunStyleSectionFlags();
156  bool maybeParseSectionType(StringRef &TypeName);
157  bool parseMergeSize(int64_t &Size);
158  bool parseGroup(StringRef &GroupName, bool &IsComdat);
159  bool parseLinkedToSym(MCSymbolELF *&LinkedToSym);
160  bool maybeParseUniqueID(int64_t &UniqueID);
161 };
162 
163 } // end anonymous namespace
164 
165 /// ParseDirectiveSymbolAttribute
166 /// ::= { ".local", ".weak", ... } [ identifier ( , identifier )* ]
167 bool ELFAsmParser::ParseDirectiveSymbolAttribute(StringRef Directive, SMLoc) {
169  .Case(".weak", MCSA_Weak)
170  .Case(".local", MCSA_Local)
171  .Case(".hidden", MCSA_Hidden)
172  .Case(".internal", MCSA_Internal)
173  .Case(".protected", MCSA_Protected)
175  assert(Attr != MCSA_Invalid && "unexpected symbol attribute directive!");
176  if (getLexer().isNot(AsmToken::EndOfStatement)) {
177  while (true) {
178  StringRef Name;
179 
180  if (getParser().parseIdentifier(Name))
181  return TokError("expected identifier in directive");
182 
183  if (getParser().discardLTOSymbol(Name)) {
184  if (getLexer().is(AsmToken::EndOfStatement))
185  break;
186  continue;
187  }
188 
189  MCSymbol *Sym = getContext().getOrCreateSymbol(Name);
190 
191  getStreamer().emitSymbolAttribute(Sym, Attr);
192 
193  if (getLexer().is(AsmToken::EndOfStatement))
194  break;
195 
196  if (getLexer().isNot(AsmToken::Comma))
197  return TokError("unexpected token in directive");
198  Lex();
199  }
200  }
201 
202  Lex();
203  return false;
204 }
205 
206 bool ELFAsmParser::ParseSectionSwitch(StringRef Section, unsigned Type,
207  unsigned Flags, SectionKind Kind) {
208  const MCExpr *Subsection = nullptr;
209  if (getLexer().isNot(AsmToken::EndOfStatement)) {
210  if (getParser().parseExpression(Subsection))
211  return true;
212  }
213  Lex();
214 
215  getStreamer().SwitchSection(getContext().getELFSection(Section, Type, Flags),
216  Subsection);
217 
218  return false;
219 }
220 
221 bool ELFAsmParser::ParseDirectiveSize(StringRef, SMLoc) {
222  StringRef Name;
223  if (getParser().parseIdentifier(Name))
224  return TokError("expected identifier in directive");
225  MCSymbolELF *Sym = cast<MCSymbolELF>(getContext().getOrCreateSymbol(Name));
226 
227  if (getLexer().isNot(AsmToken::Comma))
228  return TokError("unexpected token in directive");
229  Lex();
230 
231  const MCExpr *Expr;
232  if (getParser().parseExpression(Expr))
233  return true;
234 
235  if (getLexer().isNot(AsmToken::EndOfStatement))
236  return TokError("unexpected token in directive");
237  Lex();
238 
239  getStreamer().emitELFSize(Sym, Expr);
240  return false;
241 }
242 
243 bool ELFAsmParser::ParseSectionName(StringRef &SectionName) {
244  // A section name can contain -, so we cannot just use
245  // parseIdentifier.
246  SMLoc FirstLoc = getLexer().getLoc();
247  unsigned Size = 0;
248 
249  if (getLexer().is(AsmToken::String)) {
250  SectionName = getTok().getIdentifier();
251  Lex();
252  return false;
253  }
254 
255  while (!getParser().hasPendingError()) {
256  SMLoc PrevLoc = getLexer().getLoc();
257  if (getLexer().is(AsmToken::Comma) ||
258  getLexer().is(AsmToken::EndOfStatement))
259  break;
260 
261  unsigned CurSize;
262  if (getLexer().is(AsmToken::String)) {
263  CurSize = getTok().getIdentifier().size() + 2;
264  Lex();
265  } else if (getLexer().is(AsmToken::Identifier)) {
266  CurSize = getTok().getIdentifier().size();
267  Lex();
268  } else {
269  CurSize = getTok().getString().size();
270  Lex();
271  }
272  Size += CurSize;
273  SectionName = StringRef(FirstLoc.getPointer(), Size);
274 
275  // Make sure the following token is adjacent.
276  if (PrevLoc.getPointer() + CurSize != getTok().getLoc().getPointer())
277  break;
278  }
279  if (Size == 0)
280  return true;
281 
282  return false;
283 }
284 
285 static unsigned parseSectionFlags(const Triple &TT, StringRef flagsStr,
286  bool *UseLastGroup) {
287  unsigned flags = 0;
288 
289  // If a valid numerical value is set for the section flag, use it verbatim
290  if (!flagsStr.getAsInteger(0, flags))
291  return flags;
292 
293  for (char i : flagsStr) {
294  switch (i) {
295  case 'a':
296  flags |= ELF::SHF_ALLOC;
297  break;
298  case 'e':
299  flags |= ELF::SHF_EXCLUDE;
300  break;
301  case 'x':
302  flags |= ELF::SHF_EXECINSTR;
303  break;
304  case 'w':
305  flags |= ELF::SHF_WRITE;
306  break;
307  case 'o':
308  flags |= ELF::SHF_LINK_ORDER;
309  break;
310  case 'M':
311  flags |= ELF::SHF_MERGE;
312  break;
313  case 'S':
314  flags |= ELF::SHF_STRINGS;
315  break;
316  case 'T':
317  flags |= ELF::SHF_TLS;
318  break;
319  case 'c':
320  flags |= ELF::XCORE_SHF_CP_SECTION;
321  break;
322  case 'd':
323  flags |= ELF::XCORE_SHF_DP_SECTION;
324  break;
325  case 'y':
326  flags |= ELF::SHF_ARM_PURECODE;
327  break;
328  case 's':
329  flags |= ELF::SHF_HEX_GPREL;
330  break;
331  case 'G':
332  flags |= ELF::SHF_GROUP;
333  break;
334  case 'R':
335  if (TT.isOSSolaris())
336  flags |= ELF::SHF_SUNW_NODISCARD;
337  else
338  flags |= ELF::SHF_GNU_RETAIN;
339  break;
340  case '?':
341  *UseLastGroup = true;
342  break;
343  default:
344  return -1U;
345  }
346  }
347 
348  return flags;
349 }
350 
351 unsigned ELFAsmParser::parseSunStyleSectionFlags() {
352  unsigned flags = 0;
353  while (getLexer().is(AsmToken::Hash)) {
354  Lex(); // Eat the #.
355 
356  if (!getLexer().is(AsmToken::Identifier))
357  return -1U;
358 
359  StringRef flagId = getTok().getIdentifier();
360  if (flagId == "alloc")
361  flags |= ELF::SHF_ALLOC;
362  else if (flagId == "execinstr")
363  flags |= ELF::SHF_EXECINSTR;
364  else if (flagId == "write")
365  flags |= ELF::SHF_WRITE;
366  else if (flagId == "tls")
367  flags |= ELF::SHF_TLS;
368  else
369  return -1U;
370 
371  Lex(); // Eat the flag.
372 
373  if (!getLexer().is(AsmToken::Comma))
374  break;
375  Lex(); // Eat the comma.
376  }
377  return flags;
378 }
379 
380 
381 bool ELFAsmParser::ParseDirectivePushSection(StringRef s, SMLoc loc) {
382  getStreamer().PushSection();
383 
384  if (ParseSectionArguments(/*IsPush=*/true, loc)) {
385  getStreamer().PopSection();
386  return true;
387  }
388 
389  return false;
390 }
391 
392 bool ELFAsmParser::ParseDirectivePopSection(StringRef, SMLoc) {
393  if (!getStreamer().PopSection())
394  return TokError(".popsection without corresponding .pushsection");
395  return false;
396 }
397 
398 bool ELFAsmParser::ParseDirectiveSection(StringRef, SMLoc loc) {
399  return ParseSectionArguments(/*IsPush=*/false, loc);
400 }
401 
402 bool ELFAsmParser::maybeParseSectionType(StringRef &TypeName) {
403  MCAsmLexer &L = getLexer();
404  if (L.isNot(AsmToken::Comma))
405  return false;
406  Lex();
407  if (L.isNot(AsmToken::At) && L.isNot(AsmToken::Percent) &&
408  L.isNot(AsmToken::String)) {
409  if (L.getAllowAtInIdentifier())
410  return TokError("expected '@<type>', '%<type>' or \"<type>\"");
411  else
412  return TokError("expected '%<type>' or \"<type>\"");
413  }
414  if (!L.is(AsmToken::String))
415  Lex();
416  if (L.is(AsmToken::Integer)) {
417  TypeName = getTok().getString();
418  Lex();
419  } else if (getParser().parseIdentifier(TypeName))
420  return TokError("expected identifier in directive");
421  return false;
422 }
423 
424 bool ELFAsmParser::parseMergeSize(int64_t &Size) {
425  if (getLexer().isNot(AsmToken::Comma))
426  return TokError("expected the entry size");
427  Lex();
428  if (getParser().parseAbsoluteExpression(Size))
429  return true;
430  if (Size <= 0)
431  return TokError("entry size must be positive");
432  return false;
433 }
434 
435 bool ELFAsmParser::parseGroup(StringRef &GroupName, bool &IsComdat) {
436  MCAsmLexer &L = getLexer();
437  if (L.isNot(AsmToken::Comma))
438  return TokError("expected group name");
439  Lex();
440  if (L.is(AsmToken::Integer)) {
441  GroupName = getTok().getString();
442  Lex();
443  } else if (getParser().parseIdentifier(GroupName)) {
444  return TokError("invalid group name");
445  }
446  if (L.is(AsmToken::Comma)) {
447  Lex();
449  if (getParser().parseIdentifier(Linkage))
450  return TokError("invalid linkage");
451  if (Linkage != "comdat")
452  return TokError("Linkage must be 'comdat'");
453  IsComdat = true;
454  } else {
455  IsComdat = false;
456  }
457  return false;
458 }
459 
460 bool ELFAsmParser::parseLinkedToSym(MCSymbolELF *&LinkedToSym) {
461  MCAsmLexer &L = getLexer();
462  if (L.isNot(AsmToken::Comma))
463  return TokError("expected linked-to symbol");
464  Lex();
465  StringRef Name;
466  SMLoc StartLoc = L.getLoc();
467  if (getParser().parseIdentifier(Name)) {
468  if (getParser().getTok().getString() == "0") {
469  getParser().Lex();
470  LinkedToSym = nullptr;
471  return false;
472  }
473  return TokError("invalid linked-to symbol");
474  }
475  LinkedToSym = dyn_cast_or_null<MCSymbolELF>(getContext().lookupSymbol(Name));
476  if (!LinkedToSym || !LinkedToSym->isInSection())
477  return Error(StartLoc, "linked-to symbol is not in a section: " + Name);
478  return false;
479 }
480 
481 bool ELFAsmParser::maybeParseUniqueID(int64_t &UniqueID) {
482  MCAsmLexer &L = getLexer();
483  if (L.isNot(AsmToken::Comma))
484  return false;
485  Lex();
486  StringRef UniqueStr;
487  if (getParser().parseIdentifier(UniqueStr))
488  return TokError("expected identifier in directive");
489  if (UniqueStr != "unique")
490  return TokError("expected 'unique'");
491  if (L.isNot(AsmToken::Comma))
492  return TokError("expected commma");
493  Lex();
494  if (getParser().parseAbsoluteExpression(UniqueID))
495  return true;
496  if (UniqueID < 0)
497  return TokError("unique id must be positive");
498  if (!isUInt<32>(UniqueID) || UniqueID == ~0U)
499  return TokError("unique id is too large");
500  return false;
501 }
502 
504  return SectionName.consume_front(Prefix) &&
505  (SectionName.empty() || SectionName[0] == '.');
506 }
507 
509  unsigned Type) {
510  if (TT.getArch() == Triple::x86_64) {
511  // x86-64 psABI names SHT_X86_64_UNWIND as the canonical type for .eh_frame,
512  // but GNU as emits SHT_PROGBITS .eh_frame for .cfi_* directives. Don't
513  // error for SHT_PROGBITS .eh_frame
514  return SectionName == ".eh_frame" && Type == ELF::SHT_PROGBITS;
515  }
516  if (TT.isMIPS()) {
517  // MIPS .debug_* sections should have SHT_MIPS_DWARF section type to
518  // distinguish among sections contain DWARF and ECOFF debug formats,
519  // but in assembly files these sections have SHT_PROGBITS type.
520  return SectionName.startswith(".debug_") && Type == ELF::SHT_PROGBITS;
521  }
522  return false;
523 }
524 
525 bool ELFAsmParser::ParseSectionArguments(bool IsPush, SMLoc loc) {
527 
528  if (ParseSectionName(SectionName))
529  return TokError("expected identifier in directive");
530 
532  int64_t Size = 0;
533  StringRef GroupName;
534  bool IsComdat = false;
535  unsigned Flags = 0;
536  unsigned extraFlags = 0;
537  const MCExpr *Subsection = nullptr;
538  bool UseLastGroup = false;
539  MCSymbolELF *LinkedToSym = nullptr;
540  int64_t UniqueID = ~0;
541 
542  // Set the defaults first.
543  if (hasPrefix(SectionName, ".rodata") || SectionName == ".rodata1")
544  Flags |= ELF::SHF_ALLOC;
545  else if (SectionName == ".fini" || SectionName == ".init" ||
546  hasPrefix(SectionName, ".text"))
548  else if (hasPrefix(SectionName, ".data") || SectionName == ".data1" ||
549  hasPrefix(SectionName, ".bss") ||
550  hasPrefix(SectionName, ".init_array") ||
551  hasPrefix(SectionName, ".fini_array") ||
552  hasPrefix(SectionName, ".preinit_array"))
553  Flags |= ELF::SHF_ALLOC | ELF::SHF_WRITE;
554  else if (hasPrefix(SectionName, ".tdata") || hasPrefix(SectionName, ".tbss"))
556 
557  if (getLexer().is(AsmToken::Comma)) {
558  Lex();
559 
560  if (IsPush && getLexer().isNot(AsmToken::String)) {
561  if (getParser().parseExpression(Subsection))
562  return true;
563  if (getLexer().isNot(AsmToken::Comma))
564  goto EndStmt;
565  Lex();
566  }
567 
568  if (getLexer().isNot(AsmToken::String)) {
569  if (!getContext().getAsmInfo()->usesSunStyleELFSectionSwitchSyntax()
570  || getLexer().isNot(AsmToken::Hash))
571  return TokError("expected string in directive");
572  extraFlags = parseSunStyleSectionFlags();
573  } else {
574  StringRef FlagsStr = getTok().getStringContents();
575  Lex();
576  extraFlags = parseSectionFlags(getContext().getTargetTriple(), FlagsStr,
577  &UseLastGroup);
578  }
579 
580  if (extraFlags == -1U)
581  return TokError("unknown flag");
582  Flags |= extraFlags;
583 
584  bool Mergeable = Flags & ELF::SHF_MERGE;
585  bool Group = Flags & ELF::SHF_GROUP;
586  if (Group && UseLastGroup)
587  return TokError("Section cannot specifiy a group name while also acting "
588  "as a member of the last group");
589 
590  if (maybeParseSectionType(TypeName))
591  return true;
592 
593  MCAsmLexer &L = getLexer();
594  if (TypeName.empty()) {
595  if (Mergeable)
596  return TokError("Mergeable section must specify the type");
597  if (Group)
598  return TokError("Group section must specify the type");
600  return TokError("unexpected token in directive");
601  }
602 
603  if (Mergeable)
604  if (parseMergeSize(Size))
605  return true;
606  if (Group)
607  if (parseGroup(GroupName, IsComdat))
608  return true;
609  if (Flags & ELF::SHF_LINK_ORDER)
610  if (parseLinkedToSym(LinkedToSym))
611  return true;
612  if (maybeParseUniqueID(UniqueID))
613  return true;
614  }
615 
616 EndStmt:
617  if (getLexer().isNot(AsmToken::EndOfStatement))
618  return TokError("unexpected token in directive");
619  Lex();
620 
621  unsigned Type = ELF::SHT_PROGBITS;
622 
623  if (TypeName.empty()) {
624  if (SectionName.startswith(".note"))
626  else if (hasPrefix(SectionName, ".init_array"))
628  else if (hasPrefix(SectionName, ".bss"))
630  else if (hasPrefix(SectionName, ".tbss"))
632  else if (hasPrefix(SectionName, ".fini_array"))
634  else if (hasPrefix(SectionName, ".preinit_array"))
636  } else {
637  if (TypeName == "init_array")
639  else if (TypeName == "fini_array")
641  else if (TypeName == "preinit_array")
643  else if (TypeName == "nobits")
645  else if (TypeName == "progbits")
647  else if (TypeName == "note")
649  else if (TypeName == "unwind")
651  else if (TypeName == "llvm_odrtab")
653  else if (TypeName == "llvm_linker_options")
655  else if (TypeName == "llvm_call_graph_profile")
657  else if (TypeName == "llvm_dependent_libraries")
659  else if (TypeName == "llvm_sympart")
661  else if (TypeName == "llvm_bb_addr_map")
663  else if (TypeName.getAsInteger(0, Type))
664  return TokError("unknown section type");
665  }
666 
667  if (UseLastGroup) {
668  MCSectionSubPair CurrentSection = getStreamer().getCurrentSection();
669  if (const MCSectionELF *Section =
670  cast_or_null<MCSectionELF>(CurrentSection.first))
671  if (const MCSymbol *Group = Section->getGroup()) {
672  GroupName = Group->getName();
673  IsComdat = Section->isComdat();
674  Flags |= ELF::SHF_GROUP;
675  }
676  }
677 
679  getContext().getELFSection(SectionName, Type, Flags, Size, GroupName,
680  IsComdat, UniqueID, LinkedToSym);
681  getStreamer().SwitchSection(Section, Subsection);
682  // Check that flags are used consistently. However, the GNU assembler permits
683  // to leave out in subsequent uses of the same sections; for compatibility,
684  // do likewise.
685  if (!TypeName.empty() && Section->getType() != Type &&
686  !allowSectionTypeMismatch(getContext().getTargetTriple(), SectionName,
687  Type))
688  Error(loc, "changed section type for " + SectionName + ", expected: 0x" +
689  utohexstr(Section->getType()));
690  if ((extraFlags || Size || !TypeName.empty()) && Section->getFlags() != Flags)
691  Error(loc, "changed section flags for " + SectionName + ", expected: 0x" +
692  utohexstr(Section->getFlags()));
693  if ((extraFlags || Size || !TypeName.empty()) &&
694  Section->getEntrySize() != Size)
695  Error(loc, "changed section entsize for " + SectionName +
696  ", expected: " + Twine(Section->getEntrySize()));
697 
698  if (getContext().getGenDwarfForAssembly() &&
699  (Section->getFlags() & ELF::SHF_ALLOC) &&
700  (Section->getFlags() & ELF::SHF_EXECINSTR)) {
701  bool InsertResult = getContext().addGenDwarfSection(Section);
702  if (InsertResult) {
703  if (getContext().getDwarfVersion() <= 2)
704  Warning(loc, "DWARF2 only supports one section per compilation unit");
705 
706  if (!Section->getBeginSymbol()) {
707  MCSymbol *SectionStartSymbol = getContext().createTempSymbol();
708  getStreamer().emitLabel(SectionStartSymbol);
709  Section->setBeginSymbol(SectionStartSymbol);
710  }
711  }
712  }
713 
714  return false;
715 }
716 
717 bool ELFAsmParser::ParseDirectivePrevious(StringRef DirName, SMLoc) {
718  MCSectionSubPair PreviousSection = getStreamer().getPreviousSection();
719  if (PreviousSection.first == nullptr)
720  return TokError(".previous without corresponding .section");
721  getStreamer().SwitchSection(PreviousSection.first, PreviousSection.second);
722 
723  return false;
724 }
725 
728  .Cases("STT_FUNC", "function", MCSA_ELF_TypeFunction)
729  .Cases("STT_OBJECT", "object", MCSA_ELF_TypeObject)
730  .Cases("STT_TLS", "tls_object", MCSA_ELF_TypeTLS)
731  .Cases("STT_COMMON", "common", MCSA_ELF_TypeCommon)
732  .Cases("STT_NOTYPE", "notype", MCSA_ELF_TypeNoType)
733  .Cases("STT_GNU_IFUNC", "gnu_indirect_function",
735  .Case("gnu_unique_object", MCSA_ELF_TypeGnuUniqueObject)
737 }
738 
739 /// ParseDirectiveELFType
740 /// ::= .type identifier , STT_<TYPE_IN_UPPER_CASE>
741 /// ::= .type identifier , #attribute
742 /// ::= .type identifier , @attribute
743 /// ::= .type identifier , %attribute
744 /// ::= .type identifier , "attribute"
745 bool ELFAsmParser::ParseDirectiveType(StringRef, SMLoc) {
746  StringRef Name;
747  if (getParser().parseIdentifier(Name))
748  return TokError("expected identifier in directive");
749 
750  // Handle the identifier as the key symbol.
751  MCSymbol *Sym = getContext().getOrCreateSymbol(Name);
752 
753  // NOTE the comma is optional in all cases. It is only documented as being
754  // optional in the first case, however, GAS will silently treat the comma as
755  // optional in all cases. Furthermore, although the documentation states that
756  // the first form only accepts STT_<TYPE_IN_UPPER_CASE>, in reality, GAS
757  // accepts both the upper case name as well as the lower case aliases.
758  if (getLexer().is(AsmToken::Comma))
759  Lex();
760 
761  if (getLexer().isNot(AsmToken::Identifier) &&
762  getLexer().isNot(AsmToken::Hash) &&
763  getLexer().isNot(AsmToken::Percent) &&
764  getLexer().isNot(AsmToken::String)) {
765  if (!getLexer().getAllowAtInIdentifier())
766  return TokError("expected STT_<TYPE_IN_UPPER_CASE>, '#<type>', "
767  "'%<type>' or \"<type>\"");
768  else if (getLexer().isNot(AsmToken::At))
769  return TokError("expected STT_<TYPE_IN_UPPER_CASE>, '#<type>', '@<type>', "
770  "'%<type>' or \"<type>\"");
771  }
772 
773  if (getLexer().isNot(AsmToken::String) &&
774  getLexer().isNot(AsmToken::Identifier))
775  Lex();
776 
777  SMLoc TypeLoc = getLexer().getLoc();
778 
779  StringRef Type;
780  if (getParser().parseIdentifier(Type))
781  return TokError("expected symbol type in directive");
782 
784  if (Attr == MCSA_Invalid)
785  return Error(TypeLoc, "unsupported attribute in '.type' directive");
786 
787  if (getLexer().isNot(AsmToken::EndOfStatement))
788  return TokError("unexpected token in '.type' directive");
789  Lex();
790 
791  getStreamer().emitSymbolAttribute(Sym, Attr);
792 
793  return false;
794 }
795 
796 /// ParseDirectiveIdent
797 /// ::= .ident string
798 bool ELFAsmParser::ParseDirectiveIdent(StringRef, SMLoc) {
799  if (getLexer().isNot(AsmToken::String))
800  return TokError("unexpected token in '.ident' directive");
801 
802  StringRef Data = getTok().getIdentifier();
803 
804  Lex();
805 
806  if (getLexer().isNot(AsmToken::EndOfStatement))
807  return TokError("unexpected token in '.ident' directive");
808  Lex();
809 
810  getStreamer().emitIdent(Data);
811  return false;
812 }
813 
814 /// ParseDirectiveSymver
815 /// ::= .symver foo, bar2@zed
816 bool ELFAsmParser::ParseDirectiveSymver(StringRef, SMLoc) {
817  StringRef OriginalName, Name, Action;
818  if (getParser().parseIdentifier(OriginalName))
819  return TokError("expected identifier in directive");
820 
821  if (getLexer().isNot(AsmToken::Comma))
822  return TokError("expected a comma");
823 
824  // ARM assembly uses @ for a comment...
825  // except when parsing the second parameter of the .symver directive.
826  // Force the next symbol to allow @ in the identifier, which is
827  // required for this directive and then reset it to its initial state.
828  const bool AllowAtInIdentifier = getLexer().getAllowAtInIdentifier();
829  getLexer().setAllowAtInIdentifier(true);
830  Lex();
831  getLexer().setAllowAtInIdentifier(AllowAtInIdentifier);
832 
833  if (getParser().parseIdentifier(Name))
834  return TokError("expected identifier in directive");
835 
836  if (!Name.contains('@'))
837  return TokError("expected a '@' in the name");
838  bool KeepOriginalSym = !Name.contains("@@@");
839  if (parseOptionalToken(AsmToken::Comma)) {
840  if (getParser().parseIdentifier(Action) || Action != "remove")
841  return TokError("expected 'remove'");
842  KeepOriginalSym = false;
843  }
844  (void)parseOptionalToken(AsmToken::EndOfStatement);
845 
846  getStreamer().emitELFSymverDirective(
847  getContext().getOrCreateSymbol(OriginalName), Name, KeepOriginalSym);
848  return false;
849 }
850 
851 /// ParseDirectiveVersion
852 /// ::= .version string
853 bool ELFAsmParser::ParseDirectiveVersion(StringRef, SMLoc) {
854  if (getLexer().isNot(AsmToken::String))
855  return TokError("unexpected token in '.version' directive");
856 
857  StringRef Data = getTok().getIdentifier();
858 
859  Lex();
860 
861  MCSection *Note = getContext().getELFSection(".note", ELF::SHT_NOTE, 0);
862 
863  getStreamer().PushSection();
864  getStreamer().SwitchSection(Note);
865  getStreamer().emitInt32(Data.size() + 1); // namesz
866  getStreamer().emitInt32(0); // descsz = 0 (no description).
867  getStreamer().emitInt32(1); // type = NT_VERSION
868  getStreamer().emitBytes(Data); // name
869  getStreamer().emitInt8(0); // NUL
870  getStreamer().emitValueToAlignment(4);
871  getStreamer().PopSection();
872  return false;
873 }
874 
875 /// ParseDirectiveWeakref
876 /// ::= .weakref foo, bar
877 bool ELFAsmParser::ParseDirectiveWeakref(StringRef, SMLoc) {
878  // FIXME: Share code with the other alias building directives.
879 
880  StringRef AliasName;
881  if (getParser().parseIdentifier(AliasName))
882  return TokError("expected identifier in directive");
883 
884  if (getLexer().isNot(AsmToken::Comma))
885  return TokError("expected a comma");
886 
887  Lex();
888 
889  StringRef Name;
890  if (getParser().parseIdentifier(Name))
891  return TokError("expected identifier in directive");
892 
893  MCSymbol *Alias = getContext().getOrCreateSymbol(AliasName);
894 
895  MCSymbol *Sym = getContext().getOrCreateSymbol(Name);
896 
897  getStreamer().emitWeakReference(Alias, Sym);
898  return false;
899 }
900 
901 bool ELFAsmParser::ParseDirectiveSubsection(StringRef, SMLoc) {
902  const MCExpr *Subsection = nullptr;
903  if (getLexer().isNot(AsmToken::EndOfStatement)) {
904  if (getParser().parseExpression(Subsection))
905  return true;
906  }
907 
908  if (getLexer().isNot(AsmToken::EndOfStatement))
909  return TokError("unexpected token in directive");
910 
911  Lex();
912 
913  getStreamer().SubSection(Subsection);
914  return false;
915 }
916 
917 bool ELFAsmParser::ParseDirectiveCGProfile(StringRef S, SMLoc Loc) {
919 }
920 
921 namespace llvm {
922 
924  return new ELFAsmParser;
925 }
926 
927 } // end namespace llvm
llvm::Check::Size
@ Size
Definition: FileCheck.h:77
llvm::StringSwitch::Case
StringSwitch & Case(StringLiteral S, T Value)
Definition: StringSwitch.h:69
i
i
Definition: README.txt:29
llvm::MCAsmParser
Generic assembler parser interface, for use by target specific assembly parsers.
Definition: MCAsmParser.h:124
llvm::ELF::SHF_HEX_GPREL
@ SHF_HEX_GPREL
Definition: ELF.h:1102
is
should just be implemented with a CLZ instruction Since there are other e that share this it would be best to implement this in a target independent as zero is the default value for the binary encoder e add r0 add r5 Register operands should be distinct That is
Definition: README.txt:725
llvm::SectionKind::getReadOnlyWithRel
static SectionKind getReadOnlyWithRel()
Definition: SectionKind.h:214
MathExtras.h
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:17
llvm::MCSymbol
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:41
llvm::ELF::SHF_WRITE
@ SHF_WRITE
Definition: ELF.h:1032
llvm::MCAsmLexer
Generic assembler lexer interface, for use by target specific assembly lexers.
Definition: MCAsmLexer.h:37
llvm::ELF::SHF_STRINGS
@ SHF_STRINGS
Definition: ELF.h:1044
llvm::cl::Prefix
@ Prefix
Definition: CommandLine.h:160
llvm::MCAsmParserExtension::ParseDirectiveCGProfile
bool ParseDirectiveCGProfile(StringRef, SMLoc)
ParseDirectiveCGProfile ::= .cg_profile identifier, identifier, <number>
Definition: MCAsmParserExtension.cpp:27
Note
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles Note
Definition: README.txt:239
StringRef.h
llvm::StringSwitch::Default
LLVM_NODISCARD R Default(T Value)
Definition: StringSwitch.h:183
llvm::ELF::XCORE_SHF_DP_SECTION
@ XCORE_SHF_DP_SECTION
All sections with the "d" flag are grouped together by the linker to form the data section and the dp...
Definition: ELF.h:1084
llvm::MCSA_ELF_TypeObject
@ MCSA_ELF_TypeObject
.type _foo, STT_OBJECT # aka @object
Definition: MCDirectives.h:25
llvm::AsmToken::EndOfStatement
@ EndOfStatement
Definition: MCAsmMacro.h:42
llvm::ELF::SHT_PREINIT_ARRAY
@ SHT_PREINIT_ARRAY
Definition: ELF.h:968
MCDirectives.h
llvm::MCSA_Invalid
@ MCSA_Invalid
Not a valid directive.
Definition: MCDirectives.h:19
llvm::ELF::XCORE_SHF_CP_SECTION
@ XCORE_SHF_CP_SECTION
All sections with the "c" flag are grouped together by the linker to form the constant pool and the c...
Definition: ELF.h:1089
MCSectionELF.h
llvm::ELF::SHF_TLS
@ SHF_TLS
Definition: ELF.h:1060
llvm::Triple
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
llvm::Type
The instances of the Type class are immutable: once they are created, they are never changed.
Definition: Type.h:45
llvm::Triple::x86_64
@ x86_64
Definition: Triple.h:86
llvm::AsmToken::Integer
@ Integer
Definition: MCAsmMacro.h:32
llvm::MCSA_ELF_TypeNoType
@ MCSA_ELF_TypeNoType
.type _foo, STT_NOTYPE # aka @notype
Definition: MCDirectives.h:28
llvm::ELF::SHF_ALLOC
@ SHF_ALLOC
Definition: ELF.h:1035
allowSectionTypeMismatch
static bool allowSectionTypeMismatch(const Triple &TT, StringRef SectionName, unsigned Type)
Definition: ELFAsmParser.cpp:508
llvm::MCSectionELF
This represents a section on linux, lots of unix variants and some bare metal systems.
Definition: MCSectionELF.h:26
llvm::MCAsmLexer::is
bool is(AsmToken::TokenKind K) const
Check if the current token has kind K.
Definition: MCAsmLexer.h:141
llvm::ELF::SHT_FINI_ARRAY
@ SHT_FINI_ARRAY
Definition: ELF.h:967
MCAsmParser.h
llvm::ELF::SHT_LLVM_DEPENDENT_LIBRARIES
@ SHT_LLVM_DEPENDENT_LIBRARIES
Definition: ELF.h:983
llvm::Data
@ Data
Definition: SIMachineScheduler.h:55
llvm::MCSymbolAttr
MCSymbolAttr
Definition: MCDirectives.h:18
llvm::MCSA_Local
@ MCSA_Local
.local (ELF)
Definition: MCDirectives.h:38
parseSectionFlags
static unsigned parseSectionFlags(const Triple &TT, StringRef flagsStr, bool *UseLastGroup)
Definition: ELFAsmParser.cpp:285
llvm::MCSymbolELF
Definition: MCSymbolELF.h:14
llvm::ARMBuildAttrs::Section
@ Section
Legacy Tags.
Definition: ARMBuildAttributes.h:82
llvm::SectionKind::getReadOnly
static SectionKind getReadOnly()
Definition: SectionKind.h:192
llvm::SectionKind::getThreadBSS
static SectionKind getThreadBSS()
Definition: SectionKind.h:206
ELF.h
llvm::ELF::SHT_LLVM_CALL_GRAPH_PROFILE
@ SHT_LLVM_CALL_GRAPH_PROFILE
Definition: ELF.h:989
llvm::SMLoc
Represents a location in source code.
Definition: SMLoc.h:23
MCSymbolELF.h
llvm::MCSA_Protected
@ MCSA_Protected
.protected (ELF)
Definition: MCDirectives.h:43
MCContext.h
MCSymbol.h
llvm::SectionKind::getBSS
static SectionKind getBSS()
Definition: SectionKind.h:209
llvm::MCAsmParser::ExtensionDirectiveHandler
std::pair< MCAsmParserExtension *, DirectiveHandler > ExtensionDirectiveHandler
Definition: MCAsmParser.h:128
llvm::MCSA_ELF_TypeIndFunction
@ MCSA_ELF_TypeIndFunction
.type _foo, STT_GNU_IFUNC
Definition: MCDirectives.h:24
SMLoc.h
llvm::AMDGPU::ElfNote::SectionName
const char SectionName[]
Definition: AMDGPUPTNote.h:24
llvm::MCSA_Hidden
@ MCSA_Hidden
.hidden (ELF)
Definition: MCDirectives.h:33
llvm::MCSA_ELF_TypeGnuUniqueObject
@ MCSA_ELF_TypeGnuUniqueObject
Definition: MCDirectives.h:29
llvm::SectionKind::getText
static SectionKind getText()
Definition: SectionKind.h:190
isNot
static bool isNot(const MachineRegisterInfo &MRI, const MachineInstr &MI)
Definition: AMDGPULegalizerInfo.cpp:2886
llvm::AsmToken::Percent
@ Percent
Definition: MCAsmMacro.h:52
llvm::StringRef::getAsInteger
std::enable_if_t< std::numeric_limits< T >::is_signed, bool > getAsInteger(unsigned Radix, T &Result) const
Parse the current string as an integer of the specified radix.
Definition: StringRef.h:510
llvm::lltok::Kind
Kind
Definition: LLToken.h:18
llvm::ELF::SHT_LLVM_ODRTAB
@ SHT_LLVM_ODRTAB
Definition: ELF.h:979
llvm::createELFAsmParser
MCAsmParserExtension * createELFAsmParser()
Definition: ELFAsmParser.cpp:923
llvm::ELF::SHT_NOBITS
@ SHT_NOBITS
Definition: ELF.h:962
llvm::ELF::SHF_GROUP
@ SHF_GROUP
Definition: ELF.h:1057
llvm::ELF::SHT_LLVM_SYMPART
@ SHT_LLVM_SYMPART
Definition: ELF.h:985
MCAsmLexer.h
llvm::MCAsmLexer::getLoc
SMLoc getLoc() const
Get the current source location.
Definition: MCAsmLexer.cpp:22
llvm::AsmToken::At
@ At
Definition: MCAsmMacro.h:54
s
multiplies can be turned into SHL s
Definition: README.txt:370
llvm::MCAsmParserExtension::Initialize
virtual void Initialize(MCAsmParser &Parser)
Initialize the extension for parsing using the given Parser.
Definition: MCAsmParserExtension.cpp:21
llvm::isUInt< 32 >
constexpr bool isUInt< 32 >(uint64_t x)
Definition: MathExtras.h:411
llvm::ELF::SHT_LLVM_BB_ADDR_MAP
@ SHT_LLVM_BB_ADDR_MAP
Definition: ELF.h:988
llvm::mc::getDwarfVersion
int getDwarfVersion()
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::ELF::SHF_LINK_ORDER
@ SHF_LINK_ORDER
Definition: ELF.h:1050
llvm::SectionKind::getThreadData
static SectionKind getThreadData()
Definition: SectionKind.h:207
llvm::AsmToken::Comma
@ Comma
Definition: MCAsmMacro.h:49
llvm::ELF::SHT_X86_64_UNWIND
@ SHT_X86_64_UNWIND
Definition: ELF.h:1011
MCAsmInfo.h
llvm::ELF::SHT_NOTE
@ SHT_NOTE
Definition: ELF.h:961
llvm::ELF::SHF_GNU_RETAIN
@ SHF_GNU_RETAIN
Definition: ELF.h:1066
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
llvm::ELF::SHF_ARM_PURECODE
@ SHF_ARM_PURECODE
Definition: ELF.h:1130
llvm::MCAsmParserExtension
Generic interface for extending the MCAsmParser, which is implemented by target and object file assem...
Definition: MCAsmParserExtension.h:24
hasPrefix
static bool hasPrefix(StringRef SectionName, StringRef Prefix)
Definition: ELFAsmParser.cpp:503
llvm::objcopy::SymbolFlag::Warning
@ Warning
llvm::MCSection
Instances of this class represent a uniqued identifier for a section in the current translation unit.
Definition: MCSection.h:39
S
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
Definition: README.txt:210
llvm::MCSA_ELF_TypeTLS
@ MCSA_ELF_TypeTLS
.type _foo, STT_TLS # aka @tls_object
Definition: MCDirectives.h:26
llvm::StringSwitch::Cases
StringSwitch & Cases(StringLiteral S0, StringLiteral S1, T Value)
Definition: StringSwitch.h:90
llvm::MCSA_Internal
@ MCSA_Internal
.internal (ELF)
Definition: MCDirectives.h:36
llvm::MCSA_ELF_TypeCommon
@ MCSA_ELF_TypeCommon
.type _foo, STT_COMMON # aka @common
Definition: MCDirectives.h:27
llvm::SectionKind::getData
static SectionKind getData()
Definition: SectionKind.h:213
llvm::Twine
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition: Twine.h:83
MCAttrForString
static MCSymbolAttr MCAttrForString(StringRef Type)
Definition: ELFAsmParser.cpp:726
llvm::ELF::SHF_SUNW_NODISCARD
@ SHF_SUNW_NODISCARD
Definition: ELF.h:1076
llvm::SectionKind
SectionKind - This is a simple POD value that classifies the properties of a section.
Definition: SectionKind.h:22
llvm::GraphProgram::Name
Name
Definition: GraphWriter.h:50
llvm::AsmToken::Identifier
@ Identifier
Definition: MCAsmMacro.h:28
MCAsmParserExtension.h
llvm::AMDGPU::HSAMD::Kernel::Arg::Key::TypeName
constexpr char TypeName[]
Key for Kernel::Arg::Metadata::mTypeName.
Definition: AMDGPUMetadata.h:175
llvm::SMLoc::getPointer
const char * getPointer() const
Definition: SMLoc.h:34
llvm::ELF::SHF_MERGE
@ SHF_MERGE
Definition: ELF.h:1041
llvm::SectionName
Definition: DWARFSection.h:21
llvm::Error
Lightweight error class with error context and mandatory checking.
Definition: Error.h:155
llvm::MCAsmLexer::isNot
bool isNot(AsmToken::TokenKind K) const
Check if the current token has kind K.
Definition: MCAsmLexer.h:144
Casting.h
StringSwitch.h
llvm::ELF::SHT_INIT_ARRAY
@ SHT_INIT_ARRAY
Definition: ELF.h:966
SectionKind.h
llvm::ELF::SHT_LLVM_LINKER_OPTIONS
@ SHT_LLVM_LINKER_OPTIONS
Definition: ELF.h:980
llvm::MCSA_ELF_TypeFunction
@ MCSA_ELF_TypeFunction
.type _foo, STT_FUNC # aka @function
Definition: MCDirectives.h:23
llvm::MCSA_Weak
@ MCSA_Weak
.weak
Definition: MCDirectives.h:45
llvm::ELF::SHT_PROGBITS
@ SHT_PROGBITS
Definition: ELF.h:955
MCStreamer.h
llvm::MCSymbol::isInSection
bool isInSection() const
isInSection - Check if this symbol is defined in some section (i.e., it is defined but not absolute).
Definition: MCSymbol.h:247
llvm::MCSectionSubPair
std::pair< MCSection *, const MCExpr * > MCSectionSubPair
Definition: MCStreamer.h:66
llvm::StringSwitch
A switch()-like statement whose cases are string literals.
Definition: StringSwitch.h:44
llvm::AsmToken::String
@ String
Definition: MCAsmMacro.h:29
llvm::AsmToken::Hash
@ Hash
Definition: MCAsmMacro.h:52
llvm::Directive
Definition: DirectiveEmitter.h:100
llvm::ELF::SHF_EXECINSTR
@ SHF_EXECINSTR
Definition: ELF.h:1038
llvm::MCExpr
Base class for the full range of assembler expressions which are needed for parsing.
Definition: MCExpr.h:35
llvm::MCAsmLexer::getAllowAtInIdentifier
bool getAllowAtInIdentifier()
Definition: MCAsmLexer.h:149
llvm::ELF::SHF_EXCLUDE
@ SHF_EXCLUDE
Definition: ELF.h:1069