Also only print each such warning once.
LLVM-style output will now print "<?>" for sections it cannot identify, e.g. because the section index is invalid. GNU output continues to print the raw index. In both cases where the st_shndx value is SHN_XINDEX and the index cannot be looked up in the SHT_SYMTAB_SHNDX section (e.g. because it is missing), the symbol is printed like other symbols with st_shndx >= SHN_LORESERVE.
Depends on D69670.
May be regroup to isolate test cases? (they are not very similar, it is easier to think about them as about different tests and hence
read them separatelly. It also might be helpful if we will want to add more cases here not to mix them all).