From e4e6f29c93d7c2fae4ade18818a734a1ace550a5 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Thu, 2 Jul 2015 11:48:48 +0000 Subject: [PATCH] Improve error message. Thanks to Sean Silva for the suggestion. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241255 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Object/ELF.h | 3 ++- test/Object/invalid.test | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/llvm/Object/ELF.h b/include/llvm/Object/ELF.h index c40586cffb9..06792e7a38c 100644 --- a/include/llvm/Object/ELF.h +++ b/include/llvm/Object/ELF.h @@ -765,7 +765,8 @@ uint64_t ELFFile::getSymbolIndex(const Elf_Sym *Sym) const { template const typename ELFFile::Elf_Shdr *ELFFile::section_begin() const { if (Header->e_shentsize != sizeof(Elf_Shdr)) - report_fatal_error("Invalid section header size"); + report_fatal_error( + "Invalid section header entry size (e_shentsize) in ELF header"); return reinterpret_cast(base() + Header->e_shoff); } diff --git a/test/Object/invalid.test b/test/Object/invalid.test index 2f42bde6dc6..1d5a70b3487 100644 --- a/test/Object/invalid.test +++ b/test/Object/invalid.test @@ -43,4 +43,4 @@ RUN: not llvm-readobj -t %p/Inputs/invalid-section-index.elf 2>&1 | FileCheck -- INVALID-SECTION-INDEX: Invalid section index RUN: not llvm-readobj -s %p/Inputs/invalid-section-size.elf 2>&1 | FileCheck --check-prefix=INVALID-SECTION-SIZE %s -INVALID-SECTION-SIZE: Invalid section header size +INVALID-SECTION-SIZE: Invalid section header entry size (e_shentsize) in ELF header -- 2.34.1