GNU as emits thestarted to emit warnings for changed sh_type, or sh_flags or sh_entsize,in 2000.
because they usually indicate user errors.GNU as>=2.35 will emit errors for most type/flags change, and error for entsize change.
The rationale is that sh_type, sh_flags or sh_entsize changes usually indicate user errors.
We just try to be more rigid and emit errors for all type/flags/entsize
The warnings may be upgraded to errors (https://sourceware.org/ml/binutils/2020-02/msg00129.html)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.