llvm-project/llvm/test
Fangrui Song e13a8a1fc5 [MC][COFF][ELF] Reject instructions in IMAGE_SCN_CNT_UNINITIALIZED_DATA/SHT_NOBITS sections
For `.bss; nop`, MC inappropriately calls abort() (via report_fatal_error()) with a message
`cannot have fixups in virtual section!`
It is a bug to crash for invalid user input. Fix it by erroring out early in EmitInstToData().

Similarly, emitIntValue() in a virtual section (SHT_NOBITS in ELF) can crash with the mssage
`non-zero initializer found in section '.bss'` (see D4199)
It'd be nice to report the location but so many directives can call emitIntValue()
and it is difficult to track every location.
Note, COFF does not crash because MCAssembler::writeSectionData() is not
called for an IMAGE_SCN_CNT_UNINITIALIZED_DATA section.

Note, GNU as' arm64 backend reports ``Error: attempt to store non-zero value in section `.bss'``
for a non-zero .inst but fails to do so for other instructions.
We simply reject all instructions, even if the encoding is all zeros.

The Mach-O counterpart is D48517 (see `test/MC/MachO/zerofill-text.s`)

Reviewed By: rnk, skan

Differential Revision: https://reviews.llvm.org/D78138
2020-04-15 21:02:47 -07:00
..
Analysis [X86] Make v32i16/v64i8 legal types without avx512bw. Use custom splitting instead. 2020-04-15 12:17:18 -07:00
Assembler [llvm] Fix missing FileCheck directive colons 2020-04-06 09:59:08 -06:00
Bindings Make IRBuilder automatically set alignment on load/store/alloca. 2020-04-13 13:43:14 -07:00
Bitcode
BugPoint
CodeGen [AMDGPU] Fixed lane mask in test. NFC. 2020-04-15 15:26:53 -07:00
DebugInfo Reapply "llvm-dwarfdump: Report errors when failing to parse loclist/debug_loc entries"" 2020-04-14 14:44:32 -07:00
Demangle
Examples
ExecutionEngine Revert 43f031d312 "Enable IBT(Indirect Branch Tracking) in JIT with CET(Control-flow Enforcement Technology)" 2020-04-06 15:05:25 +02:00
Feature Enable new passmanager plugin support for LTO. 2020-04-14 15:07:07 -07:00
FileCheck [FileCheck] Better diagnostic for format conflict 2020-04-15 13:46:45 +01:00
Instrumentation [SanitizerCoverage] The section name for inline-bool-flag was too long for darwin builds, so shortening it. 2020-04-14 02:06:33 -07:00
Integer
JitListener
LTO [ThinLTO] Drop dso_local if a GlobalVariable satisfies isDeclarationForLinker() 2020-04-07 15:46:01 -07:00
Linker
MC [MC][COFF][ELF] Reject instructions in IMAGE_SCN_CNT_UNINITIALIZED_DATA/SHT_NOBITS sections 2020-04-15 21:02:47 -07:00
MachineVerifier
Object [obj2yaml] - Do not dump the segment's "Align" field when it is equal to 1. 2020-04-09 14:20:36 +03:00
ObjectYAML [llvm] Fix missing FileCheck directive colons 2020-04-06 09:59:08 -06:00
Other [CFGPrinter] Adding heat coloring to CFGPrinter 2020-04-08 19:59:51 +00:00
Reduce
SafepointIRVerifier
Support
SymbolRewriter
TableGen TableGen/GlobalISel: Fix constraining REG_SEQUENCE operands 2020-04-14 22:05:22 -04:00
ThinLTO/X86 [ThinLTO] Drop dso_local if a GlobalVariable satisfies isDeclarationForLinker() 2020-04-07 15:46:01 -07:00
Transforms [Attributor] Remove large and seemingly useless test 2020-04-15 21:26:36 -05:00
Unit Revert a few unsuccessful attempts at fixing bots. 2020-04-13 17:09:21 -04:00
Verifier [Verifier] Verify matrix dimensions operands match vector size. 2020-04-01 09:21:39 +01:00
YAMLParser
tools [LLVM/tools][test] - Remove/fix dead check prefixes. 2020-04-15 13:09:51 +03:00
.clang-format
CMakeLists.txt Reland "Make it possible for lit.site.cfg to contain relative paths, and use it for llvm and clang" 2020-04-02 16:12:03 -04:00
TestRunner.sh
lit.cfg.py Enable new passmanager plugin support for LTO. 2020-04-14 15:07:07 -07:00
lit.site.cfg.py.in Revert a few unsuccessful attempts at fixing bots. 2020-04-13 17:09:21 -04:00