summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorge Rimar <grimar@accesssoftek.com>2016-10-17 10:20:47 +0000
committerGeorge Rimar <grimar@accesssoftek.com>2016-10-17 10:20:47 +0000
commit830a62aa3954ad1e924c42c1ac85e6b84b4973ae (patch)
tree3cda7737a0cace951161d948f8c8734bb63cf302
parent45bf62fc5e3bf59bdea521b88bf9f533082272c4 (diff)
downloadbcm5719-llvm-830a62aa3954ad1e924c42c1ac85e6b84b4973ae.tar.gz
bcm5719-llvm-830a62aa3954ad1e924c42c1ac85e6b84b4973ae.zip
Revert r284371 "[Object/ELF] - Check that e_shnum is null when e_shoff is."
It broke build bot: http://lab.llvm.org:8011/builders/clang-with-lto-ubuntu/builds/908/steps/test-stage1-compiler/logs/stdio llvm-svn: 284373
-rw-r--r--llvm/include/llvm/Object/ELF.h6
-rw-r--r--llvm/test/Object/Inputs/invalid-e_shnum.elfbin64 -> 0 bytes
-rw-r--r--llvm/test/Object/invalid.test3
3 files changed, 1 insertions, 8 deletions
diff --git a/llvm/include/llvm/Object/ELF.h b/llvm/include/llvm/Object/ELF.h
index 03b172fe304..31f42f5f50c 100644
--- a/llvm/include/llvm/Object/ELF.h
+++ b/llvm/include/llvm/Object/ELF.h
@@ -319,12 +319,8 @@ ELFFile<ELFT>::ELFFile(StringRef Object, std::error_code &EC)
Header = reinterpret_cast<const Elf_Ehdr *>(base());
- if (Header->e_shoff == 0) {
- if (Header->e_shnum != 0)
- report_fatal_error(
- "e_shnum should be zero if a file has no section header table");
+ if (Header->e_shoff == 0)
return;
- }
const uint64_t SectionTableOffset = Header->e_shoff;
diff --git a/llvm/test/Object/Inputs/invalid-e_shnum.elf b/llvm/test/Object/Inputs/invalid-e_shnum.elf
deleted file mode 100644
index 0b46fbd8cec..00000000000
--- a/llvm/test/Object/Inputs/invalid-e_shnum.elf
+++ /dev/null
Binary files differ
diff --git a/llvm/test/Object/invalid.test b/llvm/test/Object/invalid.test
index c72de062059..d940789b6dc 100644
--- a/llvm/test/Object/invalid.test
+++ b/llvm/test/Object/invalid.test
@@ -55,9 +55,6 @@ INVALID-SYMTAB-SIZE: Invalid data was encountered while parsing the file
RUN: not llvm-readobj -t %p/Inputs/invalid-xindex-size.elf 2>&1 | FileCheck --check-prefix=INVALID-XINDEX-SIZE %s
INVALID-XINDEX-SIZE: Invalid data was encountered while parsing the file.
-RUN: not llvm-readobj -t %p/Inputs/invalid-e_shnum.elf 2>&1 | FileCheck --check-prefix=INVALID-SH-NUM %s
-INVALID-SH-NUM: e_shnum should be zero if a file has no section header table
-
RUN: not llvm-readobj -t %p/Inputs/invalid-ext-symtab-index.elf-x86-64 2>&1 | \
RUN: FileCheck --check-prefix=INVALID-EXT-SYMTAB-INDEX %s
INVALID-EXT-SYMTAB-INDEX: Invalid symbol table index
OpenPOWER on IntegriCloud