llvm.org GIT mirror llvm / 7358cbc
[ELF] Add some accessors for lld. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240730 91177308-0d34-0410-b5e6-96231b3b80d8 Michael J. Spencer 4 years ago
2 changed file(s) with 15 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
226226 ArchivePointerTypeTraits > Current;
227227 };
228228
229 typedef iterator_range Elf_Sym_Range;
230
229231 private:
230232 typedef SmallVector Sections_t;
231233 typedef DenseMap IndexMap_t;
339341
340342 Elf_Sym_Iter begin_symbols() const;
341343 Elf_Sym_Iter end_symbols() const;
344 Elf_Sym_Range symbols() const {
345 return make_range(begin_symbols(), end_symbols());
346 }
342347
343348 Elf_Dyn_Iter begin_dynamic_table() const;
344349 /// \param NULLEnd use one past the first DT_NULL entry as the end instead of
423428 const Elf_Sym *getSymbol(uint32_t index) const;
424429
425430 ErrorOr getSymbolName(Elf_Sym_Iter Sym) const;
431 ErrorOr getStaticSymbolName(const Elf_Sym *Symb) const;
426432
427433 /// \brief Get the name of \p Symb.
428434 /// \param SymTab The symbol table section \p Symb is contained in.
961967 }
962968
963969 template
970 ErrorOr
971 ELFFile::getStaticSymbolName(const Elf_Sym *Symb) const {
972 return getSymbolName(dot_symtab_sec, Symb);
973 }
974
975 template
964976 ErrorOr ELFFile::getSymbolName(const Elf_Shdr *Section,
965977 const Elf_Sym *Symb) const {
966978 if (Symb->st_name == 0)
196196 return st_shndx >= ELF::SHN_LORESERVE;
197197 }
198198 bool isUndefined() const { return st_shndx == ELF::SHN_UNDEF; }
199 bool isExternal() const {
200 return getBinding() != ELF::STB_LOCAL;
201 }
199202 };
200203
201204 /// Elf_Versym: This is the structure of entries in the SHT_GNU_versym section