[WebAssembly] Add first claass symbol table to wasm objects

This is combination of two patches by Nicholas Wilson:
  1. https://reviews.llvm.org/D41954
  2. https://reviews.llvm.org/D42495

Along with a few local modifications:
- One change I made was to add the UNDEFINED bit to the binary format
  to avoid the extra byte used when writing data symbols.  Although this
  bit is redundant for other symbols types (i.e. undefined can be
  implied if a function or global is a wasm import)
- I prefer to be explicit and consistent and not have derived flags.
- Some field renaming.
- Some reverting of unrelated minor changes.
- No test output differences.

Differential Revision: https://reviews.llvm.org/D43147

llvm-svn: 325860
diff --git a/llvm/test/Object/nm-trivial-object.test b/llvm/test/Object/nm-trivial-object.test
index 0be998e..621a177 100644
--- a/llvm/test/Object/nm-trivial-object.test
+++ b/llvm/test/Object/nm-trivial-object.test
@@ -59,11 +59,14 @@
 COFF32-NEXT: 00000000 T _main
 COFF32-NEXT:          U _puts
 
-WASM:               U SomeOtherFunction
+
+WASM:      00000000 d .L.str
+WASM-NEXT:          U SomeOtherFunction
 WASM-NEXT: 00000002 T main
 WASM-NEXT:          U puts
 WASM-NEXT: 00000010 D var
 
+
 COFF64: 00000000 d .data
 COFF64-NEXT: 00000000 t .text
 COFF64-NEXT: 00000000 r ??__Ex@@YAXXZ