[llvm] r241255 - Improve error message.
David Blaikie
dblaikie at gmail.com
Thu Jul 2 09:21:31 PDT 2015
On Thu, Jul 2, 2015 at 4:48 AM, Rafael Espindola <rafael.espindola at gmail.com
> wrote:
> Author: rafael
> Date: Thu Jul 2 06:48:48 2015
> New Revision: 241255
>
> URL: http://llvm.org/viewvc/llvm-project?rev=241255&view=rev
> Log:
> Improve error message.
>
> Thanks to Sean Silva for the suggestion.
>
> Modified:
> llvm/trunk/include/llvm/Object/ELF.h
> llvm/trunk/test/Object/invalid.test
>
> Modified: llvm/trunk/include/llvm/Object/ELF.h
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Object/ELF.h?rev=241255&r1=241254&r2=241255&view=diff
>
> ==============================================================================
> --- llvm/trunk/include/llvm/Object/ELF.h (original)
> +++ llvm/trunk/include/llvm/Object/ELF.h Thu Jul 2 06:48:48 2015
> @@ -765,7 +765,8 @@ uint64_t ELFFile<ELFT>::getSymbolIndex(c
> template <class ELFT>
> const typename ELFFile<ELFT>::Elf_Shdr *ELFFile<ELFT>::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");
>
Vaguely: Don't we need things in libObject to be non-fatal, since it's used
as a library in programs that might want to not crash/abort on failure, I
would imagine?
> return reinterpret_cast<const Elf_Shdr *>(base() + Header->e_shoff);
> }
>
>
> Modified: llvm/trunk/test/Object/invalid.test
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/invalid.test?rev=241255&r1=241254&r2=241255&view=diff
>
> ==============================================================================
> --- llvm/trunk/test/Object/invalid.test (original)
> +++ llvm/trunk/test/Object/invalid.test Thu Jul 2 06:48:48 2015
> @@ -43,4 +43,4 @@ RUN: not llvm-readobj -t %p/Inputs/inval
> 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
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150702/e429c343/attachment.html>
More information about the llvm-commits
mailing list