Fix ARM fail of gap test
ld-elf/gap test was failing due to the ARM backend attempting to output
arch symbols when ld -s (strip all symbols) is in force. This patch
stops that happening and tidies the code a little.
PR 17842
* elflink.c (elf_link_output_sym): Assert elf_onesymtab set.
(bfd_elf_final_link): Always create a symbol table when emit_relocs.
Don't assign symtab file position unless symbols will be output.
Merge blocks with condition in common. Don't call
elf_backend_output_arch_local_syms or elf_backend_output_arch_syms
unless other symbols are output. Move assignment of symtab_shndx
file position. Localize variable.