SHF_LINK_ORDER sections adds special ordering requirements.
Such sections references other sections. Previously we would crash
if section that other were referenced to was discarded by script.
Patch fixes that by discarding all dependent sections in that case.
It supports chained dependencies, testcase is provided.
You don't need to check if a container is empty before passing it to a for-each-ish function, just like you don't check for emptiness foo before doing for (auto bar : foo).