summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object/ELFObjectFile.cpp
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2011-10-17 23:54:22 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2011-10-17 23:54:22 +0000
commit017597540e645ee69b336802d30c0e52f8a575d9 (patch)
treea6337cdd18f19bc88c2840bf1033d723ccd0ac32 /llvm/lib/Object/ELFObjectFile.cpp
parent89a7a5ea1f4b29aa3333e25e4e88ea772da78f8a (diff)
downloadbcm5719-llvm-017597540e645ee69b336802d30c0e52f8a575d9.tar.gz
bcm5719-llvm-017597540e645ee69b336802d30c0e52f8a575d9.zip
Object: Add isSymbolWeak.
llvm-svn: 142316
Diffstat (limited to 'llvm/lib/Object/ELFObjectFile.cpp')
-rw-r--r--llvm/lib/Object/ELFObjectFile.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/Object/ELFObjectFile.cpp b/llvm/lib/Object/ELFObjectFile.cpp
index 7a992e2fecf..a3c8248912a 100644
--- a/llvm/lib/Object/ELFObjectFile.cpp
+++ b/llvm/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);
OpenPOWER on IntegriCloud