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();
// 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)
// 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)
// 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
// 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)