llvm-project/llvm/test/MC
Simon Wallis 410644fbf7 Clang crash targeting ARM or Thumb when assembling a prel31 relocation variant
Summary:
In the assembler or inline assembler,
attempting to use an invalid fixup type
gives a crash with a segmentation fault.

__attribute__((naked))
void foo(void) {
 __asm__("mov r9, :lower16:bar(prel31)");
}

This should give a proper error message when building for ARM or Thumb.
This brings it in line with AARCH64.

This fixes all 8 instances of llvm_unreachable("Unsupported Modifier");
in ARM/MCTargetDesc/ARMELFObjectWriter.cpp.
A test is provided for each instance.

Reviewers: llvm-commits, MarkMurrayARM

Reviewed By: MarkMurrayARM

Subscribers: kristof.beyls, hiraditya, danielkiss

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D79782

Change-Id: I6971ba37f129cc453568fe71514ccb2ac9d16831
2020-05-13 13:52:30 +01:00
..
AArch64 [AArch64] Remove inexistent system register ERXTS_EL1 2020-04-29 16:43:48 +01:00
AMDGPU [AMDGPU][MC][GFX9+] Enabled clamp for v_add_i32 and v_sub_i32 2020-05-13 14:17:20 +03:00
ARM Clang crash targeting ARM or Thumb when assembling a prel31 relocation variant 2020-05-13 13:52:30 +01:00
AVR [Object] Change ELFObjectFile<ELFT>::getFileFormatName() to use BFD names 2020-03-16 07:42:04 -07:00
AsmParser [MC][DWARF] Corrected handling of is_stmt flag in .loc directives 2020-04-20 13:57:49 +03:00
BPF [test] llvm/test/: change llvm-objdump single-dash long options to double-dash options 2020-03-15 17:46:23 -07:00
COFF [MC][COFF][ELF] Reject instructions in IMAGE_SCN_CNT_UNINITIALIZED_DATA/SHT_NOBITS sections 2020-04-15 21:02:47 -07:00
Disassembler [AMDGPU][MC][GFX9+] Enabled clamp for v_add_i32 and v_sub_i32 2020-05-13 14:17:20 +03:00
ELF [MC][X86] Allow SHT_PROGBITS for .eh_frame on x86-64 2020-04-16 10:42:52 -07:00
Hexagon [Object] Change ELFObjectFile<ELFT>::getFileFormatName() to use BFD names 2020-03-16 07:42:04 -07:00
Lanai [lit] Delete empty lines at the end of lit.local.cfg NFC 2019-06-17 09:51:07 +00:00
MSP430 [test] llvm/test/: change llvm-objdump single-dash long options to double-dash options 2020-03-15 17:46:23 -07:00
MachO Normalize working directory when running llvm-mc in test 2020-04-13 13:44:15 +02:00
Mips [mips] Fix typo in FileCheck directives - replace \0xa0 char by space. NFC 2020-05-13 12:09:30 +03:00
PowerPC [PowerPC] Fix missing GOT indirect variant kind 2020-05-06 05:50:56 -05:00
RISCV [RISCV][NFC] Add more constant materialization tests 2020-05-06 16:06:16 +01:00
Sparc [Object] Change ELFObjectFile<ELFT>::getFileFormatName() to use BFD names 2020-03-16 07:42:04 -07:00
SystemZ [SystemZ] Allow specifying plain register numbers in AsmParser 2020-04-29 20:42:30 +02:00
WebAssembly [WebAssembly] Implement pseudo-min/max SIMD instructions 2020-05-12 09:39:01 -07:00
X86 [X86] Add assembler support for {vex} prefix to match GNU as. 2020-05-08 11:50:58 -07:00