[lld] r270706 - ELF: Handle empty CIE augmentation string

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Wed May 25 07:59:46 PDT 2016


The .test is actually an assembly file, so it should be a .s.

Please add a comment to it saying how the
test/ELF/Inputs/no-augmentation.o was created.

Cheers,
Rafael


On 25 May 2016 at 10:45, Ed Maste via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
> Author: emaste
> Date: Wed May 25 09:45:28 2016
> New Revision: 270706
>
> URL: http://llvm.org/viewvc/llvm-project?rev=270706&view=rev
> Log:
> ELF: Handle empty CIE augmentation string
>
> "A zero length string indicates that no augmentation data is present."
>
> The FreeBSD/mips toolchain (GCC 4.2.1) generates .debug_frame sections
> containing CIE records that have an empty augmentation string.
>
> Differential Revision: http://reviews.llvm.org/D19928
>
> Added:
>     lld/trunk/test/ELF/Inputs/no-augmentation.o   (with props)
>     lld/trunk/test/ELF/no-augmentation.test
> Modified:
>     lld/trunk/ELF/EhFrame.cpp
>
> Modified: lld/trunk/ELF/EhFrame.cpp
> URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/EhFrame.cpp?rev=270706&r1=270705&r2=270706&view=diff
> ==============================================================================
> --- lld/trunk/ELF/EhFrame.cpp (original)
> +++ lld/trunk/ELF/EhFrame.cpp Wed May 25 09:45:28 2016
> @@ -111,7 +111,7 @@ template <class ELFT> uint8_t getFdeEnco
>    if (Version != 1 && Version != 3)
>      fatal("FDE version 1 or 3 expected, but got " + Twine((unsigned)Version));
>
> -  const unsigned char *AugEnd = std::find(D.begin() + 1, D.end(), '\0');
> +  const unsigned char *AugEnd = std::find(D.begin(), D.end(), '\0');
>    if (AugEnd == D.end())
>      fatal("corrupted CIE");
>    StringRef Aug(reinterpret_cast<const char *>(D.begin()), AugEnd - D.begin());
>
> Added: lld/trunk/test/ELF/Inputs/no-augmentation.o
> URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/Inputs/no-augmentation.o?rev=270706&view=auto
> ==============================================================================
> Binary file - no diff available.
>
> Propchange: lld/trunk/test/ELF/Inputs/no-augmentation.o
> ------------------------------------------------------------------------------
>     svn:mime-type = application/x-object
>
> Added: lld/trunk/test/ELF/no-augmentation.test
> URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/no-augmentation.test?rev=270706&view=auto
> ==============================================================================
> --- lld/trunk/test/ELF/no-augmentation.test (added)
> +++ lld/trunk/test/ELF/no-augmentation.test Wed May 25 09:45:28 2016
> @@ -0,0 +1,10 @@
> +// RUN: llvm-mc -filetype=obj -triple=mips64-unknown-freebsd %s -o %t.o
> +// RUN: ld.lld --eh-frame-hdr %t.o %p/Inputs/no-augmentation.o -o %t \
> +// RUN:   | FileCheck -allow-empty %s
> +
> +// REQUIRES: mips
> +
> +// CHECK-NOT: corrupted or unsupported CIE information
> +
> +.global __start
> +__start:
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits


More information about the llvm-commits mailing list