Skip to content

Commit

Permalink
[ELF] Introduce getValue() for ELF Symbols.
Browse files Browse the repository at this point in the history
Differential Revision:	http://reviews.llvm.org/D10328
Reviewed by:	rafael


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239555 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
dcci committed Jun 11, 2015
1 parent 4ddb0ce commit 5a78f2d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/llvm/Object/ELFTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,13 @@ struct Elf_Sym_Impl : Elf_Sym_Base<ELFT> {
using Elf_Sym_Base<ELFT>::st_info;
using Elf_Sym_Base<ELFT>::st_shndx;
using Elf_Sym_Base<ELFT>::st_other;
using Elf_Sym_Base<ELFT>::st_value;

// These accessors and mutators correspond to the ELF32_ST_BIND,
// ELF32_ST_TYPE, and ELF32_ST_INFO macros defined in the ELF specification:
unsigned char getBinding() const { return st_info >> 4; }
unsigned char getType() const { return st_info & 0x0f; }
uint64_t getValue() const { return st_value; }
void setBinding(unsigned char b) { setBindingAndType(b, getType()); }
void setType(unsigned char t) { setBindingAndType(getBinding(), t); }
void setBindingAndType(unsigned char b, unsigned char t) {
Expand Down

0 comments on commit 5a78f2d

Please sign in to comment.