[yaml2obj][obj2yaml] - Do not create a symbol table by default.

This patch tries to resolve problems faced in D68943
and uses some of the code written by Konrad Wilhelm Kleine
in that patch.

Previously, yaml2obj tool always created a .symtab section.
This patch changes that. With it we only create it when
have a "Symbols:" tag in the YAML document or when
we need to create it because it is used by another section(s).

obj2yaml follows the new behavior and does not print "Symbols:"
anymore when there is no symbol table.

Differential revision: https://reviews.llvm.org/D69041

llvm-svn: 375361
diff --git a/llvm/test/tools/llvm-objcopy/ELF/segment-test-remove-section.test b/llvm/test/tools/llvm-objcopy/ELF/segment-test-remove-section.test
index 60cd5f3..ca83e58 100644
--- a/llvm/test/tools/llvm-objcopy/ELF/segment-test-remove-section.test
+++ b/llvm/test/tools/llvm-objcopy/ELF/segment-test-remove-section.test
@@ -42,6 +42,9 @@
       - Section: .text
       - Section: .text2
       - Section: .text3
+## TODO (grimar): without the following line (i.e. without an empty symbol table),
+## llvm-objcopy adds an empty .strtab section. It doesn't look correct.
+Symbols: []
 
 # Make sure that when we remove a section we overwrite it with zeros
 # DATA: {{^[^[:blank:]]+}} 00 00 00 00