[lld] r335969 - [ELF] - EhFrame.cpp: cover personality encoding handling code with the test cases.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 29 05:19:35 PDT 2018


Author: grimar
Date: Fri Jun 29 05:19:35 2018
New Revision: 335969

URL: http://llvm.org/viewvc/llvm-project?rev=335969&view=rev
Log:
[ELF] - EhFrame.cpp: cover personality encoding handling code with the test cases.

CIEs augmentation string can have 'P' character,
what means the next byte is the personality encoding, a DW_EH_PE_xxx value.
This is followed by a pointer to the personality function.

We had the support of the different encodings earlier, but had no test cases.

This change adds coverage of DW_EH_PE_absptr/DW_EH_PE_signed/DW_EH_PE_udata2/DW_EH_PE_sdata2 and
DW_EH_PE_udata8/DW_EH_PE_sdata8 cases for place below:
https://github.com/llvm-mirror/lld/blob/master/ELF/EhFrame.cpp#L123

Added:
    lld/trunk/test/ELF/eh-frame-value-format1.s
    lld/trunk/test/ELF/eh-frame-value-format2.s
    lld/trunk/test/ELF/eh-frame-value-format3.s
    lld/trunk/test/ELF/eh-frame-value-format4.s
    lld/trunk/test/ELF/eh-frame-value-format5.s
    lld/trunk/test/ELF/eh-frame-value-format6.s

Added: lld/trunk/test/ELF/eh-frame-value-format1.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/eh-frame-value-format1.s?rev=335969&view=auto
==============================================================================
--- lld/trunk/test/ELF/eh-frame-value-format1.s (added)
+++ lld/trunk/test/ELF/eh-frame-value-format1.s Fri Jun 29 05:19:35 2018
@@ -0,0 +1,35 @@
+# REQUIRES: x86
+
+# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t
+# RUN: ld.lld --eh-frame-hdr %t -o %t2
+
+.section .eh_frame
+  .byte 0x14
+  .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 0x04 # DW_EH_PE_udata8
+  .byte 0xFF
+  .byte 0xFF
+  .byte 0xFF
+  .byte 0xFF
+  .byte 0xFF
+  .byte 0xFF
+  .byte 0xFF
+  .byte 0xFF
+  
+  .byte 0xFF

Added: lld/trunk/test/ELF/eh-frame-value-format2.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/eh-frame-value-format2.s?rev=335969&view=auto
==============================================================================
--- lld/trunk/test/ELF/eh-frame-value-format2.s (added)
+++ lld/trunk/test/ELF/eh-frame-value-format2.s Fri Jun 29 05:19:35 2018
@@ -0,0 +1,35 @@
+# REQUIRES: x86
+
+# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t
+# RUN: ld.lld --eh-frame-hdr %t -o %t2
+
+.section .eh_frame
+  .byte 0x14
+  .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 0x04 # DW_EH_PE_sdata8
+  .byte 0xFF
+  .byte 0xFF
+  .byte 0xFF
+  .byte 0xFF
+  .byte 0xFF
+  .byte 0xFF
+  .byte 0xFF
+  .byte 0xFF
+  
+  .byte 0xFF

Added: lld/trunk/test/ELF/eh-frame-value-format3.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/eh-frame-value-format3.s?rev=335969&view=auto
==============================================================================
--- lld/trunk/test/ELF/eh-frame-value-format3.s (added)
+++ lld/trunk/test/ELF/eh-frame-value-format3.s Fri Jun 29 05:19:35 2018
@@ -0,0 +1,28 @@
+# REQUIRES: x86
+
+# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t
+# RUN: ld.lld --eh-frame-hdr %t -o %t2
+
+.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 0x0A # DW_EH_PE_sdata2
+  .byte 0xFF
+  .byte 0xFF
+  .byte 0xFF

Added: lld/trunk/test/ELF/eh-frame-value-format4.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/eh-frame-value-format4.s?rev=335969&view=auto
==============================================================================
--- lld/trunk/test/ELF/eh-frame-value-format4.s (added)
+++ lld/trunk/test/ELF/eh-frame-value-format4.s Fri Jun 29 05:19:35 2018
@@ -0,0 +1,28 @@
+# REQUIRES: x86
+
+# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t
+# RUN: ld.lld --eh-frame-hdr %t -o %t2
+
+.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 0x02 # DW_EH_PE_udata2
+  .byte 0xFF
+  .byte 0xFF
+  .byte 0xFF

Added: lld/trunk/test/ELF/eh-frame-value-format5.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/eh-frame-value-format5.s?rev=335969&view=auto
==============================================================================
--- lld/trunk/test/ELF/eh-frame-value-format5.s (added)
+++ lld/trunk/test/ELF/eh-frame-value-format5.s Fri Jun 29 05:19:35 2018
@@ -0,0 +1,35 @@
+# REQUIRES: x86
+
+# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t
+# RUN: ld.lld --eh-frame-hdr %t -o %t2
+
+.section .eh_frame
+  .byte 0x14
+  .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 0x08 # DW_EH_PE_signed
+  .byte 0xFF
+  .byte 0xFF
+  .byte 0xFF
+  .byte 0xFF
+  .byte 0xFF
+  .byte 0xFF
+  .byte 0xFF
+  .byte 0xFF
+  
+  .byte 0xFF

Added: lld/trunk/test/ELF/eh-frame-value-format6.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/eh-frame-value-format6.s?rev=335969&view=auto
==============================================================================
--- lld/trunk/test/ELF/eh-frame-value-format6.s (added)
+++ lld/trunk/test/ELF/eh-frame-value-format6.s Fri Jun 29 05:19:35 2018
@@ -0,0 +1,35 @@
+# REQUIRES: x86
+
+# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t
+# RUN: ld.lld --eh-frame-hdr %t -o %t2
+
+.section .eh_frame
+  .byte 0x14
+  .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 0x08 # DW_EH_PE_signed
+  .byte 0xFF
+  .byte 0xFF
+  .byte 0xFF
+  .byte 0xFF
+  .byte 0xFF
+  .byte 0xFF
+  .byte 0xFF
+  .byte 0xFF
+  
+  .byte 0xFF




More information about the llvm-commits mailing list