summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2016-07-27 22:55:30 +0000
committerLang Hames <lhames@gmail.com>2016-07-27 22:55:30 +0000
commit436f7d660625d45a306977c31577ac62820df3e3 (patch)
tree0037ab4fbeb5aef16fdd02285b714e23482cea39 /lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp
parent03a3cec4807674c4e5dc6c74834b9ed4bdf72edc (diff)
downloadbcm5719-llvm-436f7d660625d45a306977c31577ac62820df3e3.tar.gz
bcm5719-llvm-436f7d660625d45a306977c31577ac62820df3e3.zip
[lld][MachO] Re-apply r276921 with fix - initialize strings for debug string
copies. llvm-svn: 276935
Diffstat (limited to 'lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp')
-rw-r--r--lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp b/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp
index a17de5be174..d7011351411 100644
--- a/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp
+++ b/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp
@@ -390,12 +390,14 @@ readBinary(std::unique_ptr<MemoryBuffer> &mb,
if (sin->n_strx > strSize)
return true;
sout.name = &strings[sin->n_strx];
- sout.type = (NListType)(sin->n_type & N_TYPE);
+ sout.type = static_cast<NListType>(sin->n_type & (N_STAB|N_TYPE));
sout.scope = (sin->n_type & (N_PEXT|N_EXT));
sout.sect = sin->n_sect;
sout.desc = sin->n_desc;
sout.value = sin->n_value;
- if (sout.type == N_UNDF)
+ if (sin->n_type & N_STAB)
+ f->stabsSymbols.push_back(sout);
+ else if (sout.type == N_UNDF)
f->undefinedSymbols.push_back(sout);
else if (sin->n_type & N_EXT)
f->globalSymbols.push_back(sout);
@@ -429,6 +431,8 @@ readBinary(std::unique_ptr<MemoryBuffer> &mb,
f->undefinedSymbols.push_back(sout);
else if (sout.scope == (SymbolScope)N_EXT)
f->globalSymbols.push_back(sout);
+ else if (sin->n_type & N_STAB)
+ f->stabsSymbols.push_back(sout);
else
f->localSymbols.push_back(sout);
}
@@ -535,7 +539,7 @@ public:
loadFile(std::unique_ptr<MemoryBuffer> mb,
const Registry &registry) const override {
std::unique_ptr<File> ret =
- llvm::make_unique<MachOFile>(std::move(mb), &_ctx);
+ llvm::make_unique<MachOFile>(std::move(mb), &_ctx);
return std::move(ret);
}
OpenPOWER on IntegriCloud