summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object/MachOObjectFile.cpp
diff options
context:
space:
mode:
authorKevin Enderby <enderby@apple.com>2016-01-22 18:47:14 +0000
committerKevin Enderby <enderby@apple.com>2016-01-22 18:47:14 +0000
commitf681ec5db15fc039d3c94ac03032f7b87788160d (patch)
tree428d3a39f901f7513cf8badb4b2a4e32cee936ba /llvm/lib/Object/MachOObjectFile.cpp
parentae108c47043a93b0cb3c775ebe79588324c305d6 (diff)
downloadbcm5719-llvm-f681ec5db15fc039d3c94ac03032f7b87788160d.tar.gz
bcm5719-llvm-f681ec5db15fc039d3c94ac03032f7b87788160d.zip
Fix MachOObjectFile::getSymbolName() to not call report_fatal_error()
but to return object_error::parse_failed.  Then made the code in llvm-nm do for Mach-O files what is done in the darwin native tools which is to print "bad string index" for bad string indexes. Updated the error message in the llvm-objdump test, and added tests to show llvm-nm prints "bad string index" and a test to print the actual bad string index value which in this case is 0xfe000002 when printing the fields as raw hex. llvm-svn: 258520
Diffstat (limited to 'llvm/lib/Object/MachOObjectFile.cpp')
-rw-r--r--llvm/lib/Object/MachOObjectFile.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/Object/MachOObjectFile.cpp b/llvm/lib/Object/MachOObjectFile.cpp
index 4ba6523a528..3fb8e537fad 100644
--- a/llvm/lib/Object/MachOObjectFile.cpp
+++ b/llvm/lib/Object/MachOObjectFile.cpp
@@ -332,8 +332,7 @@ ErrorOr<StringRef> MachOObjectFile::getSymbolName(DataRefImpl Symb) const {
MachO::nlist_base Entry = getSymbolTableEntryBase(this, Symb);
const char *Start = &StringTable.data()[Entry.n_strx];
if (Start < getData().begin() || Start >= getData().end())
- report_fatal_error(
- "Symbol name entry points before beginning or past end of file.");
+ return object_error::parse_failed;
return StringRef(Start);
}
OpenPOWER on IntegriCloud