It was suggested in D38582 thread and I think reasonable
cleanup itself.
processSectionCommands() uses createInputSectionList() to construct the
list of input sections. In this patch I changed createInputSectionList() to return
Optional<>, so that now it filters out sections that does not satisfy ONLY_IF_RO/ONLY_IF_RW
constraints and sections that are discarded using /DISCARD/ on its side. That allows
to reduce loop in processSectionCommands() and I think looks more natural.