1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00
llvm-mirror/test/MC/COFF
Fangrui Song 7a1a2170b7 [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
..
ARM
addrsig.s
alias.s
align-nops.s
assoc-private.s
assoc-undef.s
bad-expr.s
basic-coff-64.s
basic-coff.s
bigobj.py
bss_section.ll
bss-text.s [MC][COFF][ELF] Reject instructions in IMAGE_SCN_CNT_UNINITIALIZED_DATA/SHT_NOBITS sections 2020-04-15 21:02:47 -07:00
bss.s
cfi-sections.s [llvm-objdump] Add column headers for relocation printing 2020-02-12 10:57:15 +00:00
comm-align.s
comm.ll
comm.s
const-gv-with-rel-init.ll
cross-section-relative-err.s
cross-section-relative.ll
cross-section-relative.s
cv-compiler-info.ll
cv-def-range-align.s
cv-def-range-errors.s
cv-def-range-gap.s
cv-def-range.s
cv-empty-file-table.s
cv-empty-linetable.s
cv-errors.s
cv-fpo-csrs.s
cv-fpo-errors.s
cv-fpo-realign.s
cv-fpo-setframe.s
cv-inline-linetable-infloop.s
cv-inline-linetable-unlikely.s [X86InstPrinter] Change printPCRelImm to print the target address in hexadecimal form 2020-03-26 08:28:59 -07:00
cv-inline-linetable-unreachable.s
cv-inline-linetable.s [llvm-objdump] -d: print 00000000 <foo>: instead of 00000000 foo: 2020-03-05 18:05:28 -08:00
cv-loc-cross-section.s
cv-loc-unreachable-2.s [X86InstPrinter] Change printPCRelImm to print the target address in hexadecimal form 2020-03-26 08:28:59 -07:00
cv-loc-unreachable.s [X86InstPrinter] Change printPCRelImm to print the target address in hexadecimal form 2020-03-26 08:28:59 -07:00
cv-loc.s
cv-string.s
diff.s
directive-section-characteristics.ll
early-dce.s
eh-frame.s
feat00.s
file.s
global_ctors_dtors.ll
initialised-data.ll
invalid-def.s
invalid-endef.s
invalid-scl-range.s
invalid-scl.s
invalid-type-range.s
invalid-type.s
ir-to-imgrel.ll
label-undefined.s
linker-options.ll
linkonce-invalid.s
linkonce.s
lit.local.cfg
lset0.s
module-asm.ll
offset.s
pr23025.s
pr28462.s
rdata.ll
relax-reloc.s
relocation-imgrel.s
safeseh.s
secidx.s
secrel32-undef.s
secrel32.s
secrel-variant.s
section-comdat-conflict2.s Revert "Revert "Reland "[Support] make report_fatal_error abort instead of exit""" 2020-02-13 10:16:06 -08:00
section-comdat-conflict.s Revert "Revert "Reland "[Support] make report_fatal_error abort instead of exit""" 2020-02-13 10:16:06 -08:00
section-comdat.s
section-invalid-flags.s
section-name-encoding.s
section-passthru-flags.s
section.s
seh-align1.s
seh-align2.s
seh-align3.s
seh-linkonce.s
seh-section-2.s
seh-section.s
seh-stackalloc-zero.s
seh.s
simple-fixups.s
stdin.s
switch-relocations.ll
symbol-alias.s
symbol-fragment-offset-64.s
symbol-fragment-offset.s
symidx.s
temporary-alias.s
timestamp.s
tricky-names.ll
unsupported-relocations.s
weak-alias-local.s [COFF] Assign unique names to autogenerated .weak.<name>.default symbols 2020-03-13 22:44:55 +02:00
weak-name.s [COFF] Assign unique names to autogenerated .weak.<name>.default symbols 2020-03-13 22:44:55 +02:00
weak-val.s [COFF] Assign unique names to autogenerated .weak.<name>.default symbols 2020-03-13 22:44:55 +02:00
weak.s [COFF] Assign unique names to autogenerated .weak.<name>.default symbols 2020-03-13 22:44:55 +02:00