1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00
llvm-mirror/lib/MC/MCParser
Fangrui Song 75db90da40 [MC][ELF] Error for sh_type, sh_flags or sh_entsize change
Heads-up message: https://lists.llvm.org/pipermail/llvm-dev/2020-February/139390.html

GNU as started to emit warnings for changed sh_type or sh_flags in 2000.
GNU as>=2.35 will emit errors for most sh_type/sh_flags change, and error for entsize change.

Some cases remain warnings for legacy reasons:

   .section .init_array,"ax", @progbits
   .section .init_array,"ax", @init_array
   # And some obscure sh_flags changes (OS/Processor specific flags)

The rationale of a diagnostic (warning or error) is that sh_type,
sh_flags or sh_entsize changes usually indicate user errors. The values
are taken from the first .section directive. Successive directives are ignored.

We just try to be rigid and emit errors for all sh_type/sh_flags/sh_entsize change.

A possible improvement in the future is to reuse
llvm-readobj/ELFDumper.cpp:getSectionTypeString so that we can name the
type in the diagnostics.

Reviewed By: psmith

Differential Revision: https://reviews.llvm.org/D73999
2020-02-21 15:44:14 -08:00
..
AsmLexer.cpp [ms] [llvm-ml] Add a draft MASM parser 2020-02-16 12:30:46 -05:00
AsmParser.cpp [ms] [llvm-ml] Add a draft MASM parser 2020-02-16 12:30:46 -05:00
CMakeLists.txt [ms] [llvm-ml] Add a draft MASM parser 2020-02-16 12:30:46 -05:00
COFFAsmParser.cpp [MC] De-capitalize some MCStreamer::Emit* functions 2020-02-14 19:11:53 -08:00
COFFMasmParser.cpp [ms] [llvm-ml] Add a draft MASM parser 2020-02-16 12:30:46 -05:00
DarwinAsmParser.cpp [MC] De-capitalize MCStreamer::Emit{Bundle,Addrsig}* etc 2020-02-15 09:11:48 -08:00
ELFAsmParser.cpp [MC][ELF] Error for sh_type, sh_flags or sh_entsize change 2020-02-21 15:44:14 -08:00
LLVMBuild.txt Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
MasmParser.cpp Remove unused functions in llvm-ml 2020-02-21 10:04:24 -05:00
MCAsmLexer.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
MCAsmParser.cpp [ms] [llvm-ml] Add a draft MASM parser 2020-02-16 12:30:46 -05:00
MCAsmParserExtension.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
MCTargetAsmParser.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
WasmAsmParser.cpp [MC] De-capitalize MCStreamer::Emit{Bundle,Addrsig}* etc 2020-02-15 09:11:48 -08:00