aboutsummaryrefslogtreecommitdiff
path: root/lld/test/ELF/invalid/invalid-debug-relocations.test
diff options
context:
space:
mode:
Diffstat (limited to 'lld/test/ELF/invalid/invalid-debug-relocations.test')
-rw-r--r--lld/test/ELF/invalid/invalid-debug-relocations.test41
1 files changed, 41 insertions, 0 deletions
diff --git a/lld/test/ELF/invalid/invalid-debug-relocations.test b/lld/test/ELF/invalid/invalid-debug-relocations.test
new file mode 100644
index 0000000..75e41d1
--- /dev/null
+++ b/lld/test/ELF/invalid/invalid-debug-relocations.test
@@ -0,0 +1,41 @@
+# REQUIRES: x86
+# RUN: yaml2obj %s -o %t.o
+# RUN: not ld.lld -gdb-index %t.o -o %t.exe 2>&1 | FileCheck %s
+
+# CHECK: error: {{.*}}.o: error parsing DWARF data:
+# CHECK-NEXT: >>> failed to compute relocation: Unknown, Invalid data was encountered while parsing the file
+
+!ELF
+FileHeader:
+ Class: ELFCLASS32
+ Data: ELFDATA2LSB
+ Type: ET_REL
+ Machine: EM_386
+Sections:
+ - Type: SHT_PROGBITS
+ Name: .text
+ Flags: [ ]
+ AddressAlign: 0x04
+ Content: "0000"
+ - Type: SHT_PROGBITS
+ Name: .debug_info
+ Flags: [ ]
+ AddressAlign: 0x04
+ Content: "0000"
+ - Type: SHT_REL
+ Name: .rel.debug_info
+ Link: .symtab
+ Info: .debug_info
+ Relocations:
+ - Offset: 0
+ Symbol: _start
+ Type: 0xFF
+ - Offset: 4
+ Symbol: _start
+ Type: 0xFF
+Symbols:
+ Global:
+ - Name: _start
+ Type: STT_FUNC
+ Section: .text
+ Value: 0x0