aboutsummaryrefslogtreecommitdiff
path: root/llvm/test/tools/llvm-readobj
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/tools/llvm-readobj')
-rw-r--r--llvm/test/tools/llvm-readobj/COFF/Inputs/has-cet.exebin94720 -> 0 bytes
-rw-r--r--llvm/test/tools/llvm-readobj/COFF/Inputs/has-exdllcharacteristics.exebin0 -> 5120 bytes
-rw-r--r--llvm/test/tools/llvm-readobj/COFF/cetcompat.test16
-rw-r--r--llvm/test/tools/llvm-readobj/COFF/exdllcharacteristics.test22
-rw-r--r--llvm/test/tools/llvm-readobj/ELF/sframe-fde.test237
-rw-r--r--llvm/test/tools/llvm-readobj/ELF/sframe-header.test191
6 files changed, 450 insertions, 16 deletions
diff --git a/llvm/test/tools/llvm-readobj/COFF/Inputs/has-cet.exe b/llvm/test/tools/llvm-readobj/COFF/Inputs/has-cet.exe
deleted file mode 100644
index c77060d..0000000
--- a/llvm/test/tools/llvm-readobj/COFF/Inputs/has-cet.exe
+++ /dev/null
Binary files differ
diff --git a/llvm/test/tools/llvm-readobj/COFF/Inputs/has-exdllcharacteristics.exe b/llvm/test/tools/llvm-readobj/COFF/Inputs/has-exdllcharacteristics.exe
new file mode 100644
index 0000000..9c36817
--- /dev/null
+++ b/llvm/test/tools/llvm-readobj/COFF/Inputs/has-exdllcharacteristics.exe
Binary files differ
diff --git a/llvm/test/tools/llvm-readobj/COFF/cetcompat.test b/llvm/test/tools/llvm-readobj/COFF/cetcompat.test
deleted file mode 100644
index a973b5c..0000000
--- a/llvm/test/tools/llvm-readobj/COFF/cetcompat.test
+++ /dev/null
@@ -1,16 +0,0 @@
-# To regenerate has-cet.exe
-# $ echo int main() { return 0; } > has-cet.c
-# $ cl has-cet.c /link /cetcompat
-RUN: llvm-readobj --coff-debug-directory %p/Inputs/has-cet.exe | FileCheck %s
-
-CHECK: DebugEntry {
-CHECK: Characteristics: 0x0
-CHECK: Type: ExtendedDLLCharacteristics (0x14)
-CHECK: ExtendedCharacteristics [ (0x1)
-CHECK: IMAGE_DLL_CHARACTERISTICS_EX_CET_COMPAT (0x1)
-CHECK: ]
-CHECK: RawData (
-CHECK: 0000: 01000000 |....|
-CHECK: )
-CHECK: }
-
diff --git a/llvm/test/tools/llvm-readobj/COFF/exdllcharacteristics.test b/llvm/test/tools/llvm-readobj/COFF/exdllcharacteristics.test
new file mode 100644
index 0000000..ef35aea
--- /dev/null
+++ b/llvm/test/tools/llvm-readobj/COFF/exdllcharacteristics.test
@@ -0,0 +1,22 @@
+# To regenerate has-exdllcharacteristics.exe
+# $ echo int main() { return 0; } > has-exdllcharacteristics.c
+# To make minimum possible stub file (to decrease the binary size)
+# $ echo -n '4D5A00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' | xxd -r -p > stub
+# $ cl has-exdllcharacteristics.c /link /entry:main /STUB:stub /NOCOFFGRPINFO /EMITTOOLVERSIONINFO:NO /EMITPOGOPHASEINFO /NOVCFEATURE /MANIFEST:NO /cetcompat /cetcompatstrict /cetdynamicapisinproc /cetipvalidationrelaxed /hotpatchcompatible /functionpadmin:6
+RUN: llvm-readobj --coff-debug-directory %p/Inputs/has-exdllcharacteristics.exe | FileCheck %s
+
+CHECK: DebugEntry {
+CHECK: Characteristics: 0x0
+CHECK: Type: ExtendedDLLCharacteristics (0x14)
+CHECK: ExtendedCharacteristics [ (0x8F)
+CHECK-DAG: IMAGE_DLL_CHARACTERISTICS_EX_CET_COMPAT (0x1)
+CHECK-DAG: IMAGE_DLL_CHARACTERISTICS_EX_CET_COMPAT_STRICT_MODE (0x2)
+CHECK-DAG: IMAGE_DLL_CHARACTERISTICS_EX_CET_SET_CONTEXT_IP_VALIDATION_RELAXED_MODE (0x4)
+CHECK-DAG: IMAGE_DLL_CHARACTERISTICS_EX_CET_DYNAMIC_APIS_ALLOW_IN_PROC_ONLY (0x8)
+CHECK-DAG: IMAGE_DLL_CHARACTERISTICS_EX_HOTPATCH_COMPATIBLE (0x80)
+CHECK: ]
+CHECK: RawData (
+CHECK: 0000: 8F000000 |....|
+CHECK: )
+CHECK: }
+
diff --git a/llvm/test/tools/llvm-readobj/ELF/sframe-fde.test b/llvm/test/tools/llvm-readobj/ELF/sframe-fde.test
new file mode 100644
index 0000000..dee4018
--- /dev/null
+++ b/llvm/test/tools/llvm-readobj/ELF/sframe-fde.test
@@ -0,0 +1,237 @@
+## Check parsing and dumping of SFrame Function Descriptor Entries.
+# RUN: yaml2obj --docnum=1 %s -o %t.1
+# RUN: llvm-readobj --sframe=.sframe_short --sframe=.sframe_section_relative \
+# RUN: --sframe=.sframe_fde_relative %t.1 2>&1 | \
+# RUN: FileCheck %s --strict-whitespace --match-full-lines \
+# RUN: -DFILE=%t.1 --check-prefix=CASE1
+
+## Check big-endian support.
+# RUN: yaml2obj --docnum=2 %s -o %t.2
+# RUN: llvm-readobj --sframe %t.2 2>&1 | \
+# RUN: FileCheck %s --strict-whitespace --match-full-lines \
+# RUN: -DFILE=%t.2 --check-prefix=CASE2
+
+--- !ELF
+FileHeader:
+ Class: ELFCLASS64
+ Data: ELFDATA2LSB
+ Type: ET_EXEC
+Sections:
+ - Name: .sframe_short
+ Type: SHT_GNU_SFRAME
+ Flags: [ SHF_ALLOC ]
+ ContentArray: [
+ 0xe2, 0xde, 0x02, 0x00, # Preamble (magic, version, flags)
+ # Header:
+ 0x03, 0x42, 0x47, 0x04, # ABI, Fixed FP offset, Fixed RA Offset, AUX header length
+ 0x01, 0x00, 0x00, 0x00, # Number of FDEs
+ 0x10, 0x00, 0x00, 0x00, # Number of FREs
+ 0x00, 0x10, 0x00, 0x00, # FRE length
+ 0x00, 0x00, 0x00, 0x00, # FDE offset
+ 0x00, 0x01, 0x00, 0x00, # FRE offset
+ 0xde, 0xad, 0xbe, 0xef, # AUX header
+ 0x01, 0x02, 0x03, 0x04, # Short FDE
+ ]
+# CASE1-LABEL:SFrame section '.sframe_short' {
+# CASE1: Header {
+# CASE1-NEXT: Magic: 0xDEE2
+# CASE1-NEXT: Version: V2 (0x2)
+# CASE1-NEXT: Flags [ (0x0)
+# CASE1-NEXT: ]
+# CASE1-NEXT: ABI: AMD64EndianLittle (0x3)
+# CASE1-NEXT: CFA fixed FP offset (unused): 66
+# CASE1-NEXT: CFA fixed RA offset: 71
+# CASE1-NEXT: Auxiliary header length: 4
+# CASE1-NEXT: Num FDEs: 1
+# CASE1-NEXT: Num FREs: 16
+# CASE1-NEXT: FRE subsection length: 4096
+# CASE1-NEXT: FDE subsection offset: 0
+# CASE1-NEXT: FRE subsection offset: 256
+# CASE1-NEXT: Auxiliary header: [0xDE, 0xAD, 0xBE, 0xEF]
+# CASE1-NEXT: }
+# CASE1-NEXT:{{.*}}: warning: '[[FILE]]': unexpected end of data at offset 0x24 while reading [0x20, 0x34)
+# CASE1-NEXT:}
+
+ - Name: .sframe_section_relative
+ Type: SHT_GNU_SFRAME
+ Flags: [ SHF_ALLOC ]
+ ContentArray: [
+ 0xe2, 0xde, 0x02, 0x00, # Preamble (magic, version, flags)
+ # Header:
+ 0x03, 0x42, 0x47, 0x00, # ABI, Fixed FP offset, Fixed RA Offset, AUX header length
+ 0x01, 0x00, 0x00, 0x00, # Number of FDEs
+ 0x10, 0x00, 0x00, 0x00, # Number of FREs
+ 0x00, 0x10, 0x00, 0x00, # FRE length
+ 0x04, 0x00, 0x00, 0x00, # FDE offset
+ 0x00, 0x01, 0x00, 0x00, # FRE offset
+
+ 0xff, 0xff, 0xff, 0xff, # Unused data skipped due to the FDE offset field
+
+ # FDE:
+ 0x00, 0xde, 0xad, 0x00, # Start Address
+ 0xbe, 0x01, 0x00, 0x00, # Size
+ 0x10, 0x00, 0x00, 0x00, # Start FRE Offset
+ 0x00, 0x00, 0x00, 0x00, # Number of FREs
+ 0x31, 0xde, 0xad, 0x00, # Info, RepSize, Padding2
+ ]
+## Also testing:
+## - dead space between the header and the FDE subsection.
+## - PCMask FDE types
+## - unused PAuth key handling
+# CASE1-LABEL:SFrame section '.sframe_section_relative' {
+# CASE1: Header {
+# CASE1-NEXT: Magic: 0xDEE2
+# CASE1-NEXT: Version: V2 (0x2)
+# CASE1-NEXT: Flags [ (0x0)
+# CASE1-NEXT: ]
+# CASE1-NEXT: ABI: AMD64EndianLittle (0x3)
+# CASE1-NEXT: CFA fixed FP offset (unused): 66
+# CASE1-NEXT: CFA fixed RA offset: 71
+# CASE1-NEXT: Auxiliary header length: 0
+# CASE1-NEXT: Num FDEs: 1
+# CASE1-NEXT: Num FREs: 16
+# CASE1-NEXT: FRE subsection length: 4096
+# CASE1-NEXT: FDE subsection offset: 4
+# CASE1-NEXT: FRE subsection offset: 256
+# CASE1-NEXT: Auxiliary header: []
+# CASE1-NEXT: }
+# CASE1-NEXT: Function Index [
+# CASE1-NEXT: FuncDescEntry [0] {
+# CASE1-NEXT: PC: 0xADDE24
+# CASE1-NEXT: Size: 0x1BE
+# CASE1-NEXT: Start FRE Offset: 0x10
+# CASE1-NEXT: Num FREs: 0
+# CASE1-NEXT: Info {
+# CASE1-NEXT: FRE Type: Addr2 (0x1)
+# CASE1-NEXT: FDE Type: PCMask (0x1)
+# CASE1-NEXT: Raw: 0x31
+# CASE1-NEXT: }
+# CASE1-NEXT: Repetitive block size: 0xDE
+# CASE1-NEXT: Padding2: 0xAD
+# CASE1-NEXT: }
+# CASE1-NEXT: ]
+# CASE1-NEXT:}
+
+ - Name: .sframe_fde_relative
+ Type: SHT_GNU_SFRAME
+ Flags: [ SHF_ALLOC ]
+ ContentArray: [
+ 0xe2, 0xde, 0x02, 0x04, # Preamble (magic, version, flags)
+ # Header:
+ 0x02, 0x42, 0x47, 0x00, # ABI, Fixed FP offset, Fixed RA Offset, AUX header length
+ 0x01, 0x00, 0x00, 0x00, # Number of FDEs
+ 0x10, 0x00, 0x00, 0x00, # Number of FREs
+ 0x00, 0x10, 0x00, 0x00, # FRE length
+ 0x04, 0x00, 0x00, 0x00, # FDE offset
+ 0x00, 0x01, 0x00, 0x00, # FRE offset
+
+ 0xff, 0xff, 0xff, 0xff, # Unused data skipped due to the FDE offset field
+
+ # FDE:
+ 0x00, 0xde, 0xad, 0x00, # Start Address
+ 0xbe, 0x01, 0x00, 0x00, # Size
+ 0x10, 0x00, 0x00, 0x00, # Start FRE Offset
+ 0x00, 0x00, 0x00, 0x00, # Number of FREs
+ 0x02, 0xde, 0xad, 0x00, # Info, RepSize, Padding2
+ ]
+## Also testing:
+## - PCInc FDE type
+## - AArch64 PAuth key handling
+# CASE1-LABEL:SFrame section '.sframe_fde_relative' {
+# CASE1: Header {
+# CASE1-NEXT: Magic: 0xDEE2
+# CASE1-NEXT: Version: V2 (0x2)
+# CASE1-NEXT: Flags [ (0x4)
+# CASE1-NEXT: FDEFuncStartPCRel (0x4){{ *}}
+# CASE1-NEXT: ]
+# CASE1-NEXT: ABI: AArch64EndianLittle (0x2)
+# CASE1-NEXT: CFA fixed FP offset (unused): 66
+# CASE1-NEXT: CFA fixed RA offset (unused): 71
+# CASE1-NEXT: Auxiliary header length: 0
+# CASE1-NEXT: Num FDEs: 1
+# CASE1-NEXT: Num FREs: 16
+# CASE1-NEXT: FRE subsection length: 4096
+# CASE1-NEXT: FDE subsection offset: 4
+# CASE1-NEXT: FRE subsection offset: 256
+# CASE1-NEXT: Auxiliary header: []
+# CASE1-NEXT: }
+# CASE1-NEXT: Function Index [
+# CASE1-NEXT: FuncDescEntry [0] {
+# CASE1-NEXT: PC: 0xADDE78
+# CASE1-NEXT: Size: 0x1BE
+# CASE1-NEXT: Start FRE Offset: 0x10
+# CASE1-NEXT: Num FREs: 0
+# CASE1-NEXT: Info {
+# CASE1-NEXT: FRE Type: Addr4 (0x2)
+# CASE1-NEXT: FDE Type: PCInc (0x0)
+# CASE1-NEXT: PAuth Key: A (0x0)
+# CASE1-NEXT: Raw: 0x2
+# CASE1-NEXT: }
+# CASE1-NEXT: Repetitive block size (unused): 0xDE
+# CASE1-NEXT: Padding2: 0xAD
+# CASE1-NEXT: }
+# CASE1-NEXT: ]
+# CASE1-NEXT:}
+
+--- !ELF
+FileHeader:
+ Class: ELFCLASS64
+ Data: ELFDATA2MSB
+ Type: ET_EXEC
+Sections:
+ - Name: .sframe
+ Type: SHT_GNU_SFRAME
+ Flags: [ SHF_ALLOC ]
+ ContentArray: [
+ 0xde, 0xe2, 0x02, 0x05, # Preamble (magic, version, flags)
+ # Header:
+ 0x01, 0x42, 0x47, 0x00, # ABI, Fixed FP offset, Fixed RA Offset, AUX header length
+ 0x00, 0x00, 0x00, 0x01, # Number of FDEs
+ 0x00, 0x00, 0x00, 0x10, # Number of FREs
+ 0x00, 0x00, 0x10, 0x00, # FRE length
+ 0x00, 0x00, 0x00, 0x00, # FDE offset
+ 0x00, 0x00, 0x01, 0x00, # FRE offset
+
+ # FDE:
+ 0x00, 0xde, 0xad, 0x00, # Start Address
+ 0x00, 0x00, 0x01, 0xbe, # Size
+ 0x00, 0x00, 0x00, 0x10, # Start FRE Offset
+ 0x00, 0x00, 0x00, 0x10, # Number of FREs
+ 0x02, 0xde, 0xad, 0x00, # Info, RepSize, Padding2
+ ]
+# CASE2-LABEL:SFrame section '.sframe' {
+# CASE2: Header {
+# CASE2-NEXT: Magic: 0xDEE2
+# CASE2-NEXT: Version: V2 (0x2)
+# CASE2-NEXT: Flags [ (0x5)
+# CASE2-NEXT: FDEFuncStartPCRel (0x4){{ *}}
+# CASE2-NEXT: FDESorted (0x1){{ *}}
+# CASE2-NEXT: ]
+# CASE2-NEXT: ABI: AArch64EndianBig (0x1)
+# CASE2-NEXT: CFA fixed FP offset (unused): 66
+# CASE2-NEXT: CFA fixed RA offset (unused): 71
+# CASE2-NEXT: Auxiliary header length: 0
+# CASE2-NEXT: Num FDEs: 1
+# CASE2-NEXT: Num FREs: 16
+# CASE2-NEXT: FRE subsection length: 4096
+# CASE2-NEXT: FDE subsection offset: 0
+# CASE2-NEXT: FRE subsection offset: 256
+# CASE2-NEXT: Auxiliary header: []
+# CASE2-NEXT: }
+# CASE2-NEXT: Function Index [
+# CASE2-NEXT: FuncDescEntry [0] {
+# CASE2-NEXT: PC: 0xDEAD1C
+# CASE2-NEXT: Size: 0x1BE
+# CASE2-NEXT: Start FRE Offset: 0x10
+# CASE2-NEXT: Num FREs: 16
+# CASE2-NEXT: Info {
+# CASE2-NEXT: FRE Type: Addr4 (0x2)
+# CASE2-NEXT: FDE Type: PCInc (0x0)
+# CASE2-NEXT: PAuth Key: A (0x0)
+# CASE2-NEXT: Raw: 0x2
+# CASE2-NEXT: }
+# CASE2-NEXT: Repetitive block size (unused): 0xDE
+# CASE2-NEXT: Padding2: 0xAD00
+# CASE2-NEXT: }
+# CASE2-NEXT: ]
+# CASE2-NEXT:}
diff --git a/llvm/test/tools/llvm-readobj/ELF/sframe-header.test b/llvm/test/tools/llvm-readobj/ELF/sframe-header.test
new file mode 100644
index 0000000..e7c0db0
--- /dev/null
+++ b/llvm/test/tools/llvm-readobj/ELF/sframe-header.test
@@ -0,0 +1,191 @@
+## Check parsing and dumping of the SFrame header.
+# RUN: yaml2obj --docnum=1 %s -o %t.1
+# RUN: llvm-readobj --sframe=.sframe_bad_sh_size --sframe=.sframe_1b \
+# RUN: --sframe=.sframe_bad_magic --sframe=.sframe_bad_version \
+# RUN: --sframe=.sframe_6b --sframe=.sframe_short_auxheader \
+# RUN: --sframe=.sframe_header %t.1 2>&1 | \
+# RUN: FileCheck %s --strict-whitespace --match-full-lines \
+# RUN: -DFILE=%t.1 --check-prefix=CASE1
+
+## Check big-endian support and the handling of --sframe argument default.
+# RUN: yaml2obj --docnum=2 %s -o %t.2
+# RUN: llvm-readobj --sframe %t.2 2>&1 | \
+# RUN: FileCheck %s --strict-whitespace --match-full-lines \
+# RUN: -DFILE=%t.2 --check-prefix=CASE2
+
+## Check handling of corrupted elf files (bad sh_name)
+# RUN: yaml2obj --docnum=3 %s -o %t.3
+# RUN: not llvm-readobj --sframe %t.3 2>&1 | \
+# RUN: FileCheck %s --strict-whitespace --match-full-lines \
+# RUN: -DFILE=%t.3 --check-prefix=CASE3
+
+--- !ELF
+FileHeader:
+ Class: ELFCLASS64
+ Data: ELFDATA2LSB
+ Type: ET_EXEC
+Sections:
+ - Name: .sframe_bad_sh_size
+ Type: SHT_GNU_SFRAME
+ Flags: [ SHF_ALLOC ]
+ ShSize: 0xfffff
+# CASE1-LABEL:SFrame section '.sframe_bad_sh_size' {
+# CASE1:{{.*}}: warning: '[[FILE]]': The end of the file was unexpectedly encountered
+ - Name: .sframe_1b
+ Type: SHT_GNU_SFRAME
+ Flags: [ SHF_ALLOC ]
+ ContentArray: [ 0x00 ]
+# CASE1-LABEL:SFrame section '.sframe_1b' {
+# CASE1:{{.*}}: warning: '[[FILE]]': invalid sframe section: unexpected end of data at offset 0x1 while reading [0x0, 0x4)
+
+ - Name: .sframe_bad_magic
+ Type: SHT_GNU_SFRAME
+ Flags: [ SHF_ALLOC ]
+ ContentArray: [ 0xde, 0xad, 0xbe, 0xef]
+# CASE1-LABEL:SFrame section '.sframe_bad_magic' {
+# CASE1:{{.*}}: warning: '[[FILE]]': invalid sframe section: invalid magic number (0xadde)
+
+ - Name: .sframe_bad_version
+ Type: SHT_GNU_SFRAME
+ Flags: [ SHF_ALLOC ]
+ ContentArray: [
+ 0xe2, 0xde, 0x01, 0x00 # Preamble (magic, version, flags)
+ ]
+# CASE1-LABEL:SFrame section '.sframe_bad_version' {
+# CASE1:{{.*}}: warning: '[[FILE]]': invalid sframe section: invalid/unsupported version number (1)
+
+ - Name: .sframe_6b
+ Type: SHT_GNU_SFRAME
+ Flags: [ SHF_ALLOC ]
+ ContentArray: [
+ 0xe2, 0xde, 0x02, 0x00, # Preamble (magic, version, flags)
+ 0x01, 0x02
+ ]
+# CASE1-LABEL:SFrame section '.sframe_6b' {
+# CASE1:{{.*}}: warning: '[[FILE]]': invalid sframe section: unexpected end of data at offset 0x6 while reading [0x0, 0x1c)
+
+ - Name: .sframe_short_auxheader
+ Type: SHT_GNU_SFRAME
+ Flags: [ SHF_ALLOC ]
+ ContentArray: [
+ 0xe2, 0xde, 0x02, 0x06, # Preamble (magic, version, flags)
+ # Header:
+ 0x03, 0x42, 0x47, 0x08, # ABI, Fixed FP offset, Fixed RA Offset, AUX header length
+ 0x01, 0x00, 0x00, 0x00, # Number of FDEs
+ 0x10, 0x00, 0x00, 0x00, # Number of FREs
+ 0x00, 0x10, 0x00, 0x00, # FRE length
+ 0x00, 0x00, 0x00, 0x00, # FDE offset
+ 0x00, 0x01, 0x00, 0x00, # FRE offset
+ 0xde, 0xad, 0xbe, 0xef, # AUX header
+ ]
+# CASE1-LABEL:SFrame section '.sframe_short_auxheader' {
+# CASE1: Header {
+# CASE1-NEXT: Magic: 0xDEE2
+# CASE1-NEXT: Version: V2 (0x2)
+# CASE1-NEXT: Flags [ (0x6)
+# CASE1-NEXT: FDEFuncStartPCRel (0x4){{ *}}
+# CASE1-NEXT: FramePointer (0x2){{ *}}
+# CASE1-NEXT: ]
+# CASE1-NEXT: ABI: AMD64EndianLittle (0x3)
+# CASE1-NEXT: CFA fixed FP offset (unused): 66
+# CASE1-NEXT: CFA fixed RA offset: 71
+# CASE1-NEXT: Auxiliary header length: 8
+# CASE1-NEXT: Num FDEs: 1
+# CASE1-NEXT: Num FREs: 16
+# CASE1-NEXT: FRE subsection length: 4096
+# CASE1-NEXT: FDE subsection offset: 0
+# CASE1-NEXT: FRE subsection offset: 256
+# CASE1-NEXT:{{.*}}: warning: '[[FILE]]': unexpected end of data at offset 0x20 while reading [0x1c, 0x24)
+# CASE1-NEXT: }
+# CASE1-NEXT:{{.*}}: warning: '[[FILE]]': unexpected end of data at offset 0x20 while reading [0x24, 0x38)
+# CASE1-NEXT:}
+
+ - Name: .sframe_header
+ Type: SHT_GNU_SFRAME
+ Flags: [ SHF_ALLOC ]
+ ContentArray: [
+ 0xe2, 0xde, 0x02, 0x06, # Preamble (magic, version, flags)
+ # Header:
+ 0x03, 0x42, 0x47, 0x04, # ABI, Fixed FP offset, Fixed RA Offset, AUX header length
+ 0x00, 0x00, 0x00, 0x00, # Number of FDEs
+ 0x10, 0x00, 0x00, 0x00, # Number of FREs
+ 0x00, 0x10, 0x00, 0x00, # FRE length
+ 0x00, 0x00, 0x00, 0x00, # FDE offset
+ 0x00, 0x01, 0x00, 0x00, # FRE offset
+ 0xde, 0xad, 0xbe, 0xef, # AUX header
+ ]
+# CASE1-LABEL:SFrame section '.sframe_header' {
+# CASE1: Header {
+# CASE1-NEXT: Magic: 0xDEE2
+# CASE1-NEXT: Version: V2 (0x2)
+# CASE1-NEXT: Flags [ (0x6)
+# CASE1-NEXT: FDEFuncStartPCRel (0x4){{ *}}
+# CASE1-NEXT: FramePointer (0x2){{ *}}
+# CASE1-NEXT: ]
+# CASE1-NEXT: ABI: AMD64EndianLittle (0x3)
+# CASE1-NEXT: CFA fixed FP offset (unused): 66
+# CASE1-NEXT: CFA fixed RA offset: 71
+# CASE1-NEXT: Auxiliary header length: 4
+# CASE1-NEXT: Num FDEs: 0
+# CASE1-NEXT: Num FREs: 16
+# CASE1-NEXT: FRE subsection length: 4096
+# CASE1-NEXT: FDE subsection offset: 0
+# CASE1-NEXT: FRE subsection offset: 256
+# CASE1-NEXT: Auxiliary header: [0xDE, 0xAD, 0xBE, 0xEF]
+# CASE1-NEXT: }
+# CASE1-NEXT: Function Index [
+# CASE1-NEXT: ]
+# CASE1-NEXT:}
+
+--- !ELF
+FileHeader:
+ Class: ELFCLASS64
+ Data: ELFDATA2MSB
+ Type: ET_EXEC
+Sections:
+ - Name: .sframe
+ Type: SHT_GNU_SFRAME
+ Flags: [ SHF_ALLOC ]
+ ContentArray: [
+ 0xde, 0xe2, 0x02, 0x01, # Preamble (magic, version, flags)
+ # Header:
+ 0x01, 0x42, 0x47, 0x00, # ABI, Fixed FP offset, Fixed RA Offset, AUX header length
+ 0x00, 0x00, 0x00, 0x00, # Number of FDEs
+ 0x00, 0x00, 0x00, 0x10, # Number of FREs
+ 0x00, 0x00, 0x10, 0x00, # FRE length
+ 0x00, 0x00, 0x00, 0x00, # FDE offset
+ 0x00, 0x00, 0x01, 0x00, # FRE offset
+ ]
+# CASE2-LABEL:SFrame section '.sframe' {
+# CASE2: Header {
+# CASE2-NEXT: Magic: 0xDEE2
+# CASE2-NEXT: Version: V2 (0x2)
+# CASE2-NEXT: Flags [ (0x1)
+# CASE2-NEXT: FDESorted (0x1){{ *}}
+# CASE2-NEXT: ]
+# CASE2-NEXT: ABI: AArch64EndianBig (0x1)
+# CASE2-NEXT: CFA fixed FP offset (unused): 66
+# CASE2-NEXT: CFA fixed RA offset (unused): 71
+# CASE2-NEXT: Auxiliary header length: 0
+# CASE2-NEXT: Num FDEs: 0
+# CASE2-NEXT: Num FREs: 16
+# CASE2-NEXT: FRE subsection length: 4096
+# CASE2-NEXT: FDE subsection offset: 0
+# CASE2-NEXT: FRE subsection offset: 256
+# CASE2-NEXT: Auxiliary header: []
+# CASE2-NEXT: }
+# CASE2-NEXT: Function Index [
+# CASE2-NEXT: ]
+# CASE2-NEXT:}
+
+--- !ELF
+FileHeader:
+ Class: ELFCLASS64
+ Data: ELFDATA2MSB
+ Type: ET_EXEC
+Sections:
+ - Name: .corrupted
+ Type: SHT_GNU_SFRAME
+ Flags: [ SHF_ALLOC ]
+ ShName: 0x10000
+# CASE3:{{.*}}: error: '[[FILE]]': a section [index 1] has an invalid sh_name (0x10000) offset which goes past the end of the section name string table