User may initialize a variable with non-zero value and put it into .bss section by mistake.
E.g. : int a __attribute__((section(".bss"))) = 2; // mistakenly initialized to 2
This patch converts an assertion to error report for better user experience.
Sorry, what I mean is that you can use the dyn_cast in here. It will return a MCSectionELF or null. So instead of
if (check)
you have
if (auto *ELFSection = dyn_cast...)