summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object/MachOObjectFile.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/MachOObjectFile.cpp
parent89a7a5ea1f4b29aa3333e25e4e88ea772da78f8a (diff)
downloadbcm5719-llvm-017597540e645ee69b336802d30c0e52f8a575d9.tar.gz
bcm5719-llvm-017597540e645ee69b336802d30c0e52f8a575d9.zip
Object: Add isSymbolWeak.
llvm-svn: 142316
Diffstat (limited to 'llvm/lib/Object/MachOObjectFile.cpp')
-rw-r--r--llvm/lib/Object/MachOObjectFile.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/lib/Object/MachOObjectFile.cpp b/llvm/lib/Object/MachOObjectFile.cpp
index 55887c91c14..c757dd35907 100644
--- a/llvm/lib/Object/MachOObjectFile.cpp
+++ b/llvm/lib/Object/MachOObjectFile.cpp
@@ -228,6 +228,20 @@ error_code MachOObjectFile::isSymbolGlobal(DataRefImpl Symb, bool &Res) const {
return object_error::success;
}
+error_code MachOObjectFile::isSymbolWeak(DataRefImpl Symb, bool &Res) const {
+
+ if (MachOObj->is64Bit()) {
+ InMemoryStruct<macho::Symbol64TableEntry> Entry;
+ getSymbol64TableEntry(Symb, Entry);
+ Res = Entry->Flags & (MachO::NListDescWeakRef | MachO::NListDescWeakDef);
+ } else {
+ InMemoryStruct<macho::SymbolTableEntry> Entry;
+ getSymbolTableEntry(Symb, Entry);
+ Res = Entry->Flags & (MachO::NListDescWeakRef | MachO::NListDescWeakDef);
+ }
+ return object_error::success;
+}
+
error_code MachOObjectFile::getSymbolType(DataRefImpl Symb,
SymbolRef::Type &Res) const {
uint8_t n_type;
OpenPOWER on IntegriCloud