This complements D47241 for the non-linker-script (getOutputSectionName) case.
This implements the unfold approach as briefed at https://reviews.llvm.org/D54422#1302994
// Do not ICF fold input sections between output sections. If the output // sections of sec and the InputSection it gets folded into are different, // unfold it. sec->repl may have increased alignment or be have moved to the // main partition, but that does not matter.
--print-icf-sections is not handled.