diff options
author | Michael J. Spencer <bigcheesegs@gmail.com> | 2011-10-17 23:54:22 +0000 |
---|---|---|
committer | Michael J. Spencer <bigcheesegs@gmail.com> | 2011-10-17 23:54:22 +0000 |
commit | c38c36a8c44bd32bdfc2e48ab3e447f6dc1547bd (patch) | |
tree | eba7a59ced4650d75a02fd34ec5f79877f57880e /lib/Object/ELFObjectFile.cpp | |
parent | 0e752cb4b4eb5676aace4d9f3d7c2e2334c13777 (diff) |
Object: Add isSymbolWeak.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142316 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Object/ELFObjectFile.cpp')
-rw-r--r-- | lib/Object/ELFObjectFile.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/Object/ELFObjectFile.cpp b/lib/Object/ELFObjectFile.cpp index 7a992e2fec..a3c8248912 100644 --- a/lib/Object/ELFObjectFile.cpp +++ b/lib/Object/ELFObjectFile.cpp @@ -331,6 +331,7 @@ protected: virtual error_code getSymbolNMTypeChar(DataRefImpl Symb, char &Res) const; virtual error_code isSymbolInternal(DataRefImpl Symb, bool &Res) const; virtual error_code isSymbolGlobal(DataRefImpl Symb, bool &Res) const; + virtual error_code isSymbolWeak(DataRefImpl Symb, bool &Res) const; virtual error_code getSymbolType(DataRefImpl Symb, SymbolRef::Type &Res) const; virtual error_code getSectionNext(DataRefImpl Sec, SectionRef &Res) const; @@ -643,6 +644,17 @@ error_code ELFObjectFile<target_endianness, is64Bits> template<support::endianness target_endianness, bool is64Bits> error_code ELFObjectFile<target_endianness, is64Bits> + ::isSymbolWeak(DataRefImpl Symb, + bool &Result) const { + validateSymbol(Symb); + const Elf_Sym *symb = getSymbol(Symb); + + Result = symb->getBinding() == ELF::STB_WEAK; + return object_error::success; +} + +template<support::endianness target_endianness, bool is64Bits> +error_code ELFObjectFile<target_endianness, is64Bits> ::isSymbolInternal(DataRefImpl Symb, bool &Result) const { validateSymbol(Symb); |