In rL287786, a bug was introduced into llvm-readelf where it didn't print the static symbol table if both --symbols and --dyn-symbols was specified, even if there was no dynamic symbol table. This is obviously incorrect.
This patch fixes this issue, by delegating the decision of what static and dynamic symbol tables should be printed to the final dumper, rather than trying to decide in the command-line option handling layer. The decision was made to follow the approach taken in this patch because the LLVM style dumper uses a different order to the original GNU style behaviour (and GNU readelf). Other approaches resulted in behaviour changes for other dumpers which felt wrong. In particular, I wanted to avoid changing the order of the output for --symbols --dyn-symbols for LLVM style, keep what is emitted by --symbols unchanged for all dumpers, and to avoid having different orders of .dynsym and .symtab dumping for GNU --symbols and --symbols --dyn-symbols.
Why not keep this as the default implementation rather than duplicating it 3 times? Of the 4 object formats it looks like only ELF needs different behaviour.