Index: lld/trunk/ELF/EhFrame.cpp =================================================================== --- lld/trunk/ELF/EhFrame.cpp +++ lld/trunk/ELF/EhFrame.cpp @@ -111,7 +111,7 @@ 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(D.begin()), AugEnd - D.begin()); Index: lld/trunk/test/ELF/no-augmentation.test =================================================================== --- lld/trunk/test/ELF/no-augmentation.test +++ lld/trunk/test/ELF/no-augmentation.test @@ -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: