[lld] 0d52536 - [ELF][test] Consolidate .eh_frame FDE encoding tests

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 5 23:41:51 PST 2026


Author: Fangrui Song
Date: 2026-02-05T23:41:45-08:00
New Revision: 0d52536b048b1b5af0734d6de3f44ff5feb770b5

URL: https://github.com/llvm/llvm-project/commit/0d52536b048b1b5af0734d6de3f44ff5feb770b5
DIFF: https://github.com/llvm/llvm-project/commit/0d52536b048b1b5af0734d6de3f44ff5feb770b5.diff

LOG: [ELF][test] Consolidate .eh_frame FDE encoding tests

Merge eh-frame-value-format{1..9}.s into eh-frame-fde-encoding.s
(encoding is the DWARF term) using split-file. Add .eh_frame and
.eh_frame_hdr content verification for absptr, udata2, sdata4, udata4.
Move error test (9) to eh-frame-invalid-fde-encoding.s.

Added: 
    lld/test/ELF/eh-frame-fde-encoding.s

Modified: 
    lld/test/ELF/eh-frame-invalid-fde-encoding.s

Removed: 
    lld/test/ELF/eh-frame-value-format1.s
    lld/test/ELF/eh-frame-value-format2.s
    lld/test/ELF/eh-frame-value-format3.s
    lld/test/ELF/eh-frame-value-format4.s
    lld/test/ELF/eh-frame-value-format5.s
    lld/test/ELF/eh-frame-value-format6.s
    lld/test/ELF/eh-frame-value-format7.s
    lld/test/ELF/eh-frame-value-format8.s
    lld/test/ELF/eh-frame-value-format9.s


################################################################################
diff  --git a/lld/test/ELF/eh-frame-fde-encoding.s b/lld/test/ELF/eh-frame-fde-encoding.s
new file mode 100644
index 0000000000000..0a7943c8b2077
--- /dev/null
+++ b/lld/test/ELF/eh-frame-fde-encoding.s
@@ -0,0 +1,203 @@
+# REQUIRES: x86
+## Test that various DW_EH_PE_* encodings in CIE are accepted.
+
+# RUN: rm -rf %t && split-file %s %t && cd %t
+# RUN: llvm-mc -filetype=obj -triple=x86_64 absptr.s -o absptr.o
+# RUN: llvm-mc -filetype=obj -triple=x86_64 sdata2.s -o sdata2.o
+# RUN: llvm-mc -filetype=obj -triple=x86_64 sdata4.s -o sdata4.o
+# RUN: llvm-mc -filetype=obj -triple=x86_64 sdata8.s -o sdata8.o
+# RUN: llvm-mc -filetype=obj -triple=x86_64 signed.s -o signed.o
+# RUN: llvm-mc -filetype=obj -triple=x86_64 udata2.s -o udata2.o
+# RUN: llvm-mc -filetype=obj -triple=x86_64 udata4.s -o udata4.o
+# RUN: llvm-mc -filetype=obj -triple=x86_64 udata8.s -o udata8.o
+
+# RUN: ld.lld --eh-frame-hdr sdata2.o -o /dev/null
+# RUN: ld.lld --eh-frame-hdr sdata8.o -o /dev/null
+# RUN: ld.lld --eh-frame-hdr signed.o -o /dev/null
+
+# RUN: ld.lld --eh-frame-hdr --image-base=0 -Ttext=0x1000 absptr.o -o absptr
+# RUN: ld.lld --eh-frame-hdr --image-base=0 -Ttext=0x1000 udata2.o -o udata2
+# RUN: ld.lld --eh-frame-hdr --image-base=0 -Ttext=0x2000 sdata4.o -o sdata4
+# RUN: ld.lld --eh-frame-hdr --image-base=0 -Ttext=0x2000 udata4.o -o udata4
+
+## absptr/udata2: Also verify .eh_frame content to test relocation with addend.
+## .eh_frame_hdr initial_location: foo(0x1000)+0x234 - .eh_frame_hdr(0x2004) = 0xfffff230
+# RUN: llvm-readobj -x .eh_frame_hdr -x .eh_frame absptr | FileCheck %s --check-prefix=ABSPTR
+# ABSPTR:      Hex dump of section '.eh_frame_hdr':
+# ABSPTR-NEXT: 0x00002004 011b033b 10000000 01000000 30f2ffff
+# ABSPTR-NEXT: 0x00002014 24000000
+# ABSPTR:      Hex dump of section '.eh_frame':
+# ABSPTR-NEXT: 0x00002018 0c000000 00000000 01520001 010100ff
+# ABSPTR-NEXT: 0x00002028 0c000000 14000000 34120000 00000000
+##                        CIE offset--^     ^-- PC begin = 0x1234 (foo + 0x234)
+
+# RUN: llvm-readobj -x .eh_frame_hdr -x .eh_frame udata2 | FileCheck %s --check-prefix=UDATA2
+# UDATA2:      Hex dump of section '.eh_frame_hdr':
+# UDATA2-NEXT: 0x00002004 011b033b 10000000 01000000 30f2ffff
+# UDATA2-NEXT: 0x00002014 26000000
+# UDATA2:      Hex dump of section '.eh_frame':
+# UDATA2-NEXT: 0x00002018 0e000000 00000000 01525300 01010102
+# UDATA2-NEXT: 0x00002028 ff000600 00001600 00003412
+##                        CIE offset--^     ^-- PC begin = 0x1234 (foo + 0x234)
+
+# RUN: llvm-readelf -x .eh_frame_hdr sdata4 udata4 | FileCheck %s --check-prefix=HDR4
+# HDR4:      0x00003004 011b033b 10000000 01000000 fcefffff
+# HDR4-NEXT: 0x00003014 24000000
+# HDR4:      0x00003004 011b033b 10000000 01000000 fcefffff
+# HDR4-NEXT: 0x00003014 24000000
+
+#--- absptr.s
+## DW_EH_PE_absptr (0x00) with FDE for verification
+.text
+.globl foo
+foo:
+  nop
+
+.section .eh_frame,"a", at unwind
+  .long 12          # Size
+  .long 0x00        # ID (CIE)
+  .byte 0x01        # Version
+  .byte 0x52        # Augmentation string: 'R','\0'
+  .byte 0x00
+  .byte 0x01        # Code alignment
+  .byte 0x01        # Data alignment
+  .byte 0x01        # Return address register
+  .byte 0x00        # DW_EH_PE_absptr
+  .byte 0xFF
+
+  .long 12          # Size
+  .long 0x14        # CIE offset
+  .quad foo + 0x234 # PC begin
+
+#--- sdata2.s
+## DW_EH_PE_sdata2 (0x0A)
+.section .eh_frame,"a", at unwind
+  .long 0x0E        # Size
+  .long 0x00        # ID (CIE)
+  .byte 0x01        # Version
+  .byte 0x50        # Augmentation string: 'P','\0'
+  .byte 0x00
+  .byte 0x01        # Code alignment
+  .byte 0x01        # Data alignment (LEB128)
+  .byte 0x01        # Return address register (LEB128)
+  .byte 0x0A        # DW_EH_PE_sdata2
+  .short 0xFFFF
+  .byte 0xFF
+
+#--- sdata4.s
+## DW_EH_PE_sdata4 (0x0B) with FDE for verification
+.text
+.globl foo
+foo:
+  nop
+
+.section .eh_frame,"a", at unwind
+  .long 12          # Size
+  .long 0x00        # ID (CIE)
+  .byte 0x01        # Version
+  .byte 0x52        # Augmentation string: 'R','\0'
+  .byte 0x00
+  .byte 0x01        # Code alignment
+  .byte 0x01        # Data alignment
+  .byte 0x01        # Return address register
+  .byte 0x0B        # DW_EH_PE_sdata4
+  .byte 0xFF
+
+  .long 12          # Size
+  .long 0x14        # CIE offset
+  .long foo         # PC begin
+  .long 1           # PC range
+
+#--- sdata8.s
+## DW_EH_PE_sdata8 (0x0C)
+.section .eh_frame,"a", at unwind
+  .long 0x14        # Size
+  .long 0x00        # ID (CIE)
+  .byte 0x01        # Version
+  .byte 0x50        # Augmentation string: 'P','\0'
+  .byte 0x00
+  .byte 0x01        # Code alignment
+  .byte 0x01        # Data alignment (LEB128)
+  .byte 0x01        # Return address register (LEB128)
+  .byte 0x0C        # DW_EH_PE_sdata8
+  .quad 0xFFFFFFFFFFFFFFFF
+  .byte 0xFF
+
+#--- signed.s
+## DW_EH_PE_signed (0x08)
+.section .eh_frame,"a", at unwind
+  .long 0x14        # Size
+  .long 0x00        # ID (CIE)
+  .byte 0x01        # Version
+  .byte 0x50        # Augmentation string: 'P','\0'
+  .byte 0x00
+  .byte 0x01        # Code alignment
+  .byte 0x01        # Data alignment (LEB128)
+  .byte 0x01        # Return address register (LEB128)
+  .byte 0x08        # DW_EH_PE_signed
+  .quad 0xFFFFFFFFFFFFFFFF
+  .byte 0xFF
+
+#--- udata2.s
+## DW_EH_PE_udata2 (0x02) with FDE for verification
+.text
+.globl foo
+foo:
+  nop
+
+.section .eh_frame,"a", at unwind
+  .long 14          # Size
+  .long 0x00        # ID (CIE)
+  .byte 0x01        # Version
+  .byte 0x52        # Augmentation string: 'R','S','\0'
+  .byte 0x53
+  .byte 0x00
+  .byte 0x01        # Code alignment
+  .byte 0x01        # Data alignment
+  .byte 0x01        # Return address register
+  .byte 0x02        # DW_EH_PE_udata2
+  .byte 0xFF
+  .byte 0x00
+
+  .long 6           # Size
+  .long 0x16        # CIE offset
+  .short foo + 0x234  # PC begin
+
+#--- udata4.s
+## DW_EH_PE_udata4 (0x03) with FDE for verification
+.text
+.globl foo
+foo:
+  nop
+
+.section .eh_frame,"a", at unwind
+  .long 12          # Size
+  .long 0x00        # ID (CIE)
+  .byte 0x01        # Version
+  .byte 0x52        # Augmentation string: 'R','\0'
+  .byte 0x00
+  .byte 0x01        # Code alignment
+  .byte 0x01        # Data alignment
+  .byte 0x01        # Return address register
+  .byte 0x03        # DW_EH_PE_udata4
+  .byte 0xFF
+
+  .long 12          # Size
+  .long 0x14        # CIE offset
+  .long foo         # PC begin
+  .long 1           # PC range
+
+#--- udata8.s
+## DW_EH_PE_udata8 (0x04)
+.section .eh_frame,"a", at unwind
+  .long 0x14        # Size
+  .long 0x00        # ID (CIE)
+  .byte 0x01        # Version
+  .byte 0x50        # Augmentation string: 'P','\0'
+  .byte 0x00
+  .byte 0x01        # Code alignment
+  .byte 0x01        # Data alignment (LEB128)
+  .byte 0x01        # Return address register (LEB128)
+  .byte 0x04        # DW_EH_PE_udata8
+  .quad 0xFFFFFFFFFFFFFFFF
+  .byte 0xFF

diff  --git a/lld/test/ELF/eh-frame-invalid-fde-encoding.s b/lld/test/ELF/eh-frame-invalid-fde-encoding.s
index a4802d533ae70..9a463f95b5568 100644
--- a/lld/test/ELF/eh-frame-invalid-fde-encoding.s
+++ b/lld/test/ELF/eh-frame-invalid-fde-encoding.s
@@ -6,6 +6,7 @@
 # RUN: llvm-mc -filetype=obj -triple=x86_64 corrupted.s -o corrupted.o
 # RUN: llvm-mc -filetype=obj -triple=x86_64 unknown-fde-encoding.s -o unknown-fde-encoding.o
 # RUN: llvm-mc -filetype=obj -triple=x86_64 aligned-encoding.s -o aligned-encoding.o
+# RUN: llvm-mc -filetype=obj -triple=x86_64 unknown-size-encoding.s -o unknown-size-encoding.o
 
 # RUN: not ld.lld --eh-frame-hdr unknown-aug.o 2>&1 | FileCheck %s --check-prefix=UNKNOWN-AUG -DPREFIX=error --implicit-check-not=error:
 # RUN: ld.lld --eh-frame-hdr unknown-aug.o --noinhibit-exec 2>&1 | FileCheck %s --check-prefix=UNKNOWN-AUG -DPREFIX=warning
@@ -13,6 +14,7 @@
 # RUN: not ld.lld --eh-frame-hdr unknown-fde-encoding.o 2>&1 | FileCheck %s --check-prefix=UNKNOWN-FDE --implicit-check-not=error:
 # RUN: ld.lld --eh-frame-hdr unknown-fde-encoding.o --noinhibit-exec
 # RUN: not ld.lld --eh-frame-hdr aligned-encoding.o 2>&1 | FileCheck %s --check-prefix=ALIGNED --implicit-check-not=error:
+# RUN: not ld.lld --eh-frame-hdr unknown-size-encoding.o 2>&1 | FileCheck %s --check-prefix=UNKNOWN-SIZE --implicit-check-not=error:
 
 # UNKNOWN-AUG: [[PREFIX]]: corrupted .eh_frame: unknown .eh_frame augmentation string: {{.+}}
 
@@ -23,6 +25,8 @@
 
 # ALIGNED: error: corrupted .eh_frame: DW_EH_PE_aligned encoding is not supported
 
+# UNKNOWN-SIZE: error: unknown FDE size encoding
+
 #--- unknown-aug.s
 .section .eh_frame,"a", at unwind
   .byte 0x0E
@@ -120,3 +124,27 @@
   .byte 0x01
   .byte 0x01
   .byte 0x01
+
+#--- unknown-size-encoding.s
+.section .eh_frame,"a", at unwind
+  .long 12   # Size
+  .long 0x00 # ID
+  .byte 0x01 # Version.
+
+  .byte 0x52 # Augmentation string: 'R','\0'
+  .byte 0x00
+
+# Code and data alignment factors.
+  .byte 0x01 # LEB128
+  .byte 0x01 # LEB128
+
+# Return address register.
+  .byte 0x01 # LEB128
+
+  .byte 0xFE # 'R' value: invalid <0xFE>
+
+  .byte 0xFF
+
+  .long 12  # Size
+  .long 0x14 # ID
+  .quad .eh_frame

diff  --git a/lld/test/ELF/eh-frame-value-format1.s b/lld/test/ELF/eh-frame-value-format1.s
deleted file mode 100644
index da078eb79b425..0000000000000
--- a/lld/test/ELF/eh-frame-value-format1.s
+++ /dev/null
@@ -1,35 +0,0 @@
-# REQUIRES: x86
-
-# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t
-# RUN: ld.lld --eh-frame-hdr %t -o /dev/null
-
-.section .eh_frame,"a", at unwind
-  .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

diff  --git a/lld/test/ELF/eh-frame-value-format2.s b/lld/test/ELF/eh-frame-value-format2.s
deleted file mode 100644
index 1c907501ead31..0000000000000
--- a/lld/test/ELF/eh-frame-value-format2.s
+++ /dev/null
@@ -1,35 +0,0 @@
-# REQUIRES: x86
-
-# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t
-# RUN: ld.lld --eh-frame-hdr %t -o /dev/null
-
-.section .eh_frame,"a", at unwind
-  .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 0x0C # DW_EH_PE_sdata8
-  .byte 0xFF
-  .byte 0xFF
-  .byte 0xFF
-  .byte 0xFF
-  .byte 0xFF
-  .byte 0xFF
-  .byte 0xFF
-  .byte 0xFF
-  
-  .byte 0xFF

diff  --git a/lld/test/ELF/eh-frame-value-format3.s b/lld/test/ELF/eh-frame-value-format3.s
deleted file mode 100644
index 46e8db90ec18e..0000000000000
--- a/lld/test/ELF/eh-frame-value-format3.s
+++ /dev/null
@@ -1,28 +0,0 @@
-# REQUIRES: x86
-
-# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t
-# RUN: ld.lld --eh-frame-hdr %t -o /dev/null
-
-.section .eh_frame,"a", at unwind
-  .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

diff  --git a/lld/test/ELF/eh-frame-value-format4.s b/lld/test/ELF/eh-frame-value-format4.s
deleted file mode 100644
index e3e516d4eed25..0000000000000
--- a/lld/test/ELF/eh-frame-value-format4.s
+++ /dev/null
@@ -1,28 +0,0 @@
-# REQUIRES: x86
-
-# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t
-# RUN: ld.lld --eh-frame-hdr %t -o /dev/null
-
-.section .eh_frame,"a", at unwind
-  .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

diff  --git a/lld/test/ELF/eh-frame-value-format5.s b/lld/test/ELF/eh-frame-value-format5.s
deleted file mode 100644
index cfa23723ea296..0000000000000
--- a/lld/test/ELF/eh-frame-value-format5.s
+++ /dev/null
@@ -1,35 +0,0 @@
-# REQUIRES: x86
-
-# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t
-# RUN: ld.lld --eh-frame-hdr %t -o /dev/null
-
-.section .eh_frame,"a", at unwind
-  .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

diff  --git a/lld/test/ELF/eh-frame-value-format6.s b/lld/test/ELF/eh-frame-value-format6.s
deleted file mode 100644
index 23093b204c501..0000000000000
--- a/lld/test/ELF/eh-frame-value-format6.s
+++ /dev/null
@@ -1,35 +0,0 @@
-# REQUIRES: x86
-
-# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t
-# RUN: ld.lld --eh-frame-hdr %t -o /dev/null
-
-.section .eh_frame,"a", at unwind
-  .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 0x00 # DW_EH_PE_absptr
-  .byte 0xFF
-  .byte 0xFF
-  .byte 0xFF
-  .byte 0xFF
-  .byte 0xFF
-  .byte 0xFF
-  .byte 0xFF
-  .byte 0xFF
-  
-  .byte 0xFF

diff  --git a/lld/test/ELF/eh-frame-value-format7.s b/lld/test/ELF/eh-frame-value-format7.s
deleted file mode 100644
index 2291f90f7c04a..0000000000000
--- a/lld/test/ELF/eh-frame-value-format7.s
+++ /dev/null
@@ -1,77 +0,0 @@
-# REQUIRES: x86
-
-# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
-# RUN: ld.lld --eh-frame-hdr --image-base=0 -Ttext=0x1000 %t.o -o %t
-# RUN: llvm-readobj -S --section-data %t | FileCheck %s
-
-## Check we are able to handle DW_EH_PE_udata2 encoding.
-
-# CHECK:      Section {
-# CHECK:        Index:
-# CHECK:        Name: .eh_frame_hdr
-# CHECK-NEXT:   Type: SHT_PROGBITS
-# CHECK-NEXT:   Flags [
-# CHECK-NEXT:     SHF_ALLOC
-# CHECK-NEXT:   ]
-# CHECK-NEXT:   Address: 0x2004
-# CHECK-NEXT:   Offset: 0x1004
-# CHECK-NEXT:   Size: 20
-# CHECK-NEXT:   Link: 0
-# CHECK-NEXT:   Info: 0
-# CHECK-NEXT:   AddressAlignment: 4
-# CHECK-NEXT:   EntrySize: 0
-# CHECK-NEXT:   SectionData (
-# CHECK-NEXT:     0000: 011B033B 10000000 01000000 30F2FFFF
-# CHECK-NEXT:     0010: 26000000
-# Header (always 4 bytes): 011B033B
-#    10000000 = .eh_frame(0x2018) - .eh_frame_hdr(0x2004) - 4
-#    01000000 = 1 = the number of FDE pointers in the table.
-# 30F2FFFF = foo(0x1000) - 0x234(addend) - .eh_frame_hdr(0x2004)
-  
-# CHECK:      Section {
-# CHECK:        Index:
-# CHECK:        Name: .eh_frame
-# CHECK-NEXT:   Type: SHT_PROGBITS
-# CHECK-NEXT:   Flags [
-# CHECK-NEXT:     SHF_ALLOC
-# CHECK-NEXT:   ]
-# CHECK-NEXT:   Address: 0x2018
-# CHECK-NEXT:   Offset: 0x1018
-# CHECK-NEXT:   Size:
-# CHECK-NEXT:   Link:
-# CHECK-NEXT:   Info:
-# CHECK-NEXT:   AddressAlignment:
-# CHECK-NEXT:   EntrySize:
-# CHECK-NEXT:   SectionData (
-# CHECK-NEXT:     0000: 0E000000 00000000 01525300 01010102
-# CHECK-NEXT:     0010: FF000600 00001600 00003412 00000000
-#                                             ^
-#                       ---> ADDR(foo) + 0x234 = 0x1234
-
-.text
-.global foo
-foo:
- nop
-
-.section .eh_frame,"a", at unwind
-  .long 14   # Size
-  .long 0x00 # ID
-  .byte 0x01 # Version.
-  
-  .byte 0x52 # Augmentation string: 'R','S','\0'
-  .byte 0x53
-  .byte 0x00
-  
-  .byte 0x01
-  
-  .byte 0x01 # LEB128
-  .byte 0x01 # LEB128
-
-  .byte 0x02 # DW_EH_PE_udata2
-
-  .byte 0xFF
-  .byte 0
- 
-  .long 0x6  # Size
-  .long 0x16 # ID
-  .short foo + 0x234

diff  --git a/lld/test/ELF/eh-frame-value-format8.s b/lld/test/ELF/eh-frame-value-format8.s
deleted file mode 100644
index 6e053ad558138..0000000000000
--- a/lld/test/ELF/eh-frame-value-format8.s
+++ /dev/null
@@ -1,74 +0,0 @@
-# REQUIRES: x86
-
-# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
-# RUN: ld.lld --eh-frame-hdr --image-base=0 -Ttext=0x1000 %t.o -o %t
-# RUN: llvm-readobj -S --section-data %t | FileCheck %s
-
-## Check we are able to handle DW_EH_PE_absptr encoding.
-
-# CHECK:      Section {
-# CHECK:        Index:
-# CHECK:        Name: .eh_frame_hdr
-# CHECK-NEXT:   Type: SHT_PROGBITS
-# CHECK-NEXT:   Flags [
-# CHECK-NEXT:     SHF_ALLOC
-# CHECK-NEXT:   ]
-# CHECK-NEXT:   Address: 0x2004
-# CHECK-NEXT:   Offset: 0x1004
-# CHECK-NEXT:   Size: 20
-# CHECK-NEXT:   Link: 0
-# CHECK-NEXT:   Info: 0
-# CHECK-NEXT:   AddressAlignment: 4
-# CHECK-NEXT:   EntrySize: 0
-# CHECK-NEXT:   SectionData (
-# CHECK-NEXT:     0000: 011B033B 10000000 01000000 30F2FFFF
-# CHECK-NEXT:     0010: 24000000
-# Header (always 4 bytes): 011B033B
-#    10000000 = .eh_frame(0x2018) - .eh_frame_hdr(0x2004) - 4
-#    01000000 = 1 = the number of FDE pointers in the table.
-# 30F2FFFF = foo(0x1000) - 0x234(addend) - .eh_frame_hdr(0x2004)
-  
-# CHECK:      Section {
-# CHECK:        Index:
-# CHECK:        Name: .eh_frame
-# CHECK-NEXT:   Type: SHT_PROGBITS
-# CHECK-NEXT:   Flags [
-# CHECK-NEXT:     SHF_ALLOC
-# CHECK-NEXT:   ]
-# CHECK-NEXT:   Address: 0x2018
-# CHECK-NEXT:   Offset: 0x1018
-# CHECK-NEXT:   Size:
-# CHECK-NEXT:   Link:
-# CHECK-NEXT:   Info:
-# CHECK-NEXT:   AddressAlignment:
-# CHECK-NEXT:   EntrySize:
-# CHECK-NEXT:   SectionData (
-# CHECK-NEXT:     0000: 0C000000 00000000 01520001 010100FF
-# CHECK-NEXT:     0010: 0C000000 14000000 34120000 00000000
-#                                           ^
-#                                           ---> ADDR(foo) + 0x234 = 0x1234
-.text
-.global foo
-foo:
- nop
-
-.section .eh_frame,"a", at unwind
-  .long 12   # Size
-  .long 0x00 # ID
-  .byte 0x01 # Version.
-  
-  .byte 0x52 # Augmentation string: 'R','\0'
-  .byte 0x00
-  
-  .byte 0x01
-  
-  .byte 0x01 # LEB128
-  .byte 0x01 # LEB128
-
-  .byte 0x00 # DW_EH_PE_absptr
-
-  .byte 0xFF
- 
-  .long 12  # Size
-  .long 0x14 # ID
-  .quad foo + 0x234

diff  --git a/lld/test/ELF/eh-frame-value-format9.s b/lld/test/ELF/eh-frame-value-format9.s
deleted file mode 100644
index 1c5ca3bbafd7e..0000000000000
--- a/lld/test/ELF/eh-frame-value-format9.s
+++ /dev/null
@@ -1,28 +0,0 @@
-# REQUIRES: x86
-
-# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
-# RUN: not ld.lld --eh-frame-hdr %t.o -o /dev/null 2>&1 | FileCheck %s
-# CHECK: error: unknown FDE size encoding
-
-.section .eh_frame,"a", at unwind
-  .long 12   # Size
-  .long 0x00 # ID
-  .byte 0x01 # Version.
-  
-  .byte 0x52 # Augmentation string: 'R','\0'
-  .byte 0x00
-  
-# Code and data alignment factors.
-  .byte 0x01 # LEB128
-  .byte 0x01 # LEB128
-
-# Return address register.
-  .byte 0x01 # LEB128
-
-  .byte 0xFE # 'R' value: invalid <0xFE>
-
-  .byte 0xFF
-
-  .long 12  # Size
-  .long 0x14 # ID
-  .quad .eh_frame


        


More information about the llvm-commits mailing list