[ELF] Change (NOLOAD) section type mismatch error to warning
authorFangrui Song <i@maskray.me>
Fri, 18 Feb 2022 19:20:36 +0000 (11:20 -0800)
committerFangrui Song <i@maskray.me>
Fri, 18 Feb 2022 19:20:36 +0000 (11:20 -0800)
commitcb0a4bb5be10636aaec3ecb56ed586dee3eb0b9e
tree904817fa3865b28c368116300e4d587c14c542dc
parent1e116867dbc84ebc6e7165996a8bbef7261c3ccd
[ELF] Change (NOLOAD) section type mismatch error to warning

Making a (NOLOAD) section SHT_PROGBITS is fishy (the user may expect all-zero
content, but the linker does not check that), but some projects (e.g. Linux
kernel https://github.com/ClangBuiltLinux/linux/issues/1597) traditionally rely
on the behavior. Issue a warning to not break them.
lld/ELF/OutputSections.cpp
lld/test/ELF/linkerscript/noload.s