One of the change we made in the past was:
" // STT_SECTION symbols can be
// associated with SHT_REL[A]/SHT_SYMTAB/SHT_STRTAB sections. // In this case it is fine for section to be null here as we // do not allocate sections of these types."
This patch makes the check for null section stricter, so it is only allowed for STT_SECTION symbols now.
I did it because testcase that contains local unnamed symbol crashes without that check in:
template <class ELFT> static bool shouldKeepInSymtab(InputSectionBase<ELFT> *Sec, StringRef SymName, const SymbolBody &B) { ... return !(Sec->getSectionHdr()->sh_flags & SHF_MERGE); // HERE, because Sec is null }
This code seems a bit too dense. I'd relax it like this.