Change the error format to report corrupted .eh_frame.

llvm-svn: 299289
This commit is contained in:
Rui Ueyama 2017-04-01 01:42:20 +00:00
parent 49d70d0529
commit 3a965f7e68
5 changed files with 20 additions and 15 deletions

View File

@ -44,8 +44,8 @@ public:
private:
template <class P> void failOn(const P *Loc, const Twine &Msg) {
fatal(IS->getLocation<ELFT>((const uint8_t *)Loc - IS->Data.data()) + ": " +
Msg);
fatal("corrupted .eh_frame: " + Msg + "\n>>> defined in " +
IS->getObjMsg<ELFT>((const uint8_t *)Loc - IS->Data.data()));
}
uint8_t readByte();

View File

@ -3,7 +3,8 @@
// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t
// RUN: not ld.lld %t -o %t2 2>&1 | FileCheck %s
.section .eh_frame
.byte 0
.section .eh_frame
.byte 0
// CHECK: {{.*}}:(.eh_frame+0x0): CIE/FDE too small
// CHECK: error: corrupted .eh_frame: CIE/FDE too small
// CHECK-NEXT: >>> defined in {{.*}}:(.eh_frame+0x0)

View File

@ -3,7 +3,8 @@
// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t
// RUN: not ld.lld %t -o %t2 2>&1 | FileCheck %s
.section .eh_frame
.long 42
.section .eh_frame
.long 42
// CHECK: {{.*}}:(.eh_frame+0x0): CIE/FDE ends past the end of the section
// CHECK: error: corrupted .eh_frame: CIE/FDE ends past the end of the section
// CHECK-NEXT: >>> defined in {{.*}}:(.eh_frame+0x0)

View File

@ -3,7 +3,9 @@
// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t
// RUN: not ld.lld %t -o %t2 2>&1 | FileCheck %s
.section .eh_frame
.long 0xFFFFFFFC
.section .eh_frame
.long 0xFFFFFFFC
// CHECK: error: corrupted .eh_frame: CIE/FDE ends past the end of the section
// CHECK-NEXT: >>> defined in {{.*}}:(.eh_frame+0x0)
// CHECK: {{.*}}:(.eh_frame+0x0): CIE/FDE ends past the end of the section

View File

@ -3,8 +3,9 @@
// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t
// RUN: not ld.lld %t -o %t2 2>&1 | FileCheck %s
.section .eh_frame
.long 0xFFFFFFFF
.byte 0
.section .eh_frame
.long 0xFFFFFFFF
.byte 0
// CHECK: {{.*}}:(.eh_frame+0x0): CIE/FDE too large
// CHECK: error: corrupted .eh_frame: CIE/FDE too large
// CHECK-NEXT: >>> defined in {{.*}}:(.eh_frame+0x0)