This revert has one meaningful change in getSymSectionIndex in ELF/SyntheticSections.cpp: if Sym->getOutputSection() is not null, it should take priority over isa<Defined> check, as it did before r338247 (https://reviews.llvm.org/D49541).
Fixes https://bugs.llvm.org/show_bug.cgi?id=39104
TODO: add a test case.