Since SyntheticSection::getParent() may return null, dereferencing this pointer in ARMExidxSentinelSection::empty() call from removeUnusedSyntheticSections() results in crashes when linking ARM binaries.
A check against null is added to ARMExidxSentinelSection::empty() similarly to SyntheticSection::getVA(). Another check is added to removeUnusedSyntheticSections, because in other functions (e.g. applySynthetic) getParent is normally checked first. While either change will fix the code, both of them seem reasonable to me.
Please commit this for me after review, since I do not have commit access.
Use early return here. It's better than increasing the level of nesting.