[lld] r335852 - [ELF] - EhFrame.cpp: add test case to cover "corrupted CIE" error message.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 28 06:24:39 PDT 2018


Author: grimar
Date: Thu Jun 28 06:24:39 2018
New Revision: 335852

URL: http://llvm.org/viewvc/llvm-project?rev=335852&view=rev
Log:
[ELF] - EhFrame.cpp: add test case to cover "corrupted CIE" error message.

This is to test the following line that was uncovered by LLD test cases yet:
https://github.com/llvm-mirror/lld/blob/master/ELF/EhFrame.cpp#L149


Added:
    lld/trunk/test/ELF/invalid-eh-frame8.s

Added: lld/trunk/test/ELF/invalid-eh-frame8.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/invalid-eh-frame8.s?rev=335852&view=auto
==============================================================================
--- lld/trunk/test/ELF/invalid-eh-frame8.s (added)
+++ lld/trunk/test/ELF/invalid-eh-frame8.s Thu Jun 28 06:24:39 2018
@@ -0,0 +1,30 @@
+# REQUIRES: x86
+
+# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t
+# RUN: not ld.lld --eh-frame-hdr %t -o %t2 2>&1 | FileCheck %s
+
+# CHECK: error: corrupted .eh_frame: corrupted CIE
+
+.section .eh_frame
+  .byte 0x0E
+  .byte 0x00
+  .byte 0x00
+  .byte 0x00
+  .byte 0x00
+  .byte 0x00
+  .byte 0x00
+  .byte 0x00
+  .byte 0x01
+  
+  .byte 0x50 # Augmentation string: 'P','\0'
+  .byte 0x00
+  
+  .byte 0x01
+  
+  .byte 0x01 # LEB128
+  .byte 0x01 # LEB128
+
+  .byte 0x03
+  .byte 0x01
+  .byte 0x01
+  .byte 0x01




More information about the llvm-commits mailing list