diff options
| author | Kevin Enderby <enderby@apple.com> | 2016-01-21 21:13:27 +0000 |
|---|---|---|
| committer | Kevin Enderby <enderby@apple.com> | 2016-01-21 21:13:27 +0000 |
| commit | 1f472eace5207f41e55953d62cc9c5b0dab31eba (patch) | |
| tree | f45739dbacda44119f006be74a9241afdf092711 /llvm/lib/Object/MachOObjectFile.cpp | |
| parent | f0a275e0358911794545810b96c5d160e7bd714f (diff) | |
| download | bcm5719-llvm-1f472eace5207f41e55953d62cc9c5b0dab31eba.tar.gz bcm5719-llvm-1f472eace5207f41e55953d62cc9c5b0dab31eba.zip | |
Fix MachOObjectFile::getSymbolSection() 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 "(?,?)" or just "s" for bad section indexes. Also added a test to show
it prints the bad section index of "42" when printing the fields as raw hex.
llvm-svn: 258434
Diffstat (limited to 'llvm/lib/Object/MachOObjectFile.cpp')
| -rw-r--r-- | llvm/lib/Object/MachOObjectFile.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Object/MachOObjectFile.cpp b/llvm/lib/Object/MachOObjectFile.cpp index d1f79b225ee..4ba6523a528 100644 --- a/llvm/lib/Object/MachOObjectFile.cpp +++ b/llvm/lib/Object/MachOObjectFile.cpp @@ -458,7 +458,7 @@ MachOObjectFile::getSymbolSection(DataRefImpl Symb) const { DataRefImpl DRI; DRI.d.a = index - 1; if (DRI.d.a >= Sections.size()) - report_fatal_error("getSymbolSection: Invalid section index."); + return object_error::parse_failed; return section_iterator(SectionRef(DRI, this)); } |

