HomePhabricator

[ELF] Don't create an output section named `/DISCARD/` if it is assigned to the…

Description

[ELF] Don't create an output section named /DISCARD/ if it is assigned to the special phdr NONE

Fixes the remaining issue of PR41673 after D61186: with /DISCARD/ { ... } :NONE,
we may create an output section named /DISCARD/.

Note, if an input section is named /DISCARD/, ld.bfd discards it but
lld keeps it. It is probably not worth copying this behavior as it is unrealistic.

Reviewed By: ruiu

Differential Revision: https://reviews.llvm.org/D62768