1 //===- ELF.h - ELF object file implementation -------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file declares the ELFFile template class.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_OBJECT_ELF_H
15 #define LLVM_OBJECT_ELF_H
17 #include "llvm/ADT/ArrayRef.h"
18 #include "llvm/ADT/SmallVector.h"
19 #include "llvm/ADT/StringRef.h"
20 #include "llvm/BinaryFormat/ELF.h"
21 #include "llvm/Object/ELFTypes.h"
22 #include "llvm/Object/Error.h"
23 #include "llvm/Support/Endian.h"
24 #include "llvm/Support/Error.h"
34 StringRef getELFRelocationTypeName(uint32_t Machine, uint32_t Type);
35 uint32_t getELFRelativeRelocationType(uint32_t Machine);
36 StringRef getELFSectionTypeName(uint32_t Machine, uint32_t Type);
38 // Subclasses of ELFFile may need this for template instantiation
39 inline std::pair<unsigned char, unsigned char>
40 getElfArchType(StringRef Object) {
41 if (Object.size() < ELF::EI_NIDENT)
42 return std::make_pair((uint8_t)ELF::ELFCLASSNONE,
43 (uint8_t)ELF::ELFDATANONE);
44 return std::make_pair((uint8_t)Object[ELF::EI_CLASS],
45 (uint8_t)Object[ELF::EI_DATA]);
48 static inline Error createError(StringRef Err) {
49 return make_error<StringError>(Err, object_error::parse_failed);
55 LLVM_ELF_IMPORT_TYPES_ELFT(ELFT)
56 using uintX_t = typename ELFT::uint;
57 using Elf_Ehdr = typename ELFT::Ehdr;
58 using Elf_Shdr = typename ELFT::Shdr;
59 using Elf_Sym = typename ELFT::Sym;
60 using Elf_Dyn = typename ELFT::Dyn;
61 using Elf_Phdr = typename ELFT::Phdr;
62 using Elf_Rel = typename ELFT::Rel;
63 using Elf_Rela = typename ELFT::Rela;
64 using Elf_Relr = typename ELFT::Relr;
65 using Elf_Verdef = typename ELFT::Verdef;
66 using Elf_Verdaux = typename ELFT::Verdaux;
67 using Elf_Verneed = typename ELFT::Verneed;
68 using Elf_Vernaux = typename ELFT::Vernaux;
69 using Elf_Versym = typename ELFT::Versym;
70 using Elf_Hash = typename ELFT::Hash;
71 using Elf_GnuHash = typename ELFT::GnuHash;
72 using Elf_Nhdr = typename ELFT::Nhdr;
73 using Elf_Note = typename ELFT::Note;
74 using Elf_Note_Iterator = typename ELFT::NoteIterator;
75 using Elf_Dyn_Range = typename ELFT::DynRange;
76 using Elf_Shdr_Range = typename ELFT::ShdrRange;
77 using Elf_Sym_Range = typename ELFT::SymRange;
78 using Elf_Rel_Range = typename ELFT::RelRange;
79 using Elf_Rela_Range = typename ELFT::RelaRange;
80 using Elf_Relr_Range = typename ELFT::RelrRange;
81 using Elf_Phdr_Range = typename ELFT::PhdrRange;
83 const uint8_t *base() const {
84 return reinterpret_cast<const uint8_t *>(Buf.data());
87 size_t getBufSize() const { return Buf.size(); }
92 ELFFile(StringRef Object);
95 const Elf_Ehdr *getHeader() const {
96 return reinterpret_cast<const Elf_Ehdr *>(base());
100 Expected<const T *> getEntry(uint32_t Section, uint32_t Entry) const;
101 template <typename T>
102 Expected<const T *> getEntry(const Elf_Shdr *Section, uint32_t Entry) const;
104 Expected<StringRef> getStringTable(const Elf_Shdr *Section) const;
105 Expected<StringRef> getStringTableForSymtab(const Elf_Shdr &Section) const;
106 Expected<StringRef> getStringTableForSymtab(const Elf_Shdr &Section,
107 Elf_Shdr_Range Sections) const;
109 Expected<ArrayRef<Elf_Word>> getSHNDXTable(const Elf_Shdr &Section) const;
110 Expected<ArrayRef<Elf_Word>> getSHNDXTable(const Elf_Shdr &Section,
111 Elf_Shdr_Range Sections) const;
113 StringRef getRelocationTypeName(uint32_t Type) const;
114 void getRelocationTypeName(uint32_t Type,
115 SmallVectorImpl<char> &Result) const;
116 uint32_t getRelativeRelocationType() const;
118 const char *getDynamicTagAsString(unsigned Arch, uint64_t Type) const;
119 const char *getDynamicTagAsString(uint64_t Type) const;
121 /// Get the symbol for a given relocation.
122 Expected<const Elf_Sym *> getRelocationSymbol(const Elf_Rel *Rel,
123 const Elf_Shdr *SymTab) const;
125 static Expected<ELFFile> create(StringRef Object);
127 bool isMipsELF64() const {
128 return getHeader()->e_machine == ELF::EM_MIPS &&
129 getHeader()->getFileClass() == ELF::ELFCLASS64;
132 bool isMips64EL() const {
133 return isMipsELF64() &&
134 getHeader()->getDataEncoding() == ELF::ELFDATA2LSB;
137 Expected<Elf_Shdr_Range> sections() const;
139 Expected<Elf_Dyn_Range> dynamicEntries() const;
141 Expected<const uint8_t *> toMappedAddr(uint64_t VAddr) const;
143 Expected<Elf_Sym_Range> symbols(const Elf_Shdr *Sec) const {
145 return makeArrayRef<Elf_Sym>(nullptr, nullptr);
146 return getSectionContentsAsArray<Elf_Sym>(Sec);
149 Expected<Elf_Rela_Range> relas(const Elf_Shdr *Sec) const {
150 return getSectionContentsAsArray<Elf_Rela>(Sec);
153 Expected<Elf_Rel_Range> rels(const Elf_Shdr *Sec) const {
154 return getSectionContentsAsArray<Elf_Rel>(Sec);
157 Expected<Elf_Relr_Range> relrs(const Elf_Shdr *Sec) const {
158 return getSectionContentsAsArray<Elf_Relr>(Sec);
161 Expected<std::vector<Elf_Rela>> decode_relrs(Elf_Relr_Range relrs) const;
163 Expected<std::vector<Elf_Rela>> android_relas(const Elf_Shdr *Sec) const;
165 /// Iterate over program header table.
166 Expected<Elf_Phdr_Range> program_headers() const {
167 if (getHeader()->e_phnum && getHeader()->e_phentsize != sizeof(Elf_Phdr))
168 return createError("invalid e_phentsize");
169 if (getHeader()->e_phoff +
170 (getHeader()->e_phnum * getHeader()->e_phentsize) >
172 return createError("program headers longer than binary");
174 reinterpret_cast<const Elf_Phdr *>(base() + getHeader()->e_phoff);
175 return makeArrayRef(Begin, Begin + getHeader()->e_phnum);
178 /// Get an iterator over notes in a program header.
180 /// The program header must be of type \c PT_NOTE.
182 /// \param Phdr the program header to iterate over.
183 /// \param Err [out] an error to support fallible iteration, which should
184 /// be checked after iteration ends.
185 Elf_Note_Iterator notes_begin(const Elf_Phdr &Phdr, Error &Err) const {
186 if (Phdr.p_type != ELF::PT_NOTE) {
187 Err = createError("attempt to iterate notes of non-note program header");
188 return Elf_Note_Iterator(Err);
190 if (Phdr.p_offset + Phdr.p_filesz > getBufSize()) {
191 Err = createError("invalid program header offset/size");
192 return Elf_Note_Iterator(Err);
194 return Elf_Note_Iterator(base() + Phdr.p_offset, Phdr.p_filesz, Err);
197 /// Get an iterator over notes in a section.
199 /// The section must be of type \c SHT_NOTE.
201 /// \param Shdr the section to iterate over.
202 /// \param Err [out] an error to support fallible iteration, which should
203 /// be checked after iteration ends.
204 Elf_Note_Iterator notes_begin(const Elf_Shdr &Shdr, Error &Err) const {
205 if (Shdr.sh_type != ELF::SHT_NOTE) {
206 Err = createError("attempt to iterate notes of non-note section");
207 return Elf_Note_Iterator(Err);
209 if (Shdr.sh_offset + Shdr.sh_size > getBufSize()) {
210 Err = createError("invalid section offset/size");
211 return Elf_Note_Iterator(Err);
213 return Elf_Note_Iterator(base() + Shdr.sh_offset, Shdr.sh_size, Err);
216 /// Get the end iterator for notes.
217 Elf_Note_Iterator notes_end() const {
218 return Elf_Note_Iterator();
221 /// Get an iterator range over notes of a program header.
223 /// The program header must be of type \c PT_NOTE.
225 /// \param Phdr the program header to iterate over.
226 /// \param Err [out] an error to support fallible iteration, which should
227 /// be checked after iteration ends.
228 iterator_range<Elf_Note_Iterator> notes(const Elf_Phdr &Phdr,
230 return make_range(notes_begin(Phdr, Err), notes_end());
233 /// Get an iterator range over notes of a section.
235 /// The section must be of type \c SHT_NOTE.
237 /// \param Shdr the section to iterate over.
238 /// \param Err [out] an error to support fallible iteration, which should
239 /// be checked after iteration ends.
240 iterator_range<Elf_Note_Iterator> notes(const Elf_Shdr &Shdr,
242 return make_range(notes_begin(Shdr, Err), notes_end());
245 Expected<StringRef> getSectionStringTable(Elf_Shdr_Range Sections) const;
246 Expected<uint32_t> getSectionIndex(const Elf_Sym *Sym, Elf_Sym_Range Syms,
247 ArrayRef<Elf_Word> ShndxTable) const;
248 Expected<const Elf_Shdr *> getSection(const Elf_Sym *Sym,
249 const Elf_Shdr *SymTab,
250 ArrayRef<Elf_Word> ShndxTable) const;
251 Expected<const Elf_Shdr *> getSection(const Elf_Sym *Sym,
252 Elf_Sym_Range Symtab,
253 ArrayRef<Elf_Word> ShndxTable) const;
254 Expected<const Elf_Shdr *> getSection(uint32_t Index) const;
255 Expected<const Elf_Shdr *> getSection(const StringRef SectionName) const;
257 Expected<const Elf_Sym *> getSymbol(const Elf_Shdr *Sec,
258 uint32_t Index) const;
260 Expected<StringRef> getSectionName(const Elf_Shdr *Section) const;
261 Expected<StringRef> getSectionName(const Elf_Shdr *Section,
262 StringRef DotShstrtab) const;
263 template <typename T>
264 Expected<ArrayRef<T>> getSectionContentsAsArray(const Elf_Shdr *Sec) const;
265 Expected<ArrayRef<uint8_t>> getSectionContents(const Elf_Shdr *Sec) const;
268 using ELF32LEFile = ELFFile<ELF32LE>;
269 using ELF64LEFile = ELFFile<ELF64LE>;
270 using ELF32BEFile = ELFFile<ELF32BE>;
271 using ELF64BEFile = ELFFile<ELF64BE>;
273 template <class ELFT>
274 inline Expected<const typename ELFT::Shdr *>
275 getSection(typename ELFT::ShdrRange Sections, uint32_t Index) {
276 if (Index >= Sections.size())
277 return createError("invalid section index");
278 return &Sections[Index];
281 template <class ELFT>
282 inline Expected<uint32_t>
283 getExtendedSymbolTableIndex(const typename ELFT::Sym *Sym,
284 const typename ELFT::Sym *FirstSym,
285 ArrayRef<typename ELFT::Word> ShndxTable) {
286 assert(Sym->st_shndx == ELF::SHN_XINDEX);
287 unsigned Index = Sym - FirstSym;
288 if (Index >= ShndxTable.size())
289 return createError("index past the end of the symbol table");
291 // The size of the table was checked in getSHNDXTable.
292 return ShndxTable[Index];
295 template <class ELFT>
297 ELFFile<ELFT>::getSectionIndex(const Elf_Sym *Sym, Elf_Sym_Range Syms,
298 ArrayRef<Elf_Word> ShndxTable) const {
299 uint32_t Index = Sym->st_shndx;
300 if (Index == ELF::SHN_XINDEX) {
301 auto ErrorOrIndex = getExtendedSymbolTableIndex<ELFT>(
302 Sym, Syms.begin(), ShndxTable);
304 return ErrorOrIndex.takeError();
305 return *ErrorOrIndex;
307 if (Index == ELF::SHN_UNDEF || Index >= ELF::SHN_LORESERVE)
312 template <class ELFT>
313 Expected<const typename ELFT::Shdr *>
314 ELFFile<ELFT>::getSection(const Elf_Sym *Sym, const Elf_Shdr *SymTab,
315 ArrayRef<Elf_Word> ShndxTable) const {
316 auto SymsOrErr = symbols(SymTab);
318 return SymsOrErr.takeError();
319 return getSection(Sym, *SymsOrErr, ShndxTable);
322 template <class ELFT>
323 Expected<const typename ELFT::Shdr *>
324 ELFFile<ELFT>::getSection(const Elf_Sym *Sym, Elf_Sym_Range Symbols,
325 ArrayRef<Elf_Word> ShndxTable) const {
326 auto IndexOrErr = getSectionIndex(Sym, Symbols, ShndxTable);
328 return IndexOrErr.takeError();
329 uint32_t Index = *IndexOrErr;
332 return getSection(Index);
335 template <class ELFT>
336 inline Expected<const typename ELFT::Sym *>
337 getSymbol(typename ELFT::SymRange Symbols, uint32_t Index) {
338 if (Index >= Symbols.size())
339 return createError("invalid symbol index");
340 return &Symbols[Index];
343 template <class ELFT>
344 Expected<const typename ELFT::Sym *>
345 ELFFile<ELFT>::getSymbol(const Elf_Shdr *Sec, uint32_t Index) const {
346 auto SymtabOrErr = symbols(Sec);
348 return SymtabOrErr.takeError();
349 return object::getSymbol<ELFT>(*SymtabOrErr, Index);
352 template <class ELFT>
353 template <typename T>
354 Expected<ArrayRef<T>>
355 ELFFile<ELFT>::getSectionContentsAsArray(const Elf_Shdr *Sec) const {
356 if (Sec->sh_entsize != sizeof(T) && sizeof(T) != 1)
357 return createError("invalid sh_entsize");
359 uintX_t Offset = Sec->sh_offset;
360 uintX_t Size = Sec->sh_size;
362 if (Size % sizeof(T))
363 return createError("size is not a multiple of sh_entsize");
364 if ((std::numeric_limits<uintX_t>::max() - Offset < Size) ||
365 Offset + Size > Buf.size())
366 return createError("invalid section offset");
368 if (Offset % alignof(T))
369 return createError("unaligned data");
371 const T *Start = reinterpret_cast<const T *>(base() + Offset);
372 return makeArrayRef(Start, Size / sizeof(T));
375 template <class ELFT>
376 Expected<ArrayRef<uint8_t>>
377 ELFFile<ELFT>::getSectionContents(const Elf_Shdr *Sec) const {
378 return getSectionContentsAsArray<uint8_t>(Sec);
381 template <class ELFT>
382 StringRef ELFFile<ELFT>::getRelocationTypeName(uint32_t Type) const {
383 return getELFRelocationTypeName(getHeader()->e_machine, Type);
386 template <class ELFT>
387 void ELFFile<ELFT>::getRelocationTypeName(uint32_t Type,
388 SmallVectorImpl<char> &Result) const {
389 if (!isMipsELF64()) {
390 StringRef Name = getRelocationTypeName(Type);
391 Result.append(Name.begin(), Name.end());
393 // The Mips N64 ABI allows up to three operations to be specified per
394 // relocation record. Unfortunately there's no easy way to test for the
395 // presence of N64 ELFs as they have no special flag that identifies them
396 // as being N64. We can safely assume at the moment that all Mips
397 // ELFCLASS64 ELFs are N64. New Mips64 ABIs should provide enough
398 // information to disambiguate between old vs new ABIs.
399 uint8_t Type1 = (Type >> 0) & 0xFF;
400 uint8_t Type2 = (Type >> 8) & 0xFF;
401 uint8_t Type3 = (Type >> 16) & 0xFF;
403 // Concat all three relocation type names.
404 StringRef Name = getRelocationTypeName(Type1);
405 Result.append(Name.begin(), Name.end());
407 Name = getRelocationTypeName(Type2);
408 Result.append(1, '/');
409 Result.append(Name.begin(), Name.end());
411 Name = getRelocationTypeName(Type3);
412 Result.append(1, '/');
413 Result.append(Name.begin(), Name.end());
417 template <class ELFT>
418 uint32_t ELFFile<ELFT>::getRelativeRelocationType() const {
419 return getELFRelativeRelocationType(getHeader()->e_machine);
422 template <class ELFT>
423 Expected<const typename ELFT::Sym *>
424 ELFFile<ELFT>::getRelocationSymbol(const Elf_Rel *Rel,
425 const Elf_Shdr *SymTab) const {
426 uint32_t Index = Rel->getSymbol(isMips64EL());
429 return getEntry<Elf_Sym>(SymTab, Index);
432 template <class ELFT>
434 ELFFile<ELFT>::getSectionStringTable(Elf_Shdr_Range Sections) const {
435 uint32_t Index = getHeader()->e_shstrndx;
436 if (Index == ELF::SHN_XINDEX)
437 Index = Sections[0].sh_link;
439 if (!Index) // no section string table.
441 if (Index >= Sections.size())
442 return createError("invalid section index");
443 return getStringTable(&Sections[Index]);
446 template <class ELFT> ELFFile<ELFT>::ELFFile(StringRef Object) : Buf(Object) {}
448 template <class ELFT>
449 Expected<ELFFile<ELFT>> ELFFile<ELFT>::create(StringRef Object) {
450 if (sizeof(Elf_Ehdr) > Object.size())
451 return createError("Invalid buffer");
452 return ELFFile(Object);
455 template <class ELFT>
456 Expected<typename ELFT::ShdrRange> ELFFile<ELFT>::sections() const {
457 const uintX_t SectionTableOffset = getHeader()->e_shoff;
458 if (SectionTableOffset == 0)
459 return ArrayRef<Elf_Shdr>();
461 if (getHeader()->e_shentsize != sizeof(Elf_Shdr))
463 "invalid section header entry size (e_shentsize) in ELF header");
465 const uint64_t FileSize = Buf.size();
467 if (SectionTableOffset + sizeof(Elf_Shdr) > FileSize)
468 return createError("section header table goes past the end of the file");
470 // Invalid address alignment of section headers
471 if (SectionTableOffset & (alignof(Elf_Shdr) - 1))
472 return createError("invalid alignment of section headers");
474 const Elf_Shdr *First =
475 reinterpret_cast<const Elf_Shdr *>(base() + SectionTableOffset);
477 uintX_t NumSections = getHeader()->e_shnum;
478 if (NumSections == 0)
479 NumSections = First->sh_size;
481 if (NumSections > UINT64_MAX / sizeof(Elf_Shdr))
482 return createError("section table goes past the end of file");
484 const uint64_t SectionTableSize = NumSections * sizeof(Elf_Shdr);
486 // Section table goes past end of file!
487 if (SectionTableOffset + SectionTableSize > FileSize)
488 return createError("section table goes past the end of file");
490 return makeArrayRef(First, NumSections);
493 template <class ELFT>
494 template <typename T>
495 Expected<const T *> ELFFile<ELFT>::getEntry(uint32_t Section,
496 uint32_t Entry) const {
497 auto SecOrErr = getSection(Section);
499 return SecOrErr.takeError();
500 return getEntry<T>(*SecOrErr, Entry);
503 template <class ELFT>
504 template <typename T>
505 Expected<const T *> ELFFile<ELFT>::getEntry(const Elf_Shdr *Section,
506 uint32_t Entry) const {
507 if (sizeof(T) != Section->sh_entsize)
508 return createError("invalid sh_entsize");
509 size_t Pos = Section->sh_offset + Entry * sizeof(T);
510 if (Pos + sizeof(T) > Buf.size())
511 return createError("invalid section offset");
512 return reinterpret_cast<const T *>(base() + Pos);
515 template <class ELFT>
516 Expected<const typename ELFT::Shdr *>
517 ELFFile<ELFT>::getSection(uint32_t Index) const {
518 auto TableOrErr = sections();
520 return TableOrErr.takeError();
521 return object::getSection<ELFT>(*TableOrErr, Index);
524 template <class ELFT>
525 Expected<const typename ELFT::Shdr *>
526 ELFFile<ELFT>::getSection(const StringRef SectionName) const {
527 auto TableOrErr = sections();
529 return TableOrErr.takeError();
530 for (auto &Sec : *TableOrErr) {
531 auto SecNameOrErr = getSectionName(&Sec);
533 return SecNameOrErr.takeError();
534 if (*SecNameOrErr == SectionName)
537 return createError("invalid section name");
540 template <class ELFT>
542 ELFFile<ELFT>::getStringTable(const Elf_Shdr *Section) const {
543 if (Section->sh_type != ELF::SHT_STRTAB)
544 return createError("invalid sh_type for string table, expected SHT_STRTAB");
545 auto V = getSectionContentsAsArray<char>(Section);
547 return V.takeError();
548 ArrayRef<char> Data = *V;
550 return createError("empty string table");
551 if (Data.back() != '\0')
552 return createError("string table non-null terminated");
553 return StringRef(Data.begin(), Data.size());
556 template <class ELFT>
557 Expected<ArrayRef<typename ELFT::Word>>
558 ELFFile<ELFT>::getSHNDXTable(const Elf_Shdr &Section) const {
559 auto SectionsOrErr = sections();
561 return SectionsOrErr.takeError();
562 return getSHNDXTable(Section, *SectionsOrErr);
565 template <class ELFT>
566 Expected<ArrayRef<typename ELFT::Word>>
567 ELFFile<ELFT>::getSHNDXTable(const Elf_Shdr &Section,
568 Elf_Shdr_Range Sections) const {
569 assert(Section.sh_type == ELF::SHT_SYMTAB_SHNDX);
570 auto VOrErr = getSectionContentsAsArray<Elf_Word>(&Section);
572 return VOrErr.takeError();
573 ArrayRef<Elf_Word> V = *VOrErr;
574 auto SymTableOrErr = object::getSection<ELFT>(Sections, Section.sh_link);
576 return SymTableOrErr.takeError();
577 const Elf_Shdr &SymTable = **SymTableOrErr;
578 if (SymTable.sh_type != ELF::SHT_SYMTAB &&
579 SymTable.sh_type != ELF::SHT_DYNSYM)
580 return createError("invalid sh_type");
581 if (V.size() != (SymTable.sh_size / sizeof(Elf_Sym)))
582 return createError("invalid section contents size");
586 template <class ELFT>
588 ELFFile<ELFT>::getStringTableForSymtab(const Elf_Shdr &Sec) const {
589 auto SectionsOrErr = sections();
591 return SectionsOrErr.takeError();
592 return getStringTableForSymtab(Sec, *SectionsOrErr);
595 template <class ELFT>
597 ELFFile<ELFT>::getStringTableForSymtab(const Elf_Shdr &Sec,
598 Elf_Shdr_Range Sections) const {
600 if (Sec.sh_type != ELF::SHT_SYMTAB && Sec.sh_type != ELF::SHT_DYNSYM)
602 "invalid sh_type for symbol table, expected SHT_SYMTAB or SHT_DYNSYM");
603 auto SectionOrErr = object::getSection<ELFT>(Sections, Sec.sh_link);
605 return SectionOrErr.takeError();
606 return getStringTable(*SectionOrErr);
609 template <class ELFT>
611 ELFFile<ELFT>::getSectionName(const Elf_Shdr *Section) const {
612 auto SectionsOrErr = sections();
614 return SectionsOrErr.takeError();
615 auto Table = getSectionStringTable(*SectionsOrErr);
617 return Table.takeError();
618 return getSectionName(Section, *Table);
621 template <class ELFT>
622 Expected<StringRef> ELFFile<ELFT>::getSectionName(const Elf_Shdr *Section,
623 StringRef DotShstrtab) const {
624 uint32_t Offset = Section->sh_name;
627 if (Offset >= DotShstrtab.size())
628 return createError("invalid string offset");
629 return StringRef(DotShstrtab.data() + Offset);
632 /// This function returns the hash value for a symbol in the .dynsym section
633 /// Name of the API remains consistent as specified in the libelf
634 /// REF : http://www.sco.com/developers/gabi/latest/ch5.dynamic.html#hash
635 inline unsigned hashSysV(StringRef SymbolName) {
637 for (char C : SymbolName) {
647 } // end namespace object
648 } // end namespace llvm
650 #endif // LLVM_OBJECT_ELF_H