summaryrefslogtreecommitdiff
path: root/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2011-05-13 23:11:30 +0000
committerJim Grosbach <grosbach@apple.com>2011-05-13 23:11:30 +0000
commit1c3c8ea66261b7a4fd8813f096514c0a041fbda6 (patch)
tree059850e3d4d627c651e1e2341671c28fc248f7a0 /lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
parentf5895e95926c96574888d7eb20b62d2cffe86193 (diff)
downloadllvm-1c3c8ea66261b7a4fd8813f096514c0a041fbda6.tar.gz
llvm-1c3c8ea66261b7a4fd8813f096514c0a041fbda6.tar.bz2
llvm-1c3c8ea66261b7a4fd8813f096514c0a041fbda6.tar.xz
Be a bit more permissive about symbols we don't understand. Just skip them
rather than throwing an error. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131322 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp')
-rw-r--r--lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
index 2cfe87f37b..eda4cbbad5 100644
--- a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
+++ b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
@@ -296,11 +296,11 @@ loadSegment32(const MachOObject *Obj,
// FIXME: Check the symbol type and flags.
if (STE->Type != 0xF) // external, defined in this section.
- return Error("unexpected symbol type!");
+ continue;
// Flags == 0x8 marks a thumb function for ARM, which is fine as it
// doesn't require any special handling here.
if (STE->Flags != 0x0 && STE->Flags != 0x8)
- return Error("unexpected symbol type!");
+ continue;
// Remember the symbol.
Symbols.push_back(SymbolEntry(STE->Value, Name));
@@ -311,6 +311,10 @@ loadSegment32(const MachOObject *Obj,
// Sort the symbols by address, just in case they didn't come in that way.
array_pod_sort(Symbols.begin(), Symbols.end());
+ // If there weren't any functions (odd, but just in case...)
+ if (!Symbols.size())
+ continue;
+
// Extract the function data.
uint8_t *Base = (uint8_t*)Obj->getData(SegmentLC->FileOffset,
SegmentLC->FileSize).data();
@@ -431,9 +435,9 @@ loadSegment64(const MachOObject *Obj,
// FIXME: Check the symbol type and flags.
if (STE->Type != 0xF) // external, defined in this section.
- return Error("unexpected symbol type!");
+ continue;
if (STE->Flags != 0x0)
- return Error("unexpected symbol type!");
+ continue;
// Remember the symbol.
Symbols.push_back(SymbolEntry(STE->Value, Name));
@@ -444,6 +448,10 @@ loadSegment64(const MachOObject *Obj,
// Sort the symbols by address, just in case they didn't come in that way.
array_pod_sort(Symbols.begin(), Symbols.end());
+ // If there weren't any functions (odd, but just in case...)
+ if (!Symbols.size())
+ continue;
+
// Extract the function data.
uint8_t *Base = (uint8_t*)Obj->getData(Segment64LC->FileOffset,
Segment64LC->FileSize).data();