aboutsummaryrefslogtreecommitdiff
path: root/test/old-elf/Mips/invalid-reginfo.test
diff options
context:
space:
mode:
Diffstat (limited to 'test/old-elf/Mips/invalid-reginfo.test')
-rw-r--r--test/old-elf/Mips/invalid-reginfo.test28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/old-elf/Mips/invalid-reginfo.test b/test/old-elf/Mips/invalid-reginfo.test
new file mode 100644
index 000000000000..2856ecc92607
--- /dev/null
+++ b/test/old-elf/Mips/invalid-reginfo.test
@@ -0,0 +1,28 @@
+# Check that LLD shows an error if .reginfo section has invalid size
+
+# RUN: yaml2obj -format=elf %s > %t.o
+# RUN: not lld -flavor old-gnu -target mipsel -o %t.exe %t.o 2>&1 | FileCheck %s
+
+# CHECK: Invalid size of MIPS_REGINFO section
+
+FileHeader:
+ Class: ELFCLASS32
+ Data: ELFDATA2LSB
+ Type: ET_REL
+ Machine: EM_MIPS
+ Flags: [ EF_MIPS_ABI_O32, EF_MIPS_ARCH_32 ]
+Sections:
+ - Name: .text
+ Type: SHT_PROGBITS
+ Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
+ AddressAlign: 0x04
+ Size: 0x04
+ - Name: .reginfo
+ Type: SHT_MIPS_REGINFO
+ Flags: [ SHF_ALLOC ]
+ AddressAlign: 0x01
+ Size: 0x25
+Symbols:
+ Global:
+ - Name: main
+ Section: .text