[llvm] r357595 - [yaml2obj][obj2yaml] - Change how symbol's binding is descibed when parsing/dumping.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 3 07:53:43 PDT 2019


Author: grimar
Date: Wed Apr  3 07:53:42 2019
New Revision: 357595

URL: http://llvm.org/viewvc/llvm-project?rev=357595&view=rev
Log:
[yaml2obj][obj2yaml] - Change how symbol's binding is descibed when parsing/dumping.

Currently, YAML has the following syntax for describing the symbols:

Symbols:
  Local:
    LocalSymbol1:
    ...
    LocalSymbol2:
    ...
  ...
  Global:
    GlobalSymbol1:
  ...
  Weak:
  ...
  GNUUnique:

I.e. symbols are grouped by their bindings. That is not very convenient,
because:

It does not allow to set a custom binding, what can be useful for producing
broken/special outputs for test cases. Adding a new binding would require to
change a syntax (what we observed when added GNUUnique recently).

It does not allow to change the order of the symbols in .symtab/.dynsym,
i.e. currently all Local symbols are placed first, then Global, Weak and GNUUnique
are following, but we are not able to change the order.

It is not consistent. Binding is just one of the properties of the symbol,
we do not group them by other properties.

It makes the code more complex that it can be. This patch shows it can be simplified
with the change performed.

The patch changes the syntax to just:

Symbols:
  Symbol1:
  ...
  Symbol2:
  ...
...

With that, we are able to work with the binding field just like with any other symbol property.

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

Added:
    llvm/trunk/test/tools/yaml2obj/elf-symbols-binding-order.yaml
Modified:
    llvm/trunk/include/llvm/ObjectYAML/ELFYAML.h
    llvm/trunk/lib/ObjectYAML/ELFYAML.cpp
    llvm/trunk/test/DebugInfo/invalid-relocations.test
    llvm/trunk/test/Object/AArch64/yaml2obj-elf-aarch64-rel.yaml
    llvm/trunk/test/Object/AMDGPU/elf64-relocs.yaml
    llvm/trunk/test/Object/Lanai/yaml2obj-elf-lanai-rel.yaml
    llvm/trunk/test/Object/Mips/abi-flags.yaml
    llvm/trunk/test/Object/Mips/elf-abi.yaml
    llvm/trunk/test/Object/Mips/elf-flags.yaml
    llvm/trunk/test/Object/Mips/elf-mips64-rel.yaml
    llvm/trunk/test/Object/X86/yaml-elf-x86-rel-broken.yaml
    llvm/trunk/test/Object/X86/yaml2obj-elf-x86-rel.yaml
    llvm/trunk/test/Object/obj2yaml-invalid-reloc.test
    llvm/trunk/test/Object/obj2yaml.test
    llvm/trunk/test/Object/yaml2obj-elf-alignment.yaml
    llvm/trunk/test/Object/yaml2obj-elf-multi-doc.test
    llvm/trunk/test/Object/yaml2obj-elf-rel-noref.yaml
    llvm/trunk/test/Object/yaml2obj-elf-rel.yaml
    llvm/trunk/test/Object/yaml2obj-elf-symbol-LocalGlobalWeak.yaml
    llvm/trunk/test/Object/yaml2obj-elf-symbol-basic.yaml
    llvm/trunk/test/Object/yaml2obj-elf-symbol-visibility.yaml
    llvm/trunk/test/tools/llvm-ar/Inputs/add-lib1.yaml
    llvm/trunk/test/tools/llvm-ar/Inputs/add-lib2.yaml
    llvm/trunk/test/tools/llvm-ar/Inputs/add-lib3.yaml
    llvm/trunk/test/tools/llvm-ar/Inputs/elf.yaml
    llvm/trunk/test/tools/llvm-objcopy/ELF/Inputs/compress-debug-sections.yaml
    llvm/trunk/test/tools/llvm-objcopy/ELF/abs-symbol.test
    llvm/trunk/test/tools/llvm-objcopy/ELF/armexidx-link.test
    llvm/trunk/test/tools/llvm-objcopy/ELF/basic-archive-copy.test
    llvm/trunk/test/tools/llvm-objcopy/ELF/basic-relocations.test
    llvm/trunk/test/tools/llvm-objcopy/ELF/common-symbol.test
    llvm/trunk/test/tools/llvm-objcopy/ELF/cross-arch-headers.test
    llvm/trunk/test/tools/llvm-objcopy/ELF/cross-arch-sections-symbols.test
    llvm/trunk/test/tools/llvm-objcopy/ELF/discard-all.test
    llvm/trunk/test/tools/llvm-objcopy/ELF/discard-locals-rel.test
    llvm/trunk/test/tools/llvm-objcopy/ELF/discard-locals.test
    llvm/trunk/test/tools/llvm-objcopy/ELF/discard-mix-local-and-all.test
    llvm/trunk/test/tools/llvm-objcopy/ELF/globalize.test
    llvm/trunk/test/tools/llvm-objcopy/ELF/group-addr-misaligned.test
    llvm/trunk/test/tools/llvm-objcopy/ELF/group-big-endian.test
    llvm/trunk/test/tools/llvm-objcopy/ELF/group-unchanged.test
    llvm/trunk/test/tools/llvm-objcopy/ELF/group.test
    llvm/trunk/test/tools/llvm-objcopy/ELF/hexagon-unsupported-on-x86.test
    llvm/trunk/test/tools/llvm-objcopy/ELF/keep-file-symbols.test
    llvm/trunk/test/tools/llvm-objcopy/ELF/keep-global-symbols-mix-globalize.test
    llvm/trunk/test/tools/llvm-objcopy/ELF/keep-global-symbols.test
    llvm/trunk/test/tools/llvm-objcopy/ELF/keep-symbol-remove-section.test
    llvm/trunk/test/tools/llvm-objcopy/ELF/keep-symbol.test
    llvm/trunk/test/tools/llvm-objcopy/ELF/localize-hidden.test
    llvm/trunk/test/tools/llvm-objcopy/ELF/localize.test
    llvm/trunk/test/tools/llvm-objcopy/ELF/prefix-symbols.test
    llvm/trunk/test/tools/llvm-objcopy/ELF/redefine-symbol.test
    llvm/trunk/test/tools/llvm-objcopy/ELF/regex.test
    llvm/trunk/test/tools/llvm-objcopy/ELF/reloc-error-remove-symtab.test
    llvm/trunk/test/tools/llvm-objcopy/ELF/remove-section-with-symbol.test
    llvm/trunk/test/tools/llvm-objcopy/ELF/rename-section-flag-preserved.test
    llvm/trunk/test/tools/llvm-objcopy/ELF/section-index-unsupported.test
    llvm/trunk/test/tools/llvm-objcopy/ELF/strip-all-and-keep-symbol.test
    llvm/trunk/test/tools/llvm-objcopy/ELF/strip-all-and-remove.test
    llvm/trunk/test/tools/llvm-objcopy/ELF/strip-debug-and-remove.test
    llvm/trunk/test/tools/llvm-objcopy/ELF/strip-debug.test
    llvm/trunk/test/tools/llvm-objcopy/ELF/strip-group-symbol.test
    llvm/trunk/test/tools/llvm-objcopy/ELF/strip-multiple-files.test
    llvm/trunk/test/tools/llvm-objcopy/ELF/strip-reloc-symbol.test
    llvm/trunk/test/tools/llvm-objcopy/ELF/strip-section-err.test
    llvm/trunk/test/tools/llvm-objcopy/ELF/strip-symbol-and-relocation.test
    llvm/trunk/test/tools/llvm-objcopy/ELF/strip-symbol.test
    llvm/trunk/test/tools/llvm-objcopy/ELF/strip-unneeded.test
    llvm/trunk/test/tools/llvm-objcopy/ELF/symbol-copy.test
    llvm/trunk/test/tools/llvm-objcopy/ELF/symbol-empty-name.test
    llvm/trunk/test/tools/llvm-objcopy/ELF/weaken-all.test
    llvm/trunk/test/tools/llvm-objcopy/ELF/weaken.test
    llvm/trunk/test/tools/llvm-objdump/X86/Inputs/simple-executable-x86_64.yaml
    llvm/trunk/test/tools/llvm-objdump/X86/adjust-vma.test
    llvm/trunk/test/tools/llvm-objdump/X86/disasm-zeroes-relocations.test
    llvm/trunk/test/tools/llvm-objdump/X86/disassemble-demangle.test
    llvm/trunk/test/tools/llvm-objdump/relocations-elf.test
    llvm/trunk/test/tools/llvm-objdump/symbol-table-elf.test
    llvm/trunk/test/tools/llvm-objdump/verdef-elf.test
    llvm/trunk/test/tools/llvm-objdump/verneed-elf.test
    llvm/trunk/test/tools/llvm-objdump/verneed-wrong-info.test
    llvm/trunk/test/tools/llvm-readobj/Inputs/dwarf-exprs.exe-x86-64.yaml
    llvm/trunk/test/tools/llvm-readobj/broken-group.test
    llvm/trunk/test/tools/llvm-readobj/demangle.test
    llvm/trunk/test/tools/llvm-readobj/elf-no-shdrs.test
    llvm/trunk/test/tools/llvm-readobj/elf-packed-relocs.test
    llvm/trunk/test/tools/llvm-readobj/elf-reloc-negative-addend-no-sym.test
    llvm/trunk/test/tools/llvm-readobj/elf-reloc-symbol-with-versioning.test
    llvm/trunk/test/tools/llvm-readobj/elf-reloc-zero-name-or-value.test
    llvm/trunk/test/tools/llvm-readobj/elf-section-types.test
    llvm/trunk/test/tools/llvm-readobj/elf-symbol-64bit.test
    llvm/trunk/test/tools/llvm-readobj/elf-symbol-binding.test
    llvm/trunk/test/tools/llvm-readobj/elf-symbol-shndx.test
    llvm/trunk/test/tools/llvm-readobj/elf-symbol-types.test
    llvm/trunk/test/tools/llvm-readobj/elf-symbol-visibility.test
    llvm/trunk/test/tools/llvm-readobj/gnu-notes.test
    llvm/trunk/test/tools/obj2yaml/elf-gnu-unique-symbols.yaml
    llvm/trunk/test/tools/obj2yaml/missing_symtab.test
    llvm/trunk/test/tools/obj2yaml/special-symbol-indices.yaml
    llvm/trunk/test/tools/obj2yaml/symbol-type.yaml
    llvm/trunk/test/tools/obj2yaml/verdef-section.yaml
    llvm/trunk/test/tools/obj2yaml/verneed-section.yaml
    llvm/trunk/test/tools/obj2yaml/versym-section.yaml
    llvm/trunk/test/tools/sanstats/elf.test
    llvm/trunk/test/tools/yaml2obj/dynamic-symbols.yaml
    llvm/trunk/test/tools/yaml2obj/dynsym-dynstr-addr.yaml
    llvm/trunk/test/tools/yaml2obj/elf-comdat-broken.yaml
    llvm/trunk/test/tools/yaml2obj/elf-gnu-unique-symbols.yaml
    llvm/trunk/test/tools/yaml2obj/elf-symtab-shinfo.yaml
    llvm/trunk/test/tools/yaml2obj/elf-symtab-shtype.yaml
    llvm/trunk/test/tools/yaml2obj/relocation-explicit-symbol-index.yaml
    llvm/trunk/test/tools/yaml2obj/symbol-index.yaml
    llvm/trunk/test/tools/yaml2obj/symbol-type.yaml
    llvm/trunk/test/tools/yaml2obj/verdef-section.yaml
    llvm/trunk/test/tools/yaml2obj/verneed-section.yaml
    llvm/trunk/test/tools/yaml2obj/versym-section.yaml
    llvm/trunk/tools/obj2yaml/elf2yaml.cpp
    llvm/trunk/tools/yaml2obj/yaml2elf.cpp

Modified: llvm/trunk/include/llvm/ObjectYAML/ELFYAML.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ObjectYAML/ELFYAML.h?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ObjectYAML/ELFYAML.h (original)
+++ llvm/trunk/include/llvm/ObjectYAML/ELFYAML.h Wed Apr  3 07:53:42 2019
@@ -52,6 +52,7 @@ LLVM_YAML_STRONG_TYPEDEF(uint8_t, ELF_RS
 // Just use 64, since it can hold 32-bit values too.
 LLVM_YAML_STRONG_TYPEDEF(uint64_t, ELF_SHF)
 LLVM_YAML_STRONG_TYPEDEF(uint16_t, ELF_SHN)
+LLVM_YAML_STRONG_TYPEDEF(uint8_t, ELF_STB)
 LLVM_YAML_STRONG_TYPEDEF(uint8_t, ELF_STT)
 LLVM_YAML_STRONG_TYPEDEF(uint8_t, ELF_STV)
 LLVM_YAML_STRONG_TYPEDEF(uint8_t, ELF_STO)
@@ -97,18 +98,12 @@ struct Symbol {
   ELF_STT Type;
   StringRef Section;
   Optional<ELF_SHN> Index;
+  ELF_STB Binding;
   llvm::yaml::Hex64 Value;
   llvm::yaml::Hex64 Size;
   uint8_t Other;
 };
 
-struct SymbolsDef {
-  std::vector<Symbol> Local;
-  std::vector<Symbol> Global;
-  std::vector<Symbol> Weak;
-  std::vector<Symbol> GNUUnique;
-};
-
 struct SectionOrType {
   StringRef sectionNameOrType;
 };
@@ -289,8 +284,8 @@ struct Object {
   // cleaner and nicer if we read them from the YAML as a separate
   // top-level key, which automatically ensures that invariants like there
   // being a single SHT_SYMTAB section are upheld.
-  SymbolsDef Symbols;
-  SymbolsDef DynamicSymbols;
+  std::vector<Symbol> Symbols;
+  std::vector<Symbol> DynamicSymbols;
 };
 
 } // end namespace ELFYAML
@@ -362,6 +357,10 @@ template <> struct ScalarEnumerationTrai
   static void enumeration(IO &IO, ELFYAML::ELF_SHN &Value);
 };
 
+template <> struct ScalarEnumerationTraits<ELFYAML::ELF_STB> {
+  static void enumeration(IO &IO, ELFYAML::ELF_STB &Value);
+};
+
 template <>
 struct ScalarEnumerationTraits<ELFYAML::ELF_STT> {
   static void enumeration(IO &IO, ELFYAML::ELF_STT &Value);
@@ -437,10 +436,6 @@ struct MappingTraits<ELFYAML::Symbol> {
   static StringRef validate(IO &IO, ELFYAML::Symbol &Symbol);
 };
 
-template <> struct MappingTraits<ELFYAML::SymbolsDef> {
-  static void mapping(IO &IO, ELFYAML::SymbolsDef &Symbols);
-};
-
 template <> struct MappingTraits<ELFYAML::DynamicEntry> {
   static void mapping(IO &IO, ELFYAML::DynamicEntry &Rel);
 };

Modified: llvm/trunk/lib/ObjectYAML/ELFYAML.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ObjectYAML/ELFYAML.cpp?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/lib/ObjectYAML/ELFYAML.cpp (original)
+++ llvm/trunk/lib/ObjectYAML/ELFYAML.cpp Wed Apr  3 07:53:42 2019
@@ -560,6 +560,17 @@ void ScalarEnumerationTraits<ELFYAML::EL
   IO.enumFallback<Hex32>(Value);
 }
 
+void ScalarEnumerationTraits<ELFYAML::ELF_STB>::enumeration(
+    IO &IO, ELFYAML::ELF_STB &Value) {
+#define ECase(X) IO.enumCase(Value, #X, ELF::X)
+  ECase(STB_LOCAL);
+  ECase(STB_GLOBAL);
+  ECase(STB_WEAK);
+  ECase(STB_GNU_UNIQUE);
+#undef ECase
+  IO.enumFallback<Hex8>(Value);
+}
+
 void ScalarEnumerationTraits<ELFYAML::ELF_STT>::enumeration(
     IO &IO, ELFYAML::ELF_STT &Value) {
 #define ECase(X) IO.enumCase(Value, #X, ELF::X)
@@ -845,9 +856,9 @@ void MappingTraits<ELFYAML::Symbol>::map
   IO.mapOptional("Type", Symbol.Type, ELFYAML::ELF_STT(0));
   IO.mapOptional("Section", Symbol.Section, StringRef());
   IO.mapOptional("Index", Symbol.Index);
+  IO.mapOptional("Binding", Symbol.Binding, ELFYAML::ELF_STB(0));
   IO.mapOptional("Value", Symbol.Value, Hex64(0));
   IO.mapOptional("Size", Symbol.Size, Hex64(0));
-
   MappingNormalization<NormalizedOther, uint8_t> Keys(IO, Symbol.Other);
   IO.mapOptional("Visibility", Keys->Visibility, ELFYAML::ELF_STV(0));
   IO.mapOptional("Other", Keys->Other, ELFYAML::ELF_STO(0));
@@ -864,14 +875,6 @@ StringRef MappingTraits<ELFYAML::Symbol>
   return StringRef();
 }
 
-void MappingTraits<ELFYAML::SymbolsDef>::mapping(IO &IO,
-                                                 ELFYAML::SymbolsDef &Symbols) {
-  IO.mapOptional("Local", Symbols.Local);
-  IO.mapOptional("Global", Symbols.Global);
-  IO.mapOptional("Weak", Symbols.Weak);
-  IO.mapOptional("GNUUnique", Symbols.GNUUnique);
-}
-
 static void commonSectionMapping(IO &IO, ELFYAML::Section &Section) {
   IO.mapOptional("Name", Section.Name, StringRef());
   IO.mapRequired("Type", Section.Type);

Modified: llvm/trunk/test/DebugInfo/invalid-relocations.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/invalid-relocations.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/invalid-relocations.test (original)
+++ llvm/trunk/test/DebugInfo/invalid-relocations.test Wed Apr  3 07:53:42 2019
@@ -28,8 +28,8 @@ Sections:
         Symbol:          _start
         Type:            0xFF
 Symbols:
-  Global:
-    - Name:     _start
-      Type:     STT_FUNC
-      Section:  .text
-      Value:    0x0
+  - Name:     _start
+    Type:     STT_FUNC
+    Section:  .text
+    Value:    0x0
+    Binding:  STB_GLOBAL

Modified: llvm/trunk/test/Object/AArch64/yaml2obj-elf-aarch64-rel.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/AArch64/yaml2obj-elf-aarch64-rel.yaml?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/Object/AArch64/yaml2obj-elf-aarch64-rel.yaml (original)
+++ llvm/trunk/test/Object/AArch64/yaml2obj-elf-aarch64-rel.yaml Wed Apr  3 07:53:42 2019
@@ -43,13 +43,11 @@ Sections:
         Addend:          0
 
 Symbols:
-  Local:
-    - Name:            .text
-      Type:            STT_SECTION
-      Section:         .text
-
-  Global:
-    - Name:            main
-      Type:            STT_FUNC
-      Section:         .text
-      Size:            0x08
+  - Name:            .text
+    Type:            STT_SECTION
+    Section:         .text
+  - Name:            main
+    Type:            STT_FUNC
+    Section:         .text
+    Size:            0x08
+    Binding:         STB_GLOBAL

Modified: llvm/trunk/test/Object/AMDGPU/elf64-relocs.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/AMDGPU/elf64-relocs.yaml?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/Object/AMDGPU/elf64-relocs.yaml (original)
+++ llvm/trunk/test/Object/AMDGPU/elf64-relocs.yaml Wed Apr  3 07:53:42 2019
@@ -65,13 +65,11 @@ Sections:
         Type:            R_AMDGPU_RELATIVE64
 
 Symbols:
-  Local:
-    - Name:            .text
-      Type:            STT_SECTION
-      Section:         .text
-
-  Global:
-    - Name:            main
-      Type:            STT_FUNC
-      Section:         .text
-      Size:            0x08
+  - Name:            .text
+    Type:            STT_SECTION
+    Section:         .text
+  - Name:            main
+    Type:            STT_FUNC
+    Section:         .text
+    Size:            0x08
+    Binding:         STB_GLOBAL

Modified: llvm/trunk/test/Object/Lanai/yaml2obj-elf-lanai-rel.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/Lanai/yaml2obj-elf-lanai-rel.yaml?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/Object/Lanai/yaml2obj-elf-lanai-rel.yaml (original)
+++ llvm/trunk/test/Object/Lanai/yaml2obj-elf-lanai-rel.yaml Wed Apr  3 07:53:42 2019
@@ -49,13 +49,11 @@ Sections:
 
 
 Symbols:
-  Local:
-    - Name:            .text
-      Type:            STT_SECTION
-      Section:         .text
-
-  Global:
-    - Name:            main
-      Type:            STT_FUNC
-      Section:         .text
-      Size:            0x08
+  - Name:            .text
+    Type:            STT_SECTION
+    Section:         .text
+  - Name:            main
+    Type:            STT_FUNC
+    Section:         .text
+    Size:            0x08
+    Binding:         STB_GLOBAL

Modified: llvm/trunk/test/Object/Mips/abi-flags.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/Mips/abi-flags.yaml?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/Object/Mips/abi-flags.yaml (original)
+++ llvm/trunk/test/Object/Mips/abi-flags.yaml Wed Apr  3 07:53:42 2019
@@ -59,7 +59,6 @@ Sections:
   Flags2:       0x0
 
 Symbols:
-  Local:
-    - Name:    .MIPS.abiflags
-      Type:    STT_SECTION
-      Section: .MIPS.abiflags
+  - Name:    .MIPS.abiflags
+    Type:    STT_SECTION
+    Section: .MIPS.abiflags

Modified: llvm/trunk/test/Object/Mips/elf-abi.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/Mips/elf-abi.yaml?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/Object/Mips/elf-abi.yaml (original)
+++ llvm/trunk/test/Object/Mips/elf-abi.yaml Wed Apr  3 07:53:42 2019
@@ -62,11 +62,11 @@ Sections:
     Size:            4
 
 Symbols:
-  Global:
-    - Name:    T1
-      Section: .text
-      Value:   0
-      Size:    4
+  - Name:    T1
+    Section: .text
+    Value:   0
+    Size:    4
+    Binding: STB_GLOBAL
 
 # o64
 --- !ELF
@@ -84,11 +84,11 @@ Sections:
     Size:            4
 
 Symbols:
-  Global:
-    - Name:    T1
-      Section: .text
-      Value:   0
-      Size:    4
+  - Name:    T1
+    Section: .text
+    Value:   0
+    Size:    4
+    Binding:  STB_GLOBAL
 
 # eabio32
 --- !ELF
@@ -106,11 +106,11 @@ Sections:
     Size:            4
 
 Symbols:
-  Global:
-    - Name:    T1
-      Section: .text
-      Value:   0
-      Size:    4
+  - Name:    T1
+    Section: .text
+    Value:   0
+    Size:    4
+    Binding:  STB_GLOBAL
 
 # eabi64
 --- !ELF
@@ -128,9 +128,9 @@ Sections:
     Size:            4
 
 Symbols:
-  Global:
-    - Name:    T1
-      Section: .text
-      Value:   0
-      Size:    4
+  - Name:    T1
+    Section: .text
+    Value:   0
+    Size:    4
+    Binding:  STB_GLOBAL
 ...

Modified: llvm/trunk/test/Object/Mips/elf-flags.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/Mips/elf-flags.yaml?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/Object/Mips/elf-flags.yaml (original)
+++ llvm/trunk/test/Object/Mips/elf-flags.yaml Wed Apr  3 07:53:42 2019
@@ -44,9 +44,9 @@ Sections:
     Size:          4
 
 Symbols:
-  Global:
-    - Name:    T1
-      Section: .text
-      Value:   0
-      Size:    4
+  - Name:    T1
+    Section: .text
+    Value:   0
+    Size:    4
+    Binding: STB_GLOBAL
 ...

Modified: llvm/trunk/test/Object/Mips/elf-mips64-rel.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/Mips/elf-mips64-rel.yaml?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/Object/Mips/elf-mips64-rel.yaml (original)
+++ llvm/trunk/test/Object/Mips/elf-mips64-rel.yaml Wed Apr  3 07:53:42 2019
@@ -98,17 +98,17 @@ Sections:
     Size:            0x0F
 
 Symbols:
-  Local:
-    - Name:            .text
-      Type:            STT_SECTION
-      Section:         .text
-    - Name:            .rodata
-      Type:            STT_SECTION
-      Section:         .rodata
-  Global:
-    - Name:            main
-      Type:            STT_FUNC
-      Section:         .text
-      Size:            0x58
-    - Name:            printf
+  - Name:            .text
+    Type:            STT_SECTION
+    Section:         .text
+  - Name:            .rodata
+    Type:            STT_SECTION
+    Section:         .rodata
+  - Name:            main
+    Type:            STT_FUNC
+    Section:         .text
+    Size:            0x58
+    Binding:         STB_GLOBAL
+  - Name:            printf
+    Binding:         STB_GLOBAL
 ...

Modified: llvm/trunk/test/Object/X86/yaml-elf-x86-rel-broken.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/X86/yaml-elf-x86-rel-broken.yaml?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/Object/X86/yaml-elf-x86-rel-broken.yaml (original)
+++ llvm/trunk/test/Object/X86/yaml-elf-x86-rel-broken.yaml Wed Apr  3 07:53:42 2019
@@ -28,5 +28,5 @@ Sections:
         Symbol:          main
         Type:            0xFF
 Symbols:
-  Global:
-    - Name: main
+  - Name:    main
+    Binding: STB_GLOBAL

Modified: llvm/trunk/test/Object/X86/yaml2obj-elf-x86-rel.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/X86/yaml2obj-elf-x86-rel.yaml?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/Object/X86/yaml2obj-elf-x86-rel.yaml (original)
+++ llvm/trunk/test/Object/X86/yaml2obj-elf-x86-rel.yaml Wed Apr  3 07:53:42 2019
@@ -30,13 +30,11 @@ Sections:
         Type:            R_386_32
 
 Symbols:
-  Local:
-    - Name:            .text
-      Type:            STT_SECTION
-      Section:         .text
-
-  Global:
-    - Name:            main
-      Type:            STT_FUNC
-      Section:         .text
-      Size:            0x08
+  - Name:            .text
+    Type:            STT_SECTION
+    Section:         .text
+  - Name:            main
+    Type:            STT_FUNC
+    Section:         .text
+    Size:            0x08
+    Binding:         STB_GLOBAL

Modified: llvm/trunk/test/Object/obj2yaml-invalid-reloc.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/obj2yaml-invalid-reloc.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/Object/obj2yaml-invalid-reloc.test (original)
+++ llvm/trunk/test/Object/obj2yaml-invalid-reloc.test Wed Apr  3 07:53:42 2019
@@ -24,16 +24,16 @@ CHECK-NEXT:       - Offset:          0x0
 CHECK-NEXT:         Symbol:          ''
 CHECK-NEXT:         Type:            R_X86_64_NONE
 CHECK-NEXT: Symbols:
-CHECK-NEXT:   Local:
 CHECK-NEXT:     - Name:            rb_ary_new_capa
 CHECK-NEXT:       Type:            STT_FUNC
 CHECK-NEXT:       Section:         .text
 CHECK-NEXT:       Size:            0x0000000000000005
-CHECK-NEXT:   Global:
 CHECK-NEXT:     - Name:            __dtraceenabled_ruby___array-create
 CHECK-NEXT:       Index:            SHN_ABS
+CHECK-NEXT:       Binding:         STB_GLOBAL
 CHECK-NEXT:     - Name:            '$dtrace1316529.rb_ary_new_capa'
 CHECK-NEXT:       Type:            STT_FUNC
 CHECK-NEXT:       Section:         .text
+CHECK-NEXT:       Binding:         STB_GLOBAL
 CHECK-NEXT:       Size:            0x0000000000000005
 CHECK-NEXT:       Visibility:      STV_HIDDEN

Modified: llvm/trunk/test/Object/obj2yaml.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/obj2yaml.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/Object/obj2yaml.test (original)
+++ llvm/trunk/test/Object/obj2yaml.test Wed Apr  3 07:53:42 2019
@@ -421,7 +421,6 @@ ELF-MIPSEL-NEXT:     GPRSize:         RE
 ELF-MIPSEL-NEXT:     CPR1Size:        REG_32
 ELF-MIPSEL-NEXT:     Flags1:          [ ODDSPREG ]
 ELF-MIPSEL-NEXT: Symbols:
-ELF-MIPSEL-NEXT:   Local:
 ELF-MIPSEL-NEXT:     - Name:            trivial.ll
 ELF-MIPSEL-NEXT:       Type:            STT_FILE
 ELF-MIPSEL-NEXT:       Index:           SHN_ABS
@@ -450,18 +449,22 @@ ELF-MIPSEL-NEXT:       Section:
 ELF-MIPSEL-NEXT:     - Name:            .MIPS.abiflags
 ELF-MIPSEL-NEXT:       Type:            STT_SECTION
 ELF-MIPSEL-NEXT:       Section:         .MIPS.abiflags
-ELF-MIPSEL-NEXT:   Global:
 ELF-MIPSEL-NEXT:     - Name:            main
 ELF-MIPSEL-NEXT:       Type:            STT_FUNC
 ELF-MIPSEL-NEXT:       Section:         .text
+ELF-MIPSEL-NEXT:       Binding:         STB_GLOBAL
 ELF-MIPSEL-NEXT:       Size:            0x000000000000004C
 ELF-MIPSEL-NEXT:     - Name:            var
 ELF-MIPSEL-NEXT:       Type:            STT_OBJECT
 ELF-MIPSEL-NEXT:       Section:         .bss
+ELF-MIPSEL-NEXT:       Binding:         STB_GLOBAL
 ELF-MIPSEL-NEXT:       Size:            0x0000000000000004
 ELF-MIPSEL-NEXT:     - Name:            SomeOtherFunction
+ELF-MIPSEL-NEXT:       Binding:         STB_GLOBAL
 ELF-MIPSEL-NEXT:     - Name:            _gp_disp
+ELF-MIPSEL-NEXT:       Binding:         STB_GLOBAL
 ELF-MIPSEL-NEXT:     - Name:            puts
+ELF-MIPSEL-NEXT:       Binding:         STB_GLOBAL
 
 ELF-MIPS64EL:      FileHeader:
 ELF-MIPS64EL-NEXT:   Class:           ELFCLASS64
@@ -505,7 +508,6 @@ ELF-MIPS64EL-NEXT:     Type:
 ELF-MIPS64EL-NEXT:     AddressAlign:    0x0000000000000004
 ELF-MIPS64EL-NEXT:     Content:         ''
 ELF-MIPS64EL-NEXT: Symbols:
-ELF-MIPS64EL-NEXT:   Local:
 ELF-MIPS64EL-NEXT:     - Name:            .text
 ELF-MIPS64EL-NEXT:       Type:            STT_SECTION
 ELF-MIPS64EL-NEXT:       Section:         .text
@@ -523,8 +525,8 @@ ELF-MIPS64EL-NEXT:       Section:
 ELF-MIPS64EL-NEXT:     - Name:            .pdr
 ELF-MIPS64EL-NEXT:       Type:            STT_SECTION
 ELF-MIPS64EL-NEXT:       Section:         .pdr
-ELF-MIPS64EL-NEXT:   Global:
 ELF-MIPS64EL-NEXT:     - Name:            zed
+ELF-MIPS64EL-NEXT:       Binding:         STB_GLOBAL
 
 ELF-X86-64:      FileHeader:
 ELF-X86-64-NEXT:   Class:           ELFCLASS64
@@ -569,7 +571,6 @@ ELF-X86-64-NEXT:         Symbol:
 ELF-X86-64-NEXT:         Type:            R_X86_64_PC32
 ELF-X86-64-NEXT:         Addend:          -4
 ELF-X86-64-NEXT: Symbols:
-ELF-X86-64-NEXT:   Local:
 ELF-X86-64-NEXT:     - Name:            trivial-object-test.s
 ELF-X86-64-NEXT:       Type:            STT_FILE
 ELF-X86-64-NEXT:       Index:           SHN_ABS
@@ -582,14 +583,15 @@ ELF-X86-64-NEXT:       Section:
 ELF-X86-64-NEXT:     - Name:            .note.GNU-stack
 ELF-X86-64-NEXT:       Type:            STT_SECTION
 ELF-X86-64-NEXT:       Section:         .note.GNU-stack
-ELF-X86-64-NEXT:   Global:
 ELF-X86-64-NEXT:     - Name:            main
 ELF-X86-64-NEXT:       Type:            STT_FUNC
 ELF-X86-64-NEXT:       Section:         .text
+ELF-X86-64-NEXT:       Binding:         STB_GLOBAL
 ELF-X86-64-NEXT:       Size:            0x0000000000000026
 ELF-X86-64-NEXT:     - Name:            SomeOtherFunction
+ELF-X86-64-NEXT:       Binding:         STB_GLOBAL
 ELF-X86-64-NEXT:     - Name:            puts
-
+ELF-X86-64-NEXT:       Binding:         STB_GLOBAL
 
 ELF-AVR:      FileHeader:
 ELF-AVR-NEXT:   Class:           ELFCLASS32
@@ -610,7 +612,6 @@ ELF-AVR-NEXT:     Address:         0x000
 ELF-AVR-NEXT:     AddressAlign:    0x0000000000000001
 ELF-AVR-NEXT:     Content:         ''
 ELF-AVR-NEXT: Symbols:
-ELF-AVR-NEXT:   Local:
 ELF-AVR-NEXT:     - Name:           .text
 ELF-AVR-NEXT:       Type:            STT_SECTION
 ELF-AVR-NEXT:       Section:         .text
@@ -623,39 +624,49 @@ ELF-AVR-NEXT:       Type:            STT
 ELF-AVR-NEXT:       Index:           SHN_ABS
 ELF-AVR-NEXT:     - Name:            main
 ELF-AVR-NEXT:       Section:         .text
-ELF-AVR-NEXT:   Global:
 ELF-AVR-NEXT:     - Name:            __trampolines_start
 ELF-AVR-NEXT:       Section:         .text
+ELF-AVR-NEXT:       Binding:         STB_GLOBAL
 ELF-AVR-NEXT:     - Name:            _etext
 ELF-AVR-NEXT:       Section:         .text
+ELF-AVR-NEXT:       Binding:         STB_GLOBAL
 ELF-AVR-NEXT:       Value:           0x0000000000000004
 ELF-AVR-NEXT:     - Name:            __data_load_end
 ELF-AVR-NEXT:       Index:           SHN_ABS
+ELF-AVR-NEXT:       Binding:         STB_GLOBAL
 ELF-AVR-NEXT:       Value:           0x0000000000000004
 ELF-AVR-NEXT:     - Name:            __trampolines_end
 ELF-AVR-NEXT:       Section:         .text
+ELF-AVR-NEXT:       Binding:         STB_GLOBAL
 ELF-AVR-NEXT:     - Name:            __data_load_start
 ELF-AVR-NEXT:       Index:           SHN_ABS
+ELF-AVR-NEXT:       Binding:         STB_GLOBAL
 ELF-AVR-NEXT:       Value:           0x0000000000000004
 ELF-AVR-NEXT:     - Name:            __dtors_end
 ELF-AVR-NEXT:       Section:         .text
+ELF-AVR-NEXT:       Binding:         STB_GLOBAL
 ELF-AVR-NEXT:     - Name:            __eeprom_end
 ELF-AVR-NEXT:       Section:         .data
+ELF-AVR-NEXT:       Binding:         STB_GLOBAL
 ELF-AVR-NEXT:       Value:           0x0000000000810000
 ELF-AVR-NEXT:     - Name:            __ctors_start
 ELF-AVR-NEXT:       Section:         .text
+ELF-AVR-NEXT:       Binding:         STB_GLOBAL
 ELF-AVR-NEXT:     - Name:            __dtors_start
 ELF-AVR-NEXT:       Section:         .text
+ELF-AVR-NEXT:       Binding:         STB_GLOBAL
 ELF-AVR-NEXT:     - Name:            __ctors_end
 ELF-AVR-NEXT:       Section:         .text
+ELF-AVR-NEXT:       Binding:         STB_GLOBAL
 ELF-AVR-NEXT:     - Name:            _edata
 ELF-AVR-NEXT:       Section:         .data
+ELF-AVR-NEXT:       Binding:         STB_GLOBAL
 ELF-AVR-NEXT:       Value:           0x0000000000800060
 ELF-AVR-NEXT:     - Name:            _end
 ELF-AVR-NEXT:       Section:         .data
+ELF-AVR-NEXT:       Binding:         STB_GLOBAL
 ELF-AVR-NEXT:       Value:           0x0000000000800060
 
-
 WASM:      --- !WASM
 WASM-NEXT: FileHeader:
 WASM-NEXT:   Version:         0x00000001

Modified: llvm/trunk/test/Object/yaml2obj-elf-alignment.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/yaml2obj-elf-alignment.yaml?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/Object/yaml2obj-elf-alignment.yaml (original)
+++ llvm/trunk/test/Object/yaml2obj-elf-alignment.yaml Wed Apr  3 07:53:42 2019
@@ -41,13 +41,14 @@ Sections:
     Size:          4
 
 Symbols:
-  Global:
-    - Name:     T0
-      Type:     STT_FUNC
-      Section:  .text
-      Size:     4
-    - Name:     D0
-      Type:     STT_OBJECT
-      Section:  .data
-      Size:     4
+  - Name:     T0
+    Type:     STT_FUNC
+    Section:  .text
+    Size:     4
+    Binding:  STB_GLOBAL
+  - Name:     D0
+    Type:     STT_OBJECT
+    Section:  .data
+    Size:     4
+    Binding:  STB_GLOBAL
 ...

Modified: llvm/trunk/test/Object/yaml2obj-elf-multi-doc.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/yaml2obj-elf-multi-doc.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/Object/yaml2obj-elf-multi-doc.test (original)
+++ llvm/trunk/test/Object/yaml2obj-elf-multi-doc.test Wed Apr  3 07:53:42 2019
@@ -25,12 +25,12 @@ Sections:
   Flags: [SHF_EXECINSTR, SHF_ALLOC]
 
 Symbols:
-  Global:
-    - Name: T1
-      Section: .text
-      Type: STT_FUNC
-      Value: 0x0
-      Size: 8
+- Name: T1
+  Section: .text
+  Type: STT_FUNC
+  Value: 0x0
+  Size: 8
+  Binding: STB_GLOBAL
 
 --- !ELF
 FileHeader: !FileHeader
@@ -47,10 +47,10 @@ Sections:
   Flags: [SHF_EXECINSTR, SHF_ALLOC]
 
 Symbols:
-  Global:
-    - Name: T2
-      Section: .text
-      Type: STT_FUNC
-      Value: 0x0
-      Size: 4
+- Name:    T2
+  Section: .text
+  Type:    STT_FUNC
+  Value:   0x0
+  Size:    4
+  Binding: STB_GLOBAL
 ...

Modified: llvm/trunk/test/Object/yaml2obj-elf-rel-noref.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/yaml2obj-elf-rel-noref.yaml?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/Object/yaml2obj-elf-rel-noref.yaml (original)
+++ llvm/trunk/test/Object/yaml2obj-elf-rel-noref.yaml Wed Apr  3 07:53:42 2019
@@ -36,25 +36,24 @@ Sections:
     Type:            SHT_ARM_ATTRIBUTES
     AddressAlign:    0x0000000000000001
     Content:         4115000000616561626900010B000000060208010901
-Symbols:         
-  Local:           
-    - Name:            .text
-      Type:            STT_SECTION
-      Section:         .text
-    - Name:            .data
-      Type:            STT_SECTION
-      Section:         .data
-    - Name:            .bss
-      Type:            STT_SECTION
-      Section:         .bss
-    - Name:            '$a'
-      Section:         .text
-    - Name:            call_weak_fn
-      Type:            STT_FUNC
-      Section:         .text
-    - Name:            .ARM.attributes
-      Type:            STT_SECTION
-      Section:         .ARM.attributes
+Symbols:
+  - Name:            .text
+    Type:            STT_SECTION
+    Section:         .text
+  - Name:            .data
+    Type:            STT_SECTION
+    Section:         .data
+  - Name:            .bss
+    Type:            STT_SECTION
+    Section:         .bss
+  - Name:            '$a'
+    Section:         .text
+  - Name:            call_weak_fn
+    Type:            STT_FUNC
+    Section:         .text
+  - Name:            .ARM.attributes
+    Type:            STT_SECTION
+    Section:         .ARM.attributes
 
 # CHECK:        Section {
 # CHECK-NEXT:     Index: 0

Modified: llvm/trunk/test/Object/yaml2obj-elf-rel.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/yaml2obj-elf-rel.yaml?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/Object/yaml2obj-elf-rel.yaml (original)
+++ llvm/trunk/test/Object/yaml2obj-elf-rel.yaml Wed Apr  3 07:53:42 2019
@@ -49,17 +49,17 @@ Sections:
       Type: R_MIPS_LO16
 
 Symbols:
-  Local:
-    - Name: loc1
-    - Name: loc2
-  Global:
-    - Name: glob1
-      Section: .text
-      Value: 0x0
-      Size: 4
-    - Name: glob2
-  Weak:
-    - Name: weak1
+  - Name:    loc1
+  - Name:    loc2
+  - Name:    glob1
+    Section: .text
+    Value:   0x0
+    Size:    4
+    Binding: STB_GLOBAL
+  - Name:    glob2
+    Binding: STB_GLOBAL
+  - Name:    weak1
+    Binding: STB_WEAK
 
 # CHECK:        Section {
 # CHECK-NEXT:     Index: 0

Modified: llvm/trunk/test/Object/yaml2obj-elf-symbol-LocalGlobalWeak.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/yaml2obj-elf-symbol-LocalGlobalWeak.yaml?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/Object/yaml2obj-elf-symbol-LocalGlobalWeak.yaml (original)
+++ llvm/trunk/test/Object/yaml2obj-elf-symbol-LocalGlobalWeak.yaml Wed Apr  3 07:53:42 2019
@@ -11,18 +11,17 @@ Sections:
     Flags: [ SHF_ALLOC, SHF_WRITE ]
     Content: "DEADBEEF"
 Symbols:
-  Local:
-    - Name: local_symbol
-      Type: STT_OBJECT
-      Section: .data
-  Global:
-    - Name: global_symbol
-      Type: STT_OBJECT
-      Section: .data
-  Weak:
-    - Name: weak_symbol
-      Type: STT_OBJECT
-      Section: .data
+  - Name:    local_symbol
+    Type:    STT_OBJECT
+    Section: .data
+  - Name:    global_symbol
+    Type:    STT_OBJECT
+    Section: .data
+    Binding: STB_GLOBAL
+  - Name:    weak_symbol
+    Type:    STT_OBJECT
+    Section: .data
+    Binding: STB_WEAK
 
 # CHECK: Symbol {
 # CHECK:   Name:  (0)

Modified: llvm/trunk/test/Object/yaml2obj-elf-symbol-basic.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/yaml2obj-elf-symbol-basic.yaml?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/Object/yaml2obj-elf-symbol-basic.yaml (original)
+++ llvm/trunk/test/Object/yaml2obj-elf-symbol-basic.yaml Wed Apr  3 07:53:42 2019
@@ -18,13 +18,14 @@ Sections:
                       # when linked and run on x86_64, will go into an
                       # infloop.
 Symbols:
-  Global:
-    - Name: main
-      Type: STT_FUNC
-      Section: .text
-      Value: 0x1
-      Size: 2
-    - Name: undefined_symbol
+  - Name: main
+    Type: STT_FUNC
+    Section: .text
+    Value: 0x1
+    Size: 2
+    Binding: STB_GLOBAL
+  - Name: undefined_symbol
+    Binding: STB_GLOBAL
 
 # CHECK:      Symbols [
 # CHECK-NEXT:   Symbol {

Modified: llvm/trunk/test/Object/yaml2obj-elf-symbol-visibility.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/yaml2obj-elf-symbol-visibility.yaml?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/Object/yaml2obj-elf-symbol-visibility.yaml (original)
+++ llvm/trunk/test/Object/yaml2obj-elf-symbol-visibility.yaml Wed Apr  3 07:53:42 2019
@@ -57,35 +57,39 @@
 # OBJ-NEXT: }
 
 # YAML:      Symbols:
-# YAML-NEXT:   Global:
-# YAML-NEXT:     - Name:            default1
-# YAML-NEXT:       Type:            STT_OBJECT
-# YAML-NEXT:       Section:         .data
-# YAML-NEXT:       Size:            0x0000000000000004
-# YAML-NEXT:     - Name:            default2
-# YAML-NEXT:       Type:            STT_OBJECT
-# YAML-NEXT:       Section:         .data
-# YAML-NEXT:       Value:           0x0000000000000004
-# YAML-NEXT:       Size:            0x0000000000000004
-# YAML-NEXT:     - Name:            internal
-# YAML-NEXT:       Type:            STT_OBJECT
-# YAML-NEXT:       Section:         .data
-# YAML-NEXT:       Value:           0x0000000000000008
-# YAML-NEXT:       Size:            0x0000000000000004
-# YAML-NEXT:       Visibility:      STV_INTERNAL
-# YAML-NEXT:     - Name:            hidden
-# YAML-NEXT:       Type:            STT_OBJECT
-# YAML-NEXT:       Section:         .data
-# YAML-NEXT:       Value:           0x000000000000000C
-# YAML-NEXT:       Size:            0x0000000000000004
-# YAML-NEXT:       Visibility:      STV_HIDDEN
-# YAML-NEXT:     - Name:            protected
-# YAML-NEXT:       Type:            STT_OBJECT
-# YAML-NEXT:       Section:         .data
-# YAML-NEXT:       Value:           0x0000000000000010
-# YAML-NEXT:       Size:            0x0000000000000004
-# YAML-NEXT:       Visibility:      STV_PROTECTED
-# YAML-NEXT:       Other:           [ STO_MIPS_PIC, STO_MIPS_MICROMIPS ]
+# YAML-NEXT:   - Name:            default1
+# YAML-NEXT:     Type:            STT_OBJECT
+# YAML-NEXT:     Section:         .data
+# YAML-NEXT:     Binding:         STB_GLOBAL
+# YAML-NEXT:     Size:            0x0000000000000004
+# YAML-NEXT:   - Name:            default2
+# YAML-NEXT:     Type:            STT_OBJECT
+# YAML-NEXT:     Section:         .data
+# YAML-NEXT:     Binding:         STB_GLOBAL
+# YAML-NEXT:     Value:           0x0000000000000004
+# YAML-NEXT:     Size:            0x0000000000000004
+# YAML-NEXT:   - Name:            internal
+# YAML-NEXT:     Type:            STT_OBJECT
+# YAML-NEXT:     Section:         .data
+# YAML-NEXT:     Binding:         STB_GLOBAL
+# YAML-NEXT:     Value:           0x0000000000000008
+# YAML-NEXT:     Size:            0x0000000000000004
+# YAML-NEXT:     Visibility:      STV_INTERNAL
+# YAML-NEXT:   - Name:            hidden
+# YAML-NEXT:     Type:            STT_OBJECT
+# YAML-NEXT:     Section:         .data
+# YAML-NEXT:     Binding:         STB_GLOBAL
+# YAML-NEXT:     Value:           0x000000000000000C
+# YAML-NEXT:     Size:            0x0000000000000004
+# YAML-NEXT:     Visibility:      STV_HIDDEN
+# YAML-NEXT:   - Name:            protected
+# YAML-NEXT:     Type:            STT_OBJECT
+# YAML-NEXT:     Section:         .data
+# YAML-NEXT:     Binding:         STB_GLOBAL
+# YAML-NEXT:     Value:           0x0000000000000010
+# YAML-NEXT:     Size:            0x0000000000000004
+# YAML-NEXT:     Visibility:      STV_PROTECTED
+# YAML-NEXT:     Other:           [ STO_MIPS_PIC, STO_MIPS_MICROMIPS ]
 
 --- !ELF
 FileHeader:
@@ -103,34 +107,38 @@ Sections:
     Size:            0x14
 
 Symbols:
-  Global:
-    - Name:            default1
-      Type:            STT_OBJECT
-      Visibility:      STV_DEFAULT
-      Section:         .data
-      Value:           0x00
-      Size:            0x04
-    - Name:            default2
-      Type:            STT_OBJECT
-      Section:         .data
-      Value:           0x04
-      Size:            0x04
-    - Name:            internal
-      Type:            STT_OBJECT
-      Visibility:      STV_INTERNAL
-      Section:         .data
-      Value:           0x08
-      Size:            0x04
-    - Name:            hidden
-      Type:            STT_OBJECT
-      Visibility:      STV_HIDDEN
-      Section:         .data
-      Value:           0x0C
-      Size:            0x04
-    - Name:            protected
-      Type:            STT_OBJECT
-      Visibility:      STV_PROTECTED
-      Other:           [ STO_MIPS_MICROMIPS, STO_MIPS_PIC ]
-      Section:         .data
-      Value:           0x10
-      Size:            0x04
+  - Name:            default1
+    Type:            STT_OBJECT
+    Visibility:      STV_DEFAULT
+    Section:         .data
+    Value:           0x00
+    Size:            0x04
+    Binding:         STB_GLOBAL
+  - Name:            default2
+    Type:            STT_OBJECT
+    Section:         .data
+    Value:           0x04
+    Size:            0x04
+    Binding:         STB_GLOBAL
+  - Name:            internal
+    Type:            STT_OBJECT
+    Visibility:      STV_INTERNAL
+    Section:         .data
+    Value:           0x08
+    Size:            0x04
+    Binding:         STB_GLOBAL
+  - Name:            hidden
+    Type:            STT_OBJECT
+    Visibility:      STV_HIDDEN
+    Section:         .data
+    Value:           0x0C
+    Size:            0x04
+    Binding:         STB_GLOBAL
+  - Name:            protected
+    Type:            STT_OBJECT
+    Visibility:      STV_PROTECTED
+    Other:           [ STO_MIPS_MICROMIPS, STO_MIPS_PIC ]
+    Section:         .data
+    Value:           0x10
+    Size:            0x04
+    Binding:         STB_GLOBAL

Modified: llvm/trunk/test/tools/llvm-ar/Inputs/add-lib1.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-ar/Inputs/add-lib1.yaml?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-ar/Inputs/add-lib1.yaml (original)
+++ llvm/trunk/test/tools/llvm-ar/Inputs/add-lib1.yaml Wed Apr  3 07:53:42 2019
@@ -20,11 +20,10 @@ Sections:
     AddressAlign:    0x0000000000000001
     Content:         ''
 Symbols:
-  Global:
-    - Name:     lib1
-      Index:    SHN_ABS
-      Value:    0x1234
-  Local:
-    - Name:            '-'
-      Type:            STT_FILE
+  - Name:    '-'
+    Type:    STT_FILE
+  - Name:    lib1
+    Index:   SHN_ABS
+    Value:   0x1234
+    Binding: STB_GLOBAL
 ...

Modified: llvm/trunk/test/tools/llvm-ar/Inputs/add-lib2.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-ar/Inputs/add-lib2.yaml?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-ar/Inputs/add-lib2.yaml (original)
+++ llvm/trunk/test/tools/llvm-ar/Inputs/add-lib2.yaml Wed Apr  3 07:53:42 2019
@@ -20,11 +20,10 @@ Sections:
     AddressAlign:    0x0000000000000001
     Content:         ''
 Symbols:
-  Global:
-    - Name:     lib2
-      Index:    SHN_ABS
-      Value:    0x1234
-  Local:
-    - Name:            '-'
-      Type:            STT_FILE
+  - Name:    '-'
+    Type:    STT_FILE
+  - Name:    lib2
+    Index:   SHN_ABS
+    Value:   0x1234
+    Binding: STB_GLOBAL
 ...

Modified: llvm/trunk/test/tools/llvm-ar/Inputs/add-lib3.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-ar/Inputs/add-lib3.yaml?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-ar/Inputs/add-lib3.yaml (original)
+++ llvm/trunk/test/tools/llvm-ar/Inputs/add-lib3.yaml Wed Apr  3 07:53:42 2019
@@ -20,11 +20,10 @@ Sections:
     AddressAlign:    0x0000000000000001
     Content:         ''
 Symbols:
-  Global:
-    - Name:     lib3
-      Index:    SHN_ABS
-      Value:    0x1234
-  Local:
-    - Name:            '-'
-      Type:            STT_FILE
+  - Name:    '-'
+    Type:    STT_FILE
+  - Name:    lib3
+    Index:   SHN_ABS
+    Value:   0x1234
+    Binding: STB_GLOBAL
 ...

Modified: llvm/trunk/test/tools/llvm-ar/Inputs/elf.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-ar/Inputs/elf.yaml?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-ar/Inputs/elf.yaml (original)
+++ llvm/trunk/test/tools/llvm-ar/Inputs/elf.yaml Wed Apr  3 07:53:42 2019
@@ -20,7 +20,6 @@ Sections:
     AddressAlign:    0x0000000000000001
     Content:         ''
 Symbols:
-  Local:
-    - Name:            '-'
-      Type:            STT_FILE
+  - Name:            '-'
+    Type:            STT_FILE
 ...

Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/Inputs/compress-debug-sections.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/Inputs/compress-debug-sections.yaml?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/Inputs/compress-debug-sections.yaml (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/Inputs/compress-debug-sections.yaml Wed Apr  3 07:53:42 2019
@@ -44,15 +44,18 @@ Sections:
     Flags:           [ SHF_GROUP ]
     Content:         '00'
 Symbols:
-  Global:
-    - Name:    .debug_foo
-      Type:    STT_SECTION
-      Section: .debug_foo
-    - Name:    .notdebug_foo
-      Type:    STT_SECTION
-      Section: .notdebug_foo
-    - Name:    .Linfo_string0
-      Section: .debug_bar
-    - Name:    groupname
-      Section: .group
+  - Name:    .debug_foo
+    Type:    STT_SECTION
+    Section: .debug_foo
+    Binding:  STB_GLOBAL
+  - Name:    .notdebug_foo
+    Type:    STT_SECTION
+    Section: .notdebug_foo
+    Binding:  STB_GLOBAL
+  - Name:    .Linfo_string0
+    Section: .debug_bar
+    Binding:  STB_GLOBAL
+  - Name:    groupname
+    Section: .group
+    Binding:  STB_GLOBAL
 ...

Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/abs-symbol.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/abs-symbol.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/abs-symbol.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/abs-symbol.test Wed Apr  3 07:53:42 2019
@@ -9,10 +9,10 @@ FileHeader:
   Type:            ET_EXEC
   Machine:         EM_X86_64
 Symbols:
-  Global:
-    - Name:     test
-      Index:    SHN_ABS
-      Value:    0x1234
+  - Name:     test
+    Index:    SHN_ABS
+    Value:    0x1234
+    Binding:  STB_GLOBAL
 
 #CHECK:     Symbols [
 #CHECK-NEXT:   Symbol {

Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/armexidx-link.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/armexidx-link.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/armexidx-link.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/armexidx-link.test Wed Apr  3 07:53:42 2019
@@ -36,13 +36,12 @@ Sections:
     AddressAlign:    0x0000000000000004
     Content:         ''
 Symbols:         
-  Local:           
-    - Name:            .text.bar
-      Type:            STT_SECTION
-      Section:         .text.bar
-    - Name:            .text.foo
-      Type:            STT_SECTION
-      Section:         .text.foo
-    - Name:            .ARM.exidx.text.foo
-      Type:            STT_SECTION
-      Section:         .ARM.exidx.text.foo
+  - Name:            .text.bar
+    Type:            STT_SECTION
+    Section:         .text.bar
+  - Name:            .text.foo
+    Type:            STT_SECTION
+    Section:         .text.foo
+  - Name:            .ARM.exidx.text.foo
+    Type:            STT_SECTION
+    Section:         .ARM.exidx.text.foo

Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/basic-archive-copy.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/basic-archive-copy.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/basic-archive-copy.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/basic-archive-copy.test Wed Apr  3 07:53:42 2019
@@ -47,11 +47,11 @@ Sections:
     AddressAlign:    0x0000000000000010
     Content:         "00000000"
 Symbols:
-   Global:
-     - Name:     foo
-       Type:     STT_FUNC
-       Section:  .text
-       Value:    0x1004
+  - Name:     foo
+    Type:     STT_FUNC
+    Section:  .text
+    Value:    0x1004
+    Binding:  STB_GLOBAL
 
 # CHECK: Type: SHT_NULL
 

Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/basic-relocations.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/basic-relocations.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/basic-relocations.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/basic-relocations.test Wed Apr  3 07:53:42 2019
@@ -56,24 +56,28 @@ Sections:
         Type:   R_X86_64_PC32
         Addend: 0x13
 Symbols:
-  Global:
-    - Name:     _start
-      Type:     STT_FUNC
-      Section:  .text
-      Value:    0x1000
-      Size:     4
-    - Name:     foo
-      Type:     STT_FUNC
-      Size:     4
-    - Name:     fooA
-      Type:     STT_FUNC
-      Size:     4
-    - Name:     bar
-      Type:     STT_OBJECT
-      Size:     4
-    - Name:     barA
-      Type:     STT_OBJECT
-      Size:     4
+  - Name:     _start
+    Type:     STT_FUNC
+    Section:  .text
+    Value:    0x1000
+    Size:     4
+    Binding:  STB_GLOBAL
+  - Name:     foo
+    Type:     STT_FUNC
+    Size:     4
+    Binding:  STB_GLOBAL
+  - Name:     fooA
+    Type:     STT_FUNC
+    Size:     4
+    Binding:  STB_GLOBAL
+  - Name:     bar
+    Type:     STT_OBJECT
+    Size:     4
+    Binding:  STB_GLOBAL
+  - Name:     barA
+    Type:     STT_OBJECT
+    Size:     4
+    Binding:  STB_GLOBAL
 
 # CHECK:     Relocations [
 # CHECK-NEXT:  Section (2) .rel.text {

Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/common-symbol.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/common-symbol.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/common-symbol.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/common-symbol.test Wed Apr  3 07:53:42 2019
@@ -9,22 +9,26 @@ FileHeader:
   Type:            ET_EXEC
   Machine:         EM_HEXAGON
 Symbols:
-  Global:
-    - Name:     test
-      Index:    SHN_COMMON
-      Value:    0x1234
-    - Name:     test2
-      Index:    SHN_HEXAGON_SCOMMON
-      Value:    0x1235
-    - Name:     test3
-      Index:    SHN_HEXAGON_SCOMMON_2
-      Value:    0x1236
-    - Name:     test4
-      Index:    SHN_HEXAGON_SCOMMON_4
-      Value:    0x1237
-    - Name:     test5
-      Index:    SHN_HEXAGON_SCOMMON_8
-      Value:    0x1238
+  - Name:     test
+    Index:    SHN_COMMON
+    Value:    0x1234
+    Binding:  STB_GLOBAL
+  - Name:     test2
+    Index:    SHN_HEXAGON_SCOMMON
+    Value:    0x1235
+    Binding:  STB_GLOBAL
+  - Name:     test3
+    Index:    SHN_HEXAGON_SCOMMON_2
+    Value:    0x1236
+    Binding:  STB_GLOBAL
+  - Name:     test4
+    Index:    SHN_HEXAGON_SCOMMON_4
+    Value:    0x1237
+    Binding:  STB_GLOBAL
+  - Name:     test5
+    Index:    SHN_HEXAGON_SCOMMON_8
+    Value:    0x1238
+    Binding:  STB_GLOBAL
 
 #CHECK:     Symbols [
 #CHECK-NEXT:   Symbol {

Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/cross-arch-headers.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/cross-arch-headers.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/cross-arch-headers.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/cross-arch-headers.test Wed Apr  3 07:53:42 2019
@@ -53,15 +53,16 @@ Sections:
     Type:            SHT_PROGBITS
     Flags:           [ SHF_ALLOC ]
 Symbols:
-  Global:
-    - Name:     foo
-      Type:     STT_FUNC
-      Section:  .text
-      Value:    0x1234
-    - Name:     bar
-      Type:     STT_OBJECT
-      Section:  .data
-      Value:    0xabcd
+  - Name:     foo
+    Type:     STT_FUNC
+    Section:  .text
+    Value:    0x1234
+    Binding:  STB_GLOBAL
+  - Name:     bar
+    Type:     STT_OBJECT
+    Section:  .data
+    Value:    0xabcd
+    Binding:  STB_GLOBAL
 
 # CHECK: Format:
 # 32-SAME:      ELF32-

Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/cross-arch-sections-symbols.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/cross-arch-sections-symbols.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/cross-arch-sections-symbols.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/cross-arch-sections-symbols.test Wed Apr  3 07:53:42 2019
@@ -22,16 +22,17 @@ Sections:
     Content:         DEADBEEF
     Size:            16
 Symbols:
-  Global:
-    - Name:     foo
-      Type:     STT_FUNC
-      Section:  .text
-      Value:    16
-      Size:     8
-    - Name:     bar
-      Type:     STT_OBJECT
-      Section:  .data
-      Size:     16
+  - Name:     foo
+    Type:     STT_FUNC
+    Section:  .text
+    Value:    16
+    Size:     8
+    Binding:  STB_GLOBAL
+  - Name:     bar
+    Type:     STT_OBJECT
+    Section:  .data
+    Size:     16
+    Binding:  STB_GLOBAL
 
 # CHECK:      Sections [
 # CHECK-NEXT:   Section {

Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/discard-all.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/discard-all.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/discard-all.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/discard-all.test Wed Apr  3 07:53:42 2019
@@ -33,29 +33,28 @@ Sections:
     AddressAlign:    0x0000000000000010
     Size:            64
 Symbols:
-  Local:
-    - Name:     Local
-      Type:     STT_FUNC
-      Section:  .text
-      Value:    0x1000
-      Size:     8
-    - Name:     LocalSection
-      Type:     STT_SECTION
-      Section:  .text
-    - Name:     LocalFile
-      Type:     STT_FILE
-  Weak:
-    - Name:     Weak
-      Type:     STT_FUNC
-      Size:     8
-      Section:  .text
-      Value:    0x1008
-  Global:
-    - Name:     Global
-      Type:     STT_FUNC
-      Size:     8
-      Section:  .text
-      Value:    0x1010
+  - Name:     Local
+    Type:     STT_FUNC
+    Section:  .text
+    Value:    0x1000
+    Size:     8
+  - Name:     LocalSection
+    Type:     STT_SECTION
+    Section:  .text
+  - Name:     LocalFile
+    Type:     STT_FILE
+  - Name:     Global
+    Type:     STT_FUNC
+    Size:     8
+    Section:  .text
+    Value:    0x1010
+    Binding:  STB_GLOBAL
+  - Name:     Weak
+    Type:     STT_FUNC
+    Size:     8
+    Section:  .text
+    Value:    0x1008
+    Binding:  STB_WEAK
 
 #CHECK: Symbols [
 #CHECK-NEXT:  Symbol {

Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/discard-locals-rel.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/discard-locals-rel.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/discard-locals-rel.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/discard-locals-rel.test Wed Apr  3 07:53:42 2019
@@ -19,9 +19,8 @@ Sections:
         Symbol: .L.rel
         Type:   R_X86_64_PC32
 Symbols:
-  Local:
-    - Name:     .L.rel
-      Type:     STT_FUNC
-      Section:  .text
+  - Name:     .L.rel
+    Type:     STT_FUNC
+    Section:  .text
 
 # CHECK: not stripping symbol '.L.rel' because it is named in a relocation.

Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/discard-locals.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/discard-locals.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/discard-locals.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/discard-locals.test Wed Apr  3 07:53:42 2019
@@ -32,27 +32,26 @@ Sections:
   - Name:            .LLVM.Custom.Section
     Type:            SHT_PROGBITS
 Symbols:
-  Local:
-    - Name:     Local
-      Type:     STT_FUNC
-      Section:  .text
-    - Name:     .L.LocalSection
-      Type:     STT_SECTION
-      Section:  .text
-    - Type:     STT_SECTION
-      Section:  .LLVM.Custom.Section
-    - Name:     .L.LocalFile
-      Type:     STT_FILE
-    - Name:     .L.str
-      Type:     STT_OBJECT
-      Section:  .text
-    - Name:     .L.undefined
-    - Name:     .L.abs
-      Index:    SHN_ABS
-  Global:
-    - Name:     .L.Global
-      Type:     STT_FUNC
-      Section:  .text
+  - Name:     Local
+    Type:     STT_FUNC
+    Section:  .text
+  - Name:     .L.LocalSection
+    Type:     STT_SECTION
+    Section:  .text
+  - Type:     STT_SECTION
+    Section:  .LLVM.Custom.Section
+  - Name:     .L.LocalFile
+    Type:     STT_FILE
+  - Name:     .L.str
+    Type:     STT_OBJECT
+    Section:  .text
+  - Name:     .L.undefined
+  - Name:     .L.abs
+    Index:    SHN_ABS
+  - Name:     .L.Global
+    Type:     STT_FUNC
+    Section:  .text
+    Binding:  STB_GLOBAL
 
 # CHECK:      Symbols [
 # CHECK-NEXT:   Symbol {

Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/discard-mix-local-and-all.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/discard-mix-local-and-all.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/discard-mix-local-and-all.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/discard-mix-local-and-all.test Wed Apr  3 07:53:42 2019
@@ -55,17 +55,16 @@ Sections:
   - Name:            .text
     Type:            SHT_PROGBITS
 Symbols:
-  Local:
-    - Name:     Local
-      Type:     STT_FUNC
-      Section:  .text
-    - Name:     .L.str
-      Type:     STT_OBJECT
-      Section:  .text
-  Global:
-    - Name:     Global
-      Type:     STT_FUNC
-      Section:  .text
+  - Name:     Local
+    Type:     STT_FUNC
+    Section:  .text
+  - Name:     .L.str
+    Type:     STT_OBJECT
+    Section:  .text
+  - Name:     Global
+    Type:     STT_FUNC
+    Section:  .text
+    Binding:  STB_GLOBAL
 
 # CHECK:               Symbols [
 # CHECK-NEXT:            Symbol {

Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/globalize.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/globalize.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/globalize.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/globalize.test Wed Apr  3 07:53:42 2019
@@ -31,25 +31,25 @@ Sections:
     AddressAlign:    0x0000000000000010
     Size:            64
 Symbols:
-  Local:
-    - Name:     Local
-      Type:     STT_FUNC
-      Section:  .text
-      Value:    0x1000
-      Size:     8
-  Weak:
-    - Name:     Weak
-      Type:     STT_FUNC
-      Size:     8
-      Section:  .text
-      Value:    0x1008
-    - Name:     WeakUndef
-  Global:
-    - Name:     Global
-      Type:     STT_FUNC
-      Size:     8
-      Section:  .text
-      Value:    0x1010
+  - Name:     Local
+    Type:     STT_FUNC
+    Section:  .text
+    Value:    0x1000
+    Size:     8
+  - Name:     Global
+    Type:     STT_FUNC
+    Size:     8
+    Section:  .text
+    Value:    0x1010
+    Binding:  STB_GLOBAL
+  - Name:     Weak
+    Type:     STT_FUNC
+    Size:     8
+    Section:  .text
+    Value:    0x1008
+    Binding:  STB_WEAK
+  - Name:     WeakUndef
+    Binding:  STB_WEAK
 
 #CHECK: Symbols [
 #CHECK-NEXT:  Symbol {

Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/group-addr-misaligned.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/group-addr-misaligned.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/group-addr-misaligned.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/group-addr-misaligned.test Wed Apr  3 07:53:42 2019
@@ -33,6 +33,5 @@ Sections:
     Flags:           [ SHF_ALLOC, SHF_EXECINSTR, SHF_GROUP ]
     AddressAlign:    0x0000000000000001
 Symbols:
-  Local:
-    - Name:            foo
-      Section:         .group
+  - Name:            foo
+    Section:         .group

Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/group-big-endian.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/group-big-endian.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/group-big-endian.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/group-big-endian.test Wed Apr  3 07:53:42 2019
@@ -38,19 +38,19 @@ Sections:
     Flags:           [ SHF_ALLOC, SHF_EXECINSTR, SHF_GROUP ]
     AddressAlign:    0x0000000000000010
 Symbols:
-  Local:           
-    - Name:            .text.bar
-      Type:            STT_SECTION
-      Section:         .text.bar
-    - Name:            .text.foo
-      Type:            STT_SECTION
-      Section:         .text.foo         
-  Weak:            
-    - Name:            bar
-      Type:            STT_FUNC
-      Section:         .text.bar
-      Size:            0x0000000000000000
-    - Name:            foo
-      Type:            STT_FUNC
-      Section:         .text.foo
-      Size:            0x0000000000000000
+  - Name:            .text.bar
+    Type:            STT_SECTION
+    Section:         .text.bar
+  - Name:            .text.foo
+    Type:            STT_SECTION
+    Section:         .text.foo
+  - Name:            bar
+    Type:            STT_FUNC
+    Section:         .text.bar
+    Size:            0x0000000000000000
+    Binding:         STB_WEAK
+  - Name:            foo
+    Type:            STT_FUNC
+    Section:         .text.foo
+    Size:            0x0000000000000000
+    Binding:         STB_WEAK

Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/group-unchanged.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/group-unchanged.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/group-unchanged.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/group-unchanged.test Wed Apr  3 07:53:42 2019
@@ -38,19 +38,19 @@ Sections:
     Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]
     AddressAlign:    0x0000000000000010
 Symbols:
-  Local:           
-    - Name:            .text.foo
-      Type:            STT_SECTION
-      Section:         .text.foo         
-    - Name:            .text.bar
-      Type:            STT_SECTION
-      Section:         .text.bar
-  Weak:            
-    - Name:            foo
-      Type:            STT_FUNC
-      Section:         .text.foo
-      Size:            0x0000000000000000
-    - Name:            bar
-      Type:            STT_FUNC
-      Section:         .text.bar
-      Size:            0x0000000000000000
+  - Name:            .text.foo
+    Type:            STT_SECTION
+    Section:         .text.foo
+  - Name:            .text.bar
+    Type:            STT_SECTION
+    Section:         .text.bar
+  - Name:            foo
+    Type:            STT_FUNC
+    Section:         .text.foo
+    Size:            0x0000000000000000
+    Binding:         STB_WEAK
+  - Name:            bar
+    Type:            STT_FUNC
+    Section:         .text.bar
+    Size:            0x0000000000000000
+    Binding:         STB_WEAK

Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/group.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/group.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/group.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/group.test Wed Apr  3 07:53:42 2019
@@ -38,19 +38,19 @@ Sections:
     Flags:           [ SHF_ALLOC, SHF_EXECINSTR, SHF_GROUP ]
     AddressAlign:    0x0000000000000010
 Symbols:
-  Local:           
-    - Name:            .text.bar
-      Type:            STT_SECTION
-      Section:         .text.bar
-    - Name:            .text.foo
-      Type:            STT_SECTION
-      Section:         .text.foo         
-  Weak:            
-    - Name:            bar
-      Type:            STT_FUNC
-      Section:         .text.bar
-      Size:            0x0000000000000000
-    - Name:            foo
-      Type:            STT_FUNC
-      Section:         .text.foo
-      Size:            0x0000000000000000
+  - Name:            .text.bar
+    Type:            STT_SECTION
+    Section:         .text.bar
+  - Name:            .text.foo
+    Type:            STT_SECTION
+    Section:         .text.foo
+  - Name:            bar
+    Type:            STT_FUNC
+    Section:         .text.bar
+    Size:            0x0000000000000000
+    Binding:         STB_WEAK
+  - Name:            foo
+    Type:            STT_FUNC
+    Section:         .text.foo
+    Size:            0x0000000000000000
+    Binding:         STB_WEAK

Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/hexagon-unsupported-on-x86.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/hexagon-unsupported-on-x86.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/hexagon-unsupported-on-x86.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/hexagon-unsupported-on-x86.test Wed Apr  3 07:53:42 2019
@@ -8,8 +8,8 @@ FileHeader:
   Type:            ET_EXEC
   Machine:         EM_X86_64
 Symbols:
-  Global:
-    - Name:     test
-      Index:    SHN_HEXAGON_SCOMMON
+  - Name:     test
+    Index:    SHN_HEXAGON_SCOMMON
+    Binding:  STB_GLOBAL
 
 # CHECK: Symbol 'test' has unsupported value greater than or equal to SHN_LORESERVE: 65280

Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/keep-file-symbols.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/keep-file-symbols.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/keep-file-symbols.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/keep-file-symbols.test Wed Apr  3 07:53:42 2019
@@ -23,14 +23,13 @@ Sections:
     AddressAlign:    0x0000000000000010
     Size:            64
 Symbols:
-  Local:
-    - Name:     foo
-      Type:     STT_FILE
-      Section:  .text
-  Global:
-    - Name:     bar
-      Type:     STT_FUNC
-      Section:  .text
+  - Name:     foo
+    Type:     STT_FILE
+    Section:  .text
+  - Name:     bar
+    Type:     STT_FUNC
+    Section:  .text
+    Binding:  STB_GLOBAL
 
 #STRIPALL: Symbols [
 #STRIPALL-NEXT:  Symbol {

Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/keep-global-symbols-mix-globalize.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/keep-global-symbols-mix-globalize.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/keep-global-symbols-mix-globalize.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/keep-global-symbols-mix-globalize.test Wed Apr  3 07:53:42 2019
@@ -24,21 +24,22 @@ Sections:
     Type:          SHT_PROGBITS
     Flags:         [ SHF_ALLOC, SHF_EXECINSTR ]
 Symbols:
-  Local:
-    - Name:        Local1
-      Section:     .text
-    - Name:        Local2
-      Section:     .text
-  Weak:
-    - Name:        Weak1
-      Section:     .text
-    - Name:        Weak2
-      Section:     .text
-  Global:
-    - Name:        Global1
-      Section:     .text
-    - Name:        Global2
-      Section:     .text
+  - Name:        Local1
+    Section:     .text
+  - Name:        Local2
+    Section:     .text
+  - Name:        Global1
+    Section:     .text
+    Binding:     STB_GLOBAL
+  - Name:        Global2
+    Section:     .text
+    Binding:     STB_GLOBAL
+  - Name:        Weak1
+    Section:     .text
+    Binding:     STB_WEAK
+  - Name:        Weak2
+    Section:     .text
+    Binding:     STB_WEAK
 
 # CHECK:      Symbol table '.symtab' contains 7 entries:
 # CHECK-NEXT:    Num: Value Size Type Bind Vis Ndx Name

Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/keep-global-symbols.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/keep-global-symbols.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/keep-global-symbols.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/keep-global-symbols.test Wed Apr  3 07:53:42 2019
@@ -56,34 +56,42 @@ Sections:
     Type:          SHT_PROGBITS
     Flags:         [ SHF_ALLOC, SHF_EXECINSTR ]
 Symbols:
-  Local:
-    - Name:        Local1
-      Section:     .text
-    - Name:        Local2
-      Section:     .text
-  Weak:
-    - Name:        Weak1
-      Section:     .text
-    - Name:        Weak2
-      Section:     .text
-    - Name:        Weak3
-      Section:     .text
-  Global:
-    - Name:        Global1
-      Section:     .text
-    - Name:        Global2
-      Section:     .text
-    - Name:        Global3
-      Section:     .text
-    - Name:        Global4
-      Section:     .text
-    - Name:        Global5
-      Section:     .text
-    - Name:        Global6
-      Section:     .text
-    - Name:        "Global5 Global6"
-      Section:     .text
-    - Name:        Global7
+  - Name:        Local1
+    Section:     .text
+  - Name:        Local2
+    Section:     .text
+  - Name:        Global1
+    Section:     .text
+    Binding:     STB_GLOBAL
+  - Name:        Global2
+    Section:     .text
+    Binding:     STB_GLOBAL
+  - Name:        Global3
+    Section:     .text
+    Binding:     STB_GLOBAL
+  - Name:        Global4
+    Section:     .text
+    Binding:     STB_GLOBAL
+  - Name:        Global5
+    Section:     .text
+    Binding:     STB_GLOBAL
+  - Name:        Global6
+    Section:     .text
+    Binding:     STB_GLOBAL
+  - Name:        "Global5 Global6"
+    Section:     .text
+    Binding:     STB_GLOBAL
+  - Name:        Global7
+    Binding:     STB_GLOBAL
+  - Name:        Weak1
+    Section:     .text
+    Binding:     STB_WEAK
+  - Name:        Weak2
+    Section:     .text
+    Binding:     STB_WEAK
+  - Name:        Weak3
+    Section:     .text
+    Binding:     STB_WEAK
 
 # CHECK:      Symbol table '.symtab' contains 14 entries:
 # CHECK-NEXT:    Num: Value Size Type Bind Vis Ndx Name

Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/keep-symbol-remove-section.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/keep-symbol-remove-section.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/keep-symbol-remove-section.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/keep-symbol-remove-section.test Wed Apr  3 07:53:42 2019
@@ -16,12 +16,11 @@ Sections:
     AddressAlign:    0x0000000000000010
     Size:            64
 Symbols:
-  Local:
-    - Name:     foo
-      Type:     STT_FUNC
-      Section:  .text
-      Value:    0x1000
-      Size:     8
+  - Name:     foo
+    Type:     STT_FUNC
+    Section:  .text
+    Value:    0x1000
+    Size:     8
 
 #CHECK: Symbols [
 #CHECK-NEXT:  Symbol {

Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/keep-symbol.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/keep-symbol.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/keep-symbol.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/keep-symbol.test Wed Apr  3 07:53:42 2019
@@ -27,22 +27,21 @@ Sections:
     AddressAlign:    0x0000000000000010
     Size:            64
 Symbols:
-  Local:
-    - Name:     foo
-      Type:     STT_FUNC
-      Section:  .text
-      Value:    0x1000
-      Size:     8
-    - Name:     bar
-      Type:     STT_FUNC
-      Section:  .text
-      Value:    0x1008
-      Size:     8
-    - Name:     baz
-      Type:     STT_FUNC
-      Section:  .text
-      Value:    0x1010
-      Size:     8
+  - Name:     foo
+    Type:     STT_FUNC
+    Section:  .text
+    Value:    0x1000
+    Size:     8
+  - Name:     bar
+    Type:     STT_FUNC
+    Section:  .text
+    Value:    0x1008
+    Size:     8
+  - Name:     baz
+    Type:     STT_FUNC
+    Section:  .text
+    Value:    0x1010
+    Size:     8
 
 #CHECK: Symbols [
 #CHECK-NEXT:  Symbol {

Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/localize-hidden.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/localize-hidden.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/localize-hidden.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/localize-hidden.test Wed Apr  3 07:53:42 2019
@@ -29,53 +29,57 @@ Sections:
         Symbol: undefGlobal
         Type:   R_X86_64_PC32
 Symbols:
-  Local:
-    - Name:     hiddenLocal
-      Type:     STT_FUNC
-      Section:  .text
-      Value:    0x1008
-      Size:     8
-      Visibility: STV_HIDDEN
-  Weak:
-    - Name:     hiddenWeak
-      Type:     STT_FUNC
-      Section:  .text
-      Value:    0x1010
-      Size:     8
-      Visibility: STV_HIDDEN
-  Global:
-    - Name:     defaultGlobal
-      Type:     STT_FUNC
-      Size:     8
-      Section:  .text
-      Value:    0x1000
-    - Name:     hiddenGlobal
-      Type:     STT_OBJECT
-      Section:  .data
-      Value:    0x2006
-      Size:     2
-      Visibility: STV_HIDDEN
-    - Name:     hiddenGlobalCommon
-      Type:     STT_OBJECT
-      Index:    SHN_COMMON
-      Value:    0x2006
-      Size:     2
-      Visibility: STV_HIDDEN
-    - Name:     undefGlobal
-      Type:     STT_FUNC
-      Size:     8
-    - Name:     internalGlobal
-      Type:     STT_OBJECT
-      Section:  .data
-      Value:    0x2002
-      Size:     2
-      Visibility: STV_INTERNAL
-    - Name:     protectedGlobal
-      Type:     STT_OBJECT
-      Section:  .data
-      Value:    0x2000
-      Size:     4
-      Visibility: STV_PROTECTED
+  - Name:     hiddenLocal
+    Type:     STT_FUNC
+    Section:  .text
+    Value:    0x1008
+    Size:     8
+    Visibility: STV_HIDDEN
+  - Name:     defaultGlobal
+    Type:     STT_FUNC
+    Size:     8
+    Section:  .text
+    Value:    0x1000
+    Binding:  STB_GLOBAL
+  - Name:     hiddenGlobal
+    Type:     STT_OBJECT
+    Section:  .data
+    Value:    0x2006
+    Size:     2
+    Visibility: STV_HIDDEN
+    Binding:  STB_GLOBAL
+  - Name:     hiddenGlobalCommon
+    Type:     STT_OBJECT
+    Index:    SHN_COMMON
+    Value:    0x2006
+    Size:     2
+    Visibility: STV_HIDDEN
+    Binding:  STB_GLOBAL
+  - Name:     undefGlobal
+    Type:     STT_FUNC
+    Size:     8
+    Binding:  STB_GLOBAL
+  - Name:     internalGlobal
+    Type:     STT_OBJECT
+    Section:  .data
+    Value:    0x2002
+    Size:     2
+    Visibility: STV_INTERNAL
+    Binding:  STB_GLOBAL
+  - Name:     protectedGlobal
+    Type:     STT_OBJECT
+    Section:  .data
+    Value:    0x2000
+    Size:     4
+    Visibility: STV_PROTECTED
+    Binding:  STB_GLOBAL
+  - Name:     hiddenWeak
+    Type:     STT_FUNC
+    Section:  .text
+    Value:    0x1010
+    Size:     8
+    Visibility: STV_HIDDEN
+    Binding:  STB_WEAK
 
 #CHECK:     Relocations [
 #CHECK-NEXT:  Section (3) .rel.text {

Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/localize.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/localize.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/localize.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/localize.test Wed Apr  3 07:53:42 2019
@@ -42,31 +42,32 @@ Sections:
     AddressAlign:    0x0000000000000010
     Content:         "0000000000000000"
 Symbols:
-  Local:
-    - Name:     Local
-      Type:     STT_FUNC
-      Section:  .text
-      Value:    0x1000
-      Size:     8
-  Weak:
-    - Name:     Weak
-      Type:     STT_FUNC
-      Size:     8
-      Section:  .text
-      Value:    0x1008
-  Global:
-    - Name:     Global
-      Type:     STT_FUNC
-      Size:     8
-      Section:  .text
-      Value:    0x1010
-    - Name:     GlobalUndef
-      Type:     STT_FUNC
-    - Name:     GlobalCommon
-      Type:     STT_OBJECT
-      Index:    SHN_COMMON
-      Value:    0x2006
-      Size:     2
+  - Name:     Local
+    Type:     STT_FUNC
+    Section:  .text
+    Value:    0x1000
+    Size:     8
+  - Name:     Global
+    Type:     STT_FUNC
+    Size:     8
+    Section:  .text
+    Value:    0x1010
+    Binding:  STB_GLOBAL
+  - Name:     GlobalUndef
+    Type:     STT_FUNC
+    Binding:  STB_GLOBAL
+  - Name:     GlobalCommon
+    Type:     STT_OBJECT
+    Index:    SHN_COMMON
+    Value:    0x2006
+    Size:     2
+    Binding:  STB_GLOBAL
+  - Name:     Weak
+    Type:     STT_FUNC
+    Size:     8
+    Section:  .text
+    Value:    0x1008
+    Binding:  STB_WEAK
 
 #CHECK: Symbols [
 #CHECK-NEXT:  Symbol {

Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/prefix-symbols.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/prefix-symbols.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/prefix-symbols.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/prefix-symbols.test Wed Apr  3 07:53:42 2019
@@ -18,17 +18,16 @@ Sections:
     AddressAlign:    0x0000000000000010
     Size:            64
 Symbols:
-  Local:
-    - Name:     foo
-      Type:     STT_SECTION
-      Section:  .text
-    - Name:     bar
-      Type:     STT_FILE
-      Section:  .text
-  Global:
-    - Name:     foobar
-      Type:     STT_FUNC
-      Section:  .text
+  - Name:     foo
+    Type:     STT_SECTION
+    Section:  .text
+  - Name:     bar
+    Type:     STT_FILE
+    Section:  .text
+  - Name:     foobar
+    Type:     STT_FUNC
+    Section:  .text
+    Binding:  STB_GLOBAL
 
 # COMMON: Symbols [
 # COMMON-NEXT:  Symbol {

Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/redefine-symbol.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/redefine-symbol.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/redefine-symbol.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/redefine-symbol.test Wed Apr  3 07:53:42 2019
@@ -33,20 +33,22 @@ Sections:
     AddressAlign:    0x0000000000000010
     Content:         "0000000000000000"
 Symbols:
-  Global:
-    - Name:     foo
-      Type:     STT_FUNC
-      Section:  .text
-      Value:    0x1004
-    - Name:     bar
-      Type:     STT_OBJECT
-      Section:  .data
-      Value:    0x2000
-      Size:     4
-    - Name:     empty
-      Type:     STT_FUNC
-      Section:  .text
-      Value:    0x1008
+  - Name:     foo
+    Type:     STT_FUNC
+    Section:  .text
+    Value:    0x1004
+    Binding:  STB_GLOBAL
+  - Name:     bar
+    Type:     STT_OBJECT
+    Section:  .data
+    Value:    0x2000
+    Size:     4
+    Binding:  STB_GLOBAL
+  - Name:     empty
+    Type:     STT_FUNC
+    Section:  .text
+    Value:    0x1008
+    Binding:  STB_GLOBAL
 
 #CHECK: Symbols [
 #CHECK-NEXT:  Symbol {

Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/regex.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/regex.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/regex.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/regex.test Wed Apr  3 07:53:42 2019
@@ -30,22 +30,21 @@ Sections:
     AddressAlign:    0x0000000000000010
     Size:            64
 Symbols:
-  Local:
-    - Name:     foobaz
-      Type:     STT_FUNC
-      Section:  .text
-      Value:    0x1000
-      Size:     8
-    - Name:     bar
-      Type:     STT_FUNC
-      Section:  .text
-      Value:    0x1008
-      Size:     8
-    - Name:     rebar
-      Type:     STT_FUNC
-      Section:  .text
-      Value:    0x1010
-      Size:     8
+  - Name:     foobaz
+    Type:     STT_FUNC
+    Section:  .text
+    Value:    0x1000
+    Size:     8
+  - Name:     bar
+    Type:     STT_FUNC
+    Section:  .text
+    Value:    0x1008
+    Size:     8
+  - Name:     rebar
+    Type:     STT_FUNC
+    Section:  .text
+    Value:    0x1010
+    Size:     8
 
 #REGEX1-NOT: foobaz
 #REGEX1-NOT: bar

Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/reloc-error-remove-symtab.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/reloc-error-remove-symtab.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/reloc-error-remove-symtab.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/reloc-error-remove-symtab.test Wed Apr  3 07:53:42 2019
@@ -24,9 +24,9 @@ Sections:
         Type:   R_X86_64_PC32
 
 Symbols:
-  Global:
-    - Name:     foo
-      Type:     STT_FUNC
-      Size:     4
+  - Name:     foo
+    Type:     STT_FUNC
+    Size:     4
+    Binding:  STB_GLOBAL
 
 # CHECK: Symbol table .symtab cannot be removed because it is referenced by the relocation section .rel.text.

Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/remove-section-with-symbol.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/remove-section-with-symbol.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/remove-section-with-symbol.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/remove-section-with-symbol.test Wed Apr  3 07:53:42 2019
@@ -16,17 +16,18 @@ Sections:
     Type:            SHT_PROGBITS
     Flags:           [ SHF_ALLOC ]
 Symbols:
-  Global:
-    - Name:     test
-      Type:     STT_FUNC
-      Section:  .test
-      Value:    0x1000
-      Size:     4
-    - Name:     test2
-      Type:     STT_FUNC
-      Section:  .test2
-      Value:    0x1000
-      Size:     4
+  - Name:     test
+    Type:     STT_FUNC
+    Section:  .test
+    Value:    0x1000
+    Size:     4
+    Binding:  STB_GLOBAL
+  - Name:     test2
+    Type:     STT_FUNC
+    Section:  .test2
+    Value:    0x1000
+    Size:     4
+    Binding:  STB_GLOBAL
 
 # The sections counted here should be .test, .symtab, .strtab, and .shstrtab.
 # The 5th section is the null section.

Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/rename-section-flag-preserved.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/rename-section-flag-preserved.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/rename-section-flag-preserved.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/rename-section-flag-preserved.test Wed Apr  3 07:53:42 2019
@@ -51,7 +51,6 @@ Sections:
                        SHF_OS_NONCONFORMING, SHF_STRINGS, SHF_TLS, SHF_WRITE ]
     Content:        "a4a4a4a4"
 Symbols:
-  Local:
   - Name:            dummy
     Section:         .group
 

Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/section-index-unsupported.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/section-index-unsupported.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/section-index-unsupported.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/section-index-unsupported.test Wed Apr  3 07:53:42 2019
@@ -8,8 +8,8 @@ FileHeader:
   Type:            ET_EXEC
   Machine:         EM_X86_64
 Symbols:
-  Global:
-    - Name:     test
-      Index:    0xff05
+  - Name:     test
+    Index:    0xff05
+    Binding:  STB_GLOBAL
 
 # CHECK: Symbol 'test' has unsupported value greater than or equal to SHN_LORESERVE: 65285

Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/strip-all-and-keep-symbol.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/strip-all-and-keep-symbol.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/strip-all-and-keep-symbol.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/strip-all-and-keep-symbol.test Wed Apr  3 07:53:42 2019
@@ -32,22 +32,21 @@ Sections:
   - Name:            .debug_bar
     Type:            SHT_PROGBITS
 Symbols:
-  Local:
-    - Name:     foo
-      Type:     STT_FUNC
-      Section:  .text
-      Value:    0x1000
-      Size:     8
-    - Name:     bar
-      Type:     STT_FUNC
-      Section:  .text
-      Value:    0x1008
-      Size:     8
-    - Name:     baz
-      Type:     STT_FUNC
-      Section:  .text
-      Value:    0x1010
-      Size:     8
+  - Name:     foo
+    Type:     STT_FUNC
+    Section:  .text
+    Value:    0x1000
+    Size:     8
+  - Name:     bar
+    Type:     STT_FUNC
+    Section:  .text
+    Value:    0x1008
+    Size:     8
+  - Name:     baz
+    Type:     STT_FUNC
+    Section:  .text
+    Value:    0x1010
+    Size:     8
 
 # CHECK:     Name: .text
 # CHECK:     Name: .gnu.warning.foo

Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/strip-all-and-remove.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/strip-all-and-remove.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/strip-all-and-remove.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/strip-all-and-remove.test Wed Apr  3 07:53:42 2019
@@ -28,14 +28,16 @@ Sections:
     AddressAlign:    0x0000000000000010
     Content:         "00000000"
 Symbols:
-  Global:
-    - Name: debugfoo
-      Section: .debug_foo
-    - Name: foo
-      Section: .text
-    - Name: bar
-      Section: .text.bar
- 
+  - Name:    debugfoo
+    Section: .debug_foo
+    Binding:  STB_GLOBAL
+  - Name:    foo
+    Section: .text
+    Binding:  STB_GLOBAL
+  - Name:    bar
+    Section: .text.bar
+    Binding:  STB_GLOBAL
+
 # CHECK: SectionHeaderCount: 3
 
 # CHECK:     Name: .text

Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/strip-debug-and-remove.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/strip-debug-and-remove.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/strip-debug-and-remove.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/strip-debug-and-remove.test Wed Apr  3 07:53:42 2019
@@ -28,14 +28,16 @@ Sections:
     AddressAlign:    0x0000000000000010
     Content:         "00000000"
 Symbols:
-  Global:
-    - Name: debugfoo
-      Section: .debug_foo
-    - Name: foo
-      Section: .text
-    - Name: bar
-      Section: .text.bar
- 
+  - Name:    debugfoo
+    Section: .debug_foo
+    Binding:  STB_GLOBAL
+  - Name:    foo
+    Section: .text
+    Binding:  STB_GLOBAL
+  - Name:    bar
+    Section: .text.bar
+    Binding:  STB_GLOBAL
+
 # CHECK: SectionHeaderCount: 5
 
 # CHECK:     Name: .text

Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/strip-debug.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/strip-debug.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/strip-debug.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/strip-debug.test Wed Apr  3 07:53:42 2019
@@ -110,11 +110,12 @@ Sections:
     AddressAlign:    0x0000000000000010
     Content:         "00000000"
 Symbols:
-  Global:
-    - Name: foo
-      Section: .text
-    - Name: debugfoo
-      Section: .debugfoo
+  - Name:    foo
+    Section: .text
+    Binding:  STB_GLOBAL
+  - Name:    debugfoo
+    Section: .debugfoo
+    Binding:  STB_GLOBAL
 
 # CHECK: SectionHeaderCount: 5
 

Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/strip-group-symbol.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/strip-group-symbol.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/strip-group-symbol.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/strip-group-symbol.test Wed Apr  3 07:53:42 2019
@@ -23,9 +23,9 @@ Sections:
     AddressAlign:    0x0000000000000010
     Size:            64
 Symbols:
-  Weak:
-    - Name:            foo
-      Type:            STT_FUNC
-      Section:         .text
+  - Name:    foo
+    Type:    STT_FUNC
+    Section: .text
+    Binding: STB_WEAK
 
 #CHECK: Symbol foo cannot be removed because it is referenced by the section .group[1].

Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/strip-multiple-files.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/strip-multiple-files.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/strip-multiple-files.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/strip-multiple-files.test Wed Apr  3 07:53:42 2019
@@ -39,17 +39,16 @@ Sections:
     Type:            SHT_PROGBITS
     Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]
 Symbols:
-  Local:
-    - Name:     foo
-      Type:     STT_FUNC
-      Section:  .text
-      Value:    0x1234
-      Size:     8
-    - Name:     bar
-      Type:     STT_FUNC
-      Section:  .text
-      Value:    0x5678
-      Size:     8
+  - Name:     foo
+    Type:     STT_FUNC
+    Section:  .text
+    Value:    0x1234
+    Size:     8
+  - Name:     bar
+    Type:     STT_FUNC
+    Section:  .text
+    Value:    0x5678
+    Size:     8
 
 # CHECK:      Symbols [
 # CHECK-NEXT:   Symbol {

Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/strip-reloc-symbol.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/strip-reloc-symbol.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/strip-reloc-symbol.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/strip-reloc-symbol.test Wed Apr  3 07:53:42 2019
@@ -22,11 +22,10 @@ Sections:
         Symbol: foo
         Type:   R_X86_64_PC32
 Symbols:
-  Local:
-    - Name:     foo
-      Type:     STT_FUNC
-      Section:  .text
-      Value:    0x1000
-      Size:     8
+  - Name:     foo
+    Type:     STT_FUNC
+    Section:  .text
+    Value:    0x1000
+    Size:     8
 
 #CHECK: not stripping symbol 'foo' because it is named in a relocation.

Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/strip-section-err.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/strip-section-err.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/strip-section-err.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/strip-section-err.test Wed Apr  3 07:53:42 2019
@@ -43,9 +43,7 @@ Sections:
     AddressAlign:    0x0000000000000001
     Content:         '0102'
 Symbols:         
-  Local:           
-    - Name:            foo
-      Section:         .data
-      Value:           0x0000000000000001
-DynamicSymbols:  {}
+  - Name:            foo
+    Section:         .data
+    Value:           0x0000000000000001
 ...

Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/strip-symbol-and-relocation.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/strip-symbol-and-relocation.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/strip-symbol-and-relocation.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/strip-symbol-and-relocation.test Wed Apr  3 07:53:42 2019
@@ -43,6 +43,6 @@ Sections:
         Symbol:          bar
         Type:            R_X86_64_32S
 Symbols:
-  Global:
-    - Name:     bar
-      Section:  .text
+  - Name:     bar
+    Section:  .text
+    Binding:  STB_GLOBAL

Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/strip-symbol.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/strip-symbol.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/strip-symbol.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/strip-symbol.test Wed Apr  3 07:53:42 2019
@@ -28,24 +28,23 @@ Sections:
     AddressAlign:    0x0000000000000010
     Size:            64
 Symbols:
-  Local:
-    - Name:     foo
-      Type:     STT_FUNC
-      Section:  .text
-      Value:    0x1000
-      Size:     8
-  Weak:
-    - Name:     bar
-      Type:     STT_FUNC
-      Size:     8
-      Section:  .text
-      Value:    0x1008
-  Global:
-    - Name:     baz
-      Type:     STT_FUNC
-      Size:     8
-      Section:  .text
-      Value:    0x1010
+  - Name:     foo
+    Type:     STT_FUNC
+    Section:  .text
+    Value:    0x1000
+    Size:     8
+  - Name:     bar
+    Type:     STT_FUNC
+    Size:     8
+    Section:  .text
+    Value:    0x1008
+    Binding:  STB_WEAK
+  - Name:     baz
+    Type:     STT_FUNC
+    Size:     8
+    Section:  .text
+    Value:    0x1010
+    Binding:  STB_GLOBAL
 
 #CHECK: Symbols [
 #CHECK-NEXT:  Symbol {

Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/strip-unneeded.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/strip-unneeded.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/strip-unneeded.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/strip-unneeded.test Wed Apr  3 07:53:42 2019
@@ -57,42 +57,43 @@ Sections:
         Symbol: foo
         Type:   R_X86_64_PC32
 Symbols:
-  Local:
-    - Name:     foo
-      Type:     STT_FUNC
-      Section:  .text
-      Value:    0x1000
-      Size:     8
-    - Name:     bar
-      Type:     STT_FUNC
-      Size:     8
-      Section:  .text
-      Value:    0x1008
-    - Name:     barfoo
-      Type:     STT_FUNC
-      Size:     8
-      Section:  .text
-      Value:    0x1010
-    - Name:     fileSymbol
-      Type:     STT_FILE
-    - Name:     sectionSymbol
-      Type:     STT_SECTION
-  Weak:
-    - Name:     baz
-      Type:     STT_FUNC
-      Size:     8
-      Section:  .text
-      Value:    0x1018
-    - Name:     foobaz
-      Type:     STT_FUNC
-  Global:
-    - Name:     foobar
-      Type:     STT_FUNC
-    - Name:     barbaz
-      Type:     STT_FUNC
-      Size:     8
-      Section:  .text
-      Value:    0x1020
+  - Name:     foo
+    Type:     STT_FUNC
+    Section:  .text
+    Value:    0x1000
+    Size:     8
+  - Name:     bar
+    Type:     STT_FUNC
+    Size:     8
+    Section:  .text
+    Value:    0x1008
+  - Name:     barfoo
+    Type:     STT_FUNC
+    Size:     8
+    Section:  .text
+    Value:    0x1010
+  - Name:     fileSymbol
+    Type:     STT_FILE
+  - Name:     sectionSymbol
+    Type:     STT_SECTION
+  - Name:     foobar
+    Type:     STT_FUNC
+    Binding:  STB_GLOBAL
+  - Name:     barbaz
+    Type:     STT_FUNC
+    Size:     8
+    Section:  .text
+    Value:    0x1020
+    Binding:  STB_GLOBAL
+  - Name:     baz
+    Type:     STT_FUNC
+    Size:     8
+    Section:  .text
+    Value:    0x1018
+    Binding:  STB_WEAK
+  - Name:     foobaz
+    Type:     STT_FUNC
+    Binding:  STB_WEAK
 
 #CHECK: Symbols [
 #CHECK-NEXT:  Symbol {

Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/symbol-copy.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/symbol-copy.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/symbol-copy.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/symbol-copy.test Wed Apr  3 07:53:42 2019
@@ -22,38 +22,43 @@ Sections:
     AddressAlign:    0x0000000000000010
     Content:         "0000000000000000"
 Symbols:
-  Global:
-    - Name:     _start
-      Type:     STT_FUNC
-      Section:  .text
-      Value:    0x1000
-      Size:     4
-    - Name:     bam
-      Type:     STT_FUNC
-      Section:  .text
-      Value:    0x1001
-      Size:     4
-      Visibility: STV_HIDDEN
-    - Name:     foo
-      Type:     STT_FUNC
-      Section:  .text
-      Value:    0x1004
-    - Name:     faz
-      Type:     STT_OBJECT
-      Section:  .data
-      Value:    0x2002
-      Size:     2
-      Visibility: STV_INTERNAL
-    - Name:     bar
-      Type:     STT_OBJECT
-      Section:  .data
-      Value:    0x2000
-      Size:     4
-    - Name:     baz
-      Type:     STT_OBJECT
-      Section:  .data
-      Value:    0x2004
-      Size:     4
+  - Name:     _start
+    Type:     STT_FUNC
+    Section:  .text
+    Value:    0x1000
+    Size:     4
+    Binding:  STB_GLOBAL
+  - Name:     bam
+    Type:     STT_FUNC
+    Section:  .text
+    Value:    0x1001
+    Size:     4
+    Visibility: STV_HIDDEN
+    Binding:  STB_GLOBAL
+  - Name:     foo
+    Type:     STT_FUNC
+    Section:  .text
+    Value:    0x1004
+    Binding:  STB_GLOBAL
+  - Name:     faz
+    Type:     STT_OBJECT
+    Section:  .data
+    Value:    0x2002
+    Size:     2
+    Visibility: STV_INTERNAL
+    Binding:  STB_GLOBAL
+  - Name:     bar
+    Type:     STT_OBJECT
+    Section:  .data
+    Value:    0x2000
+    Size:     4
+    Binding:  STB_GLOBAL
+  - Name:     baz
+    Type:     STT_OBJECT
+    Section:  .data
+    Value:    0x2004
+    Size:     4
+    Binding:  STB_GLOBAL
 
 #CHECK: Symbols [
 #CHECK-NEXT:  Symbol {

Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/symbol-empty-name.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/symbol-empty-name.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/symbol-empty-name.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/symbol-empty-name.test Wed Apr  3 07:53:42 2019
@@ -37,11 +37,10 @@ Sections:
     Type:  SHT_PROGBITS
     Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
 Symbols:
-  Local:
-    - Name:    ""
-      Type:    STT_SECTION
-      Section: .text
-  Global:
-  # We need to have a named symbol, otherwise the original
-  # issue that was fixed is not reproduced by this test.
-    - Name: foo
+  - Name:    ""
+    Type:    STT_SECTION
+    Section: .text
+# We need to have a named symbol, otherwise the original
+# issue that was fixed is not reproduced by this test.
+  - Name:    foo
+    Binding: STB_GLOBAL

Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/weaken-all.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/weaken-all.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/weaken-all.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/weaken-all.test Wed Apr  3 07:53:42 2019
@@ -23,27 +23,27 @@ Sections:
         Symbol: undefGlobal
         Type:   R_X86_64_PC32
 Symbols:
-  Local:
-    - Name:     Local
-      Type:     STT_FUNC
-      Section:  .text
-      Value:    0x1008
-      Size:     8
-  Weak:
-    - Name:     Weak
-      Type:     STT_FUNC
-      Size:     8
-      Section:  .text
-      Value:    0x1010
-  Global:
-    - Name:     Global
-      Type:     STT_FUNC
-      Size:     8
-      Section:  .text
-      Value:    0x1018
-    - Name:     undefGlobal
-      Type:     STT_FUNC
-      Size:     8
+  - Name:     Local
+    Type:     STT_FUNC
+    Section:  .text
+    Value:    0x1008
+    Size:     8
+  - Name:     Global
+    Type:     STT_FUNC
+    Size:     8
+    Section:  .text
+    Value:    0x1018
+    Binding:  STB_GLOBAL
+  - Name:     undefGlobal
+    Type:     STT_FUNC
+    Size:     8
+    Binding:  STB_GLOBAL
+  - Name:     Weak
+    Type:     STT_FUNC
+    Size:     8
+    Section:  .text
+    Value:    0x1010
+    Binding:  STB_WEAK
 
 #CHECK: Symbols [
 #CHECK-NEXT:  Symbol {

Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/weaken.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/weaken.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/weaken.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/weaken.test Wed Apr  3 07:53:42 2019
@@ -28,24 +28,23 @@ Sections:
     AddressAlign:    0x0000000000000010
     Size:            64
 Symbols:
-  Local:
-    - Name:     Local
-      Type:     STT_FUNC
-      Section:  .text
-      Value:    0x1000
-      Size:     8
-  Weak:
-    - Name:     Weak
-      Type:     STT_FUNC
-      Size:     8
-      Section:  .text
-      Value:    0x1008
-  Global:
-    - Name:     Global
-      Type:     STT_FUNC
-      Size:     8
-      Section:  .text
-      Value:    0x1010
+  - Name:     Local
+    Type:     STT_FUNC
+    Section:  .text
+    Value:    0x1000
+    Size:     8
+  - Name:     Global
+    Type:     STT_FUNC
+    Size:     8
+    Section:  .text
+    Value:    0x1010
+    Binding:  STB_GLOBAL
+  - Name:     Weak
+    Type:     STT_FUNC
+    Size:     8
+    Section:  .text
+    Value:    0x1008
+    Binding:  STB_WEAK
 
 #CHECK: Symbols [
 #CHECK-NEXT:  Symbol {

Modified: llvm/trunk/test/tools/llvm-objdump/X86/Inputs/simple-executable-x86_64.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objdump/X86/Inputs/simple-executable-x86_64.yaml?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objdump/X86/Inputs/simple-executable-x86_64.yaml (original)
+++ llvm/trunk/test/tools/llvm-objdump/X86/Inputs/simple-executable-x86_64.yaml Wed Apr  3 07:53:42 2019
@@ -33,41 +33,43 @@ Sections:
     Flags:           [ SHF_MERGE, SHF_STRINGS ]
     AddressAlign:    0x0000000000000001
     Content:         5562756E747520636C616E672076657273696F6E20332E352D317562756E74753120287472756E6B2920286261736564206F6E204C4C564D20332E352900
-Symbols:         
-  Local:           
-    - Type:            STT_SECTION
-      Section:         .text
-    - Type:            STT_SECTION
-      Section:         .anothertext
-      Value:           0x0000000000000010
-    - Type:            STT_SECTION
-      Section:         .eh_frame
-      Value:           0x0000000000000050
-    - Type:            STT_SECTION
-      Section:         .data
-      Value:           0x00000000000000A8
-    - Type:            STT_SECTION
-      Section:         .comment
-    - Name:            /tmp/a.c
-      Type:            STT_FILE
-    - Type:            STT_FILE
-  Global:          
-    - Name:            somedata
-      Type:            STT_OBJECT
-      Section:         .anothertext
-      Value:           0x0000000000000045
-    - Name:            main
-      Type:            STT_FUNC
-      Section:         .anothertext
-      Value:           0x0000000000000010
-      Size:            0x000000000000003F
-    - Name:            foo
-      Type:            STT_FUNC
-      Section:         .text
-      Size:            0x000000000000000D
-    - Name:            a
-      Type:            STT_OBJECT
-      Section:         .data
-      Value:           0x00000000000000A8
-      Size:            0x0000000000000004
+Symbols:
+  - Type:            STT_SECTION
+    Section:         .text
+  - Type:            STT_SECTION
+    Section:         .anothertext
+    Value:           0x0000000000000010
+  - Type:            STT_SECTION
+    Section:         .eh_frame
+    Value:           0x0000000000000050
+  - Type:            STT_SECTION
+    Section:         .data
+    Value:           0x00000000000000A8
+  - Type:            STT_SECTION
+    Section:         .comment
+  - Name:            /tmp/a.c
+    Type:            STT_FILE
+  - Type:            STT_FILE          
+  - Name:            somedata
+    Type:            STT_OBJECT
+    Section:         .anothertext
+    Value:           0x0000000000000045
+    Binding:         STB_GLOBAL
+  - Name:            main
+    Type:            STT_FUNC
+    Section:         .anothertext
+    Value:           0x0000000000000010
+    Size:            0x000000000000003F
+    Binding:         STB_GLOBAL
+  - Name:            foo
+    Type:            STT_FUNC
+    Section:         .text
+    Size:            0x000000000000000D
+    Binding:         STB_GLOBAL
+  - Name:            a
+    Type:            STT_OBJECT
+    Section:         .data
+    Value:           0x00000000000000A8
+    Size:            0x0000000000000004
+    Binding:         STB_GLOBAL
 ...

Modified: llvm/trunk/test/tools/llvm-objdump/X86/adjust-vma.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objdump/X86/adjust-vma.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objdump/X86/adjust-vma.test (original)
+++ llvm/trunk/test/tools/llvm-objdump/X86/adjust-vma.test Wed Apr  3 07:53:42 2019
@@ -119,13 +119,12 @@ Sections:
         Symbol:      .text
         Type:        R_X86_64_32
 Symbols:
-  Local:
-    - Name:            func
-      Type:            STT_FUNC
-      Section:         .text
-      Value:           0x0000000000000001
-    - Name:            sym
-      Section:         .text
-    - Name:            .text
-      Type:            STT_SECTION
-      Section:         .text
+  - Name:            func
+    Type:            STT_FUNC
+    Section:         .text
+    Value:           0x0000000000000001
+  - Name:            sym
+    Section:         .text
+  - Name:            .text
+    Type:            STT_SECTION
+    Section:         .text

Modified: llvm/trunk/test/tools/llvm-objdump/X86/disasm-zeroes-relocations.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objdump/X86/disasm-zeroes-relocations.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objdump/X86/disasm-zeroes-relocations.test (original)
+++ llvm/trunk/test/tools/llvm-objdump/X86/disasm-zeroes-relocations.test Wed Apr  3 07:53:42 2019
@@ -51,5 +51,5 @@ Sections:
         Symbol:          x
         Type:            R_X86_64_64
 Symbols:
-  Global:
-    - Name: x
+  - Name: x
+    Binding:         STB_GLOBAL

Modified: llvm/trunk/test/tools/llvm-objdump/X86/disassemble-demangle.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objdump/X86/disassemble-demangle.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objdump/X86/disassemble-demangle.test (original)
+++ llvm/trunk/test/tools/llvm-objdump/X86/disassemble-demangle.test Wed Apr  3 07:53:42 2019
@@ -23,15 +23,14 @@ Sections:
     AddressAlign:    0x0000000000000010
     Content:         "0000000000000000"
 Symbols:
-  Local:
-    - Name:     _Z3fooi
-      Type:     STT_FUNC
-      Section:  .text1
-      Value:    0x1000
-    - Name:     _Z3foov
-      Type:     STT_FUNC
-      Section:  .text2
-      Value:    0x1010
+  - Name:     _Z3fooi
+    Type:     STT_FUNC
+    Section:  .text1
+    Value:    0x1000
+  - Name:     _Z3foov
+    Type:     STT_FUNC
+    Section:  .text2
+    Value:    0x1010
 
 # We just want to check that the symbols are demangled
 # DEMANGLE: foo(int)

Modified: llvm/trunk/test/tools/llvm-objdump/relocations-elf.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objdump/relocations-elf.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objdump/relocations-elf.test (original)
+++ llvm/trunk/test/tools/llvm-objdump/relocations-elf.test Wed Apr  3 07:53:42 2019
@@ -63,13 +63,12 @@ Sections:
       Type: R_X86_64_64
 
 Symbols:
-  Local:
-    - Name: loc1
-    - Name: loc2
-  Global:
-    - Name: glob1
-      Section: .text
-      Value: 0x0
-      Size: 4
-    - Name: glob2
-
+  - Name: loc1
+  - Name: loc2
+  - Name:    glob1
+    Section: .text
+    Value:   0x0
+    Size:    4
+    Binding: STB_GLOBAL
+  - Name:    glob2
+    Binding: STB_GLOBAL

Modified: llvm/trunk/test/tools/llvm-objdump/symbol-table-elf.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objdump/symbol-table-elf.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objdump/symbol-table-elf.test (original)
+++ llvm/trunk/test/tools/llvm-objdump/symbol-table-elf.test Wed Apr  3 07:53:42 2019
@@ -28,22 +28,22 @@ Sections:
     AddressAlign:    0x0000000000000010
     Content:         "00000000"
 Symbols:
-   Global:
-     - Name:     foo
-       Type:     STT_FUNC
-       Section:  .text
-       Value:    0x1004
-     - Name:     bar
-       Type:     STT_OBJECT
-       Section:  .text
-       Value:    0x1008
-   Local:
-     - Name:     lfoo
-       Type:     STT_FUNC
-       Section:  .text
-       Value:    0x1004
-     - Name:     lbar
-       Type:     STT_OBJECT
-       Section:  .text
-       Value:    0x1008
+  - Name:     lfoo
+    Type:     STT_FUNC
+    Section:  .text
+    Value:    0x1004
+  - Name:     lbar
+    Type:     STT_OBJECT
+    Section:  .text
+    Value:    0x1008
+  - Name:     foo
+    Type:     STT_FUNC
+    Section:  .text
+    Value:    0x1004
+    Binding:  STB_GLOBAL
+  - Name:     bar
+    Type:     STT_OBJECT
+    Section:  .text
+    Value:    0x1008
+    Binding:  STB_GLOBAL
 

Modified: llvm/trunk/test/tools/llvm-objdump/verdef-elf.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objdump/verdef-elf.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objdump/verdef-elf.test (original)
+++ llvm/trunk/test/tools/llvm-objdump/verdef-elf.test Wed Apr  3 07:53:42 2019
@@ -36,6 +36,6 @@ Sections:
           - VERSION_1
           - VERSION_2
 DynamicSymbols:
-  Global:
-    - Name:            bar
+  - Name:    bar
+    Binding: STB_GLOBAL
 ...

Modified: llvm/trunk/test/tools/llvm-objdump/verneed-elf.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objdump/verneed-elf.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objdump/verneed-elf.test (original)
+++ llvm/trunk/test/tools/llvm-objdump/verneed-elf.test Wed Apr  3 07:53:42 2019
@@ -43,5 +43,5 @@ Sections:
             Flags:           12
             Other:           2
 DynamicSymbols:
-  Global:
-    - Name:            f1
+  - Name:    f1
+    Binding: STB_GLOBAL

Modified: llvm/trunk/test/tools/llvm-objdump/verneed-wrong-info.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objdump/verneed-wrong-info.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objdump/verneed-wrong-info.test (original)
+++ llvm/trunk/test/tools/llvm-objdump/verneed-wrong-info.test Wed Apr  3 07:53:42 2019
@@ -46,5 +46,5 @@ Sections:
             Flags:           12
             Other:           2
 DynamicSymbols:
-  Global:
-    - Name:            f1
+  - Name:    f1
+    Binding: STB_GLOBAL

Modified: llvm/trunk/test/tools/llvm-readobj/Inputs/dwarf-exprs.exe-x86-64.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-readobj/Inputs/dwarf-exprs.exe-x86-64.yaml?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-readobj/Inputs/dwarf-exprs.exe-x86-64.yaml (original)
+++ llvm/trunk/test/tools/llvm-readobj/Inputs/dwarf-exprs.exe-x86-64.yaml Wed Apr  3 07:53:42 2019
@@ -25,11 +25,11 @@ Sections:
     AddressAlign:    8
     Content:         1400000000000000017A5200017810011B0C070890010710140000001C000000B0F0FFFF2A00000000000000000000001400000000000000017A5200017810011B0C070890010000240000001C00000050F0FFFF20000000000E10460E184A0F0B770880003F1A3B2A332422000000001C000000440000003EF1FFFF1000000000410E108602430D064B0C07080000002C0000006400000038F1FFFF7F0C000000450C0A00491006027600450F0376780603660C0C0A00450C070800000000002C0000009400000088FDFFFF6600000000410E108602430D06428F03458E04478D058C06488307024B0C07080000000014000000C4000000C8FDFFFF01000000000000000000000000000000
 Symbols:
-  Global:
-    - Name:            myfunc
-      Type:            STT_FUNC
-      Section:         .text
-      Value:           0x0000000000400000
+  - Name:            myfunc
+    Type:            STT_FUNC
+    Section:         .text
+    Value:           0x0000000000400000
+    Binding:         STB_GLOBAL
 ProgramHeaders:
   - Type: PT_LOAD
     Flags: [ PF_X, PF_R ]

Modified: llvm/trunk/test/tools/llvm-readobj/broken-group.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-readobj/broken-group.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-readobj/broken-group.test (original)
+++ llvm/trunk/test/tools/llvm-readobj/broken-group.test Wed Apr  3 07:53:42 2019
@@ -73,9 +73,8 @@ Sections:
     Members:         
       - SectionOrType:   GRP_COMDAT
       - SectionOrType:   .foo
-Symbols:         
-  Local:           
-    - Name:            bar
-      Section:         .group
-    - Name:            zed
-      Section:         .group1
+Symbols:
+  - Name:            bar
+    Section:         .group
+  - Name:            zed
+    Section:         .group1

Modified: llvm/trunk/test/tools/llvm-readobj/demangle.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-readobj/demangle.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-readobj/demangle.test (original)
+++ llvm/trunk/test/tools/llvm-readobj/demangle.test Wed Apr  3 07:53:42 2019
@@ -210,13 +210,14 @@ Sections:
     Link: .symtab
     Content: "0102"
 Symbols:
-  Global:
-    - Name:    _Z3fooc
-      Type:    STT_FUNC
-      Section: .text.foo
-    - Name:    _Z4blahf
-      Type:    STT_FUNC
-      Section: .text.foo
+  - Name:    _Z3fooc
+    Type:    STT_FUNC
+    Section: .text.foo
+    Binding: STB_GLOBAL
+  - Name:    _Z4blahf
+    Type:    STT_FUNC
+    Section: .text.foo
+    Binding: STB_GLOBAL
 ProgramHeaders:
   - Type:  PT_LOAD
     Flags: [ PF_R, PF_X ]

Modified: llvm/trunk/test/tools/llvm-readobj/elf-no-shdrs.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-readobj/elf-no-shdrs.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-readobj/elf-no-shdrs.test (original)
+++ llvm/trunk/test/tools/llvm-readobj/elf-no-shdrs.test Wed Apr  3 07:53:42 2019
@@ -28,6 +28,6 @@ Sections:
   - Name: .text
     Type: SHT_PROGBITS
 Symbols:
-  Global:
-    - Name: foobar
-      Section: .text
+  - Name:    foobar
+    Section: .text
+    Binding: STB_GLOBAL

Modified: llvm/trunk/test/tools/llvm-readobj/elf-packed-relocs.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-readobj/elf-packed-relocs.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-readobj/elf-packed-relocs.test (original)
+++ llvm/trunk/test/tools/llvm-readobj/elf-packed-relocs.test Wed Apr  3 07:53:42 2019
@@ -41,9 +41,10 @@ Sections:
     AddressAlign:    0x0000000000000001
     Content:         41505332088020020108800280010202088180808010818080802002080181808080100802818080802004020C7E048180808010088180808020
 Symbols:
-  Global:
-    - Name:            sym1
-    - Name:            sym2
+  - Name:            sym1
+    Binding:         STB_GLOBAL
+  - Name:            sym2
+    Binding:         STB_GLOBAL
 ...
 
 # RUN: yaml2obj -docnum 2 %s | llvm-readobj -elf-output-style=LLVM -relocations - | FileCheck --check-prefix=LLVM2 %s
@@ -90,9 +91,10 @@ Sections:
     AddressAlign:    0x0000000000000001
     Content:         415053320A80200202088102830408037C08
 Symbols:
-  Global:
-    - Name:            sym1
-    - Name:            sym2
+  - Name:            sym1
+    Binding:         STB_GLOBAL
+  - Name:            sym2
+    Binding:         STB_GLOBAL
 ...
 
 # RUN: yaml2obj -docnum 3 %s | llvm-readobj -elf-output-style=LLVM -relocations - | FileCheck --check-prefix=LLVM3 %s
@@ -132,7 +134,8 @@ Sections:
     AddressAlign:    0x0000000000000001
     Content:         415053320680200208800208008001080802008001818080801008818080802002080881808080100008818080802008
 Symbols:
-  Global:
-    - Name:            sym1
-    - Name:            sym2
+  - Name:            sym1
+    Binding:         STB_GLOBAL
+  - Name:            sym2
+    Binding:         STB_GLOBAL
 ...

Modified: llvm/trunk/test/tools/llvm-readobj/elf-reloc-negative-addend-no-sym.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-readobj/elf-reloc-negative-addend-no-sym.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-readobj/elf-reloc-negative-addend-no-sym.test (original)
+++ llvm/trunk/test/tools/llvm-readobj/elf-reloc-negative-addend-no-sym.test Wed Apr  3 07:53:42 2019
@@ -60,8 +60,8 @@ Sections:
         Type: R_X86_64_NONE
         Addend: -1
 DynamicSymbols:
-  Global:
-    - Name: force_dynsym
+  - Name:    force_dynsym
+    Binding: STB_GLOBAL
 ProgramHeaders:
   - Type: PT_LOAD
     VAddr: 0x1000

Modified: llvm/trunk/test/tools/llvm-readobj/elf-reloc-symbol-with-versioning.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-readobj/elf-reloc-symbol-with-versioning.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-readobj/elf-reloc-symbol-with-versioning.test (original)
+++ llvm/trunk/test/tools/llvm-readobj/elf-reloc-symbol-with-versioning.test Wed Apr  3 07:53:42 2019
@@ -84,17 +84,25 @@ Sections:
         Symbol:          f3
         Type:            R_X86_64_JUMP_SLOT
 Symbols:
-  Global:
-    - Name:            f1
-    - Name:            f2
-    - Name:            g1
-    - Name:            _Z2f1v
-    - Name:            f3
+  - Name:            f1
+    Binding:         STB_GLOBAL
+  - Name:            f2
+    Binding:         STB_GLOBAL
+  - Name:            g1
+    Binding:         STB_GLOBAL
+  - Name:            _Z2f1v
+    Binding:         STB_GLOBAL
+  - Name:            f3
+    Binding:         STB_GLOBAL
 DynamicSymbols:  
-  Global:          
-    - Name:            f1
-    - Name:            f2
-    - Name:            g1
-    - Name:            _Z2f1v
-    - Name:            f3
+  - Name:            f1
+    Binding:         STB_GLOBAL
+  - Name:            f2
+    Binding:         STB_GLOBAL
+  - Name:            g1
+    Binding:         STB_GLOBAL
+  - Name:            _Z2f1v
+    Binding:         STB_GLOBAL
+  - Name:            f3
+    Binding:         STB_GLOBAL
 ...

Modified: llvm/trunk/test/tools/llvm-readobj/elf-reloc-zero-name-or-value.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-readobj/elf-reloc-zero-name-or-value.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-readobj/elf-reloc-zero-name-or-value.test (original)
+++ llvm/trunk/test/tools/llvm-readobj/elf-reloc-zero-name-or-value.test Wed Apr  3 07:53:42 2019
@@ -74,15 +74,15 @@ Sections:
         Addend: 1
         Symbol: sym
 Symbols:
-  Global:
-    - Name:    sym
-      Value:   0
-      Section: .text
+  - Name:    sym
+    Value:   0
+    Section: .text
+    Binding: STB_GLOBAL
 DynamicSymbols:
-  Global:
-    - Name:    sym
-      Value:   0
-      Section: .text
+  - Name:    sym
+    Value:   0
+    Section: .text
+    Binding: STB_GLOBAL
 ProgramHeaders:
   - Type: PT_LOAD
     VAddr: 0x1000

Modified: llvm/trunk/test/tools/llvm-readobj/elf-section-types.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-readobj/elf-section-types.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-readobj/elf-section-types.test (original)
+++ llvm/trunk/test/tools/llvm-readobj/elf-section-types.test Wed Apr  3 07:53:42 2019
@@ -218,5 +218,5 @@ Sections:
   - Name: hiuser
     Type: 0xffffffff
 Symbols:
-  Global:
-    - Name: foo
+  - Name:    foo
+    Binding: STB_GLOBAL

Modified: llvm/trunk/test/tools/llvm-readobj/elf-symbol-64bit.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-readobj/elf-symbol-64bit.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-readobj/elf-symbol-64bit.test (original)
+++ llvm/trunk/test/tools/llvm-readobj/elf-symbol-64bit.test Wed Apr  3 07:53:42 2019
@@ -18,7 +18,6 @@ FileHeader:
   Type:    ET_REL
   Machine: EM_X86_64
 Symbols:
-  Local:
-    - Name:  a_sym
-      Value: 0xfedcba9876543210
-      Size:  0x0123456789abcdef
+  - Name:  a_sym
+    Value: 0xfedcba9876543210
+    Size:  0x0123456789abcdef

Modified: llvm/trunk/test/tools/llvm-readobj/elf-symbol-binding.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-readobj/elf-symbol-binding.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-readobj/elf-symbol-binding.test (original)
+++ llvm/trunk/test/tools/llvm-readobj/elf-symbol-binding.test Wed Apr  3 07:53:42 2019
@@ -52,9 +52,8 @@ Sections:
     # Symbol with st_name = 19, binding = 0xf
     Content: "0000000000000000000000000000000001000000000000000000000030000000090000000000000000000000a0000000100000000000000000000000b0000000130000000000000000000000f0000000"
 Symbols:
-  Local:
-    - Name: local
-  Global:
-    - Name: global
-  Weak:
-    - Name: weak
+  - Name:    local
+  - Name:    global
+    Binding: STB_GLOBAL
+  - Name:    weak
+    Binding: STB_WEAK

Modified: llvm/trunk/test/tools/llvm-readobj/elf-symbol-shndx.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-readobj/elf-symbol-shndx.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-readobj/elf-symbol-shndx.test (original)
+++ llvm/trunk/test/tools/llvm-readobj/elf-symbol-shndx.test Wed Apr  3 07:53:42 2019
@@ -75,20 +75,26 @@ Sections:
     EntSize: 4
     Content: "0000000001000000"
 Symbols:
-  Global:
-    - Name:    undef
-    - Name:    normal
-      Section: .text
-    - Name:    common
-      Index:   SHN_COMMON
-    - Name:    absolute
-      Index:   SHN_ABS
-    - Name:    proc
-      Index:   0xff01
-    - Name:    os
-      Index:   0xff21
-    - Name:    reserved
-      Index:   0xfffe
+  - Name:    undef
+    Binding: STB_GLOBAL
+  - Name:    normal
+    Section: .text
+    Binding: STB_GLOBAL
+  - Name:    common
+    Index:   SHN_COMMON
+    Binding: STB_GLOBAL
+  - Name:    absolute
+    Index:   SHN_ABS
+    Binding: STB_GLOBAL
+  - Name:    proc
+    Index:   0xff01
+    Binding: STB_GLOBAL
+  - Name:    os
+    Index:   0xff21
+    Binding: STB_GLOBAL
+  - Name:    reserved
+    Index:   0xfffe
+    Binding: STB_GLOBAL
 
 --- !ELF
 FileHeader:
@@ -97,6 +103,6 @@ FileHeader:
   Type:    ET_REL
   Machine: EM_386
 Symbols:
-  Global:
-    - Name:    bad
-      Index:   0x42
+  - Name:    bad
+    Index:   0x42
+    Binding: STB_GLOBAL

Modified: llvm/trunk/test/tools/llvm-readobj/elf-symbol-types.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-readobj/elf-symbol-types.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-readobj/elf-symbol-types.test (original)
+++ llvm/trunk/test/tools/llvm-readobj/elf-symbol-types.test Wed Apr  3 07:53:42 2019
@@ -51,27 +51,37 @@ Sections:
   - Name: .text
     Type: SHT_PROGBITS
 Symbols:
-  Global:
-    - Name: notype
-      Type: STT_NOTYPE
-    - Name: object
-      Type: STT_OBJECT
-    - Name: func
-      Type: STT_FUNC
-    - Name: .text
-      Type: STT_SECTION
-      Section: .text
-    - Name: file
-      Type: STT_FILE
-    - Name: common
-      Type: STT_COMMON
-    - Name: tls
-      Type: STT_TLS
-    - Name: gnu_ifunc
-      Type: STT_GNU_IFUNC
-    - Name: os_specific
-      Type: 11
-    - Name: proc_specific
-      Type: 13
-    - Name: unknown
-      Type: 7
+  - Name:    notype
+    Type:    STT_NOTYPE
+    Binding: STB_GLOBAL
+  - Name:    object
+    Type:    STT_OBJECT
+    Binding: STB_GLOBAL
+  - Name:    func
+    Type:    STT_FUNC
+    Binding: STB_GLOBAL
+  - Name:    .text
+    Type:    STT_SECTION
+    Section: .text
+    Binding: STB_GLOBAL
+  - Name:    file
+    Type:    STT_FILE
+    Binding: STB_GLOBAL
+  - Name:    common
+    Type:    STT_COMMON
+    Binding: STB_GLOBAL 
+  - Name:    tls
+    Type:    STT_TLS
+    Binding: STB_GLOBAL
+  - Name:    gnu_ifunc
+    Type:    STT_GNU_IFUNC
+    Binding: STB_GLOBAL
+  - Name:    os_specific
+    Type:    11
+    Binding: STB_GLOBAL
+  - Name:    proc_specific
+    Type:    13
+    Binding: STB_GLOBAL
+  - Name:    unknown
+    Type:    7
+    Binding: STB_GLOBAL

Modified: llvm/trunk/test/tools/llvm-readobj/elf-symbol-visibility.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-readobj/elf-symbol-visibility.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-readobj/elf-symbol-visibility.test (original)
+++ llvm/trunk/test/tools/llvm-readobj/elf-symbol-visibility.test Wed Apr  3 07:53:42 2019
@@ -52,12 +52,15 @@ Sections:
     # Symbol with st_name = 1, st_other = 0x4
     Content: "0000000000000000000000000000000001000000000000000000000000040000"
 Symbols:
-  Global:
-    - Name: default
-      Visibility: STV_DEFAULT
-    - Name: internal
-      Visibility: STV_INTERNAL
-    - Name: hidden
-      Visibility: STV_HIDDEN
-    - Name: protected
-      Visibility: STV_PROTECTED
+  - Name: default
+    Visibility: STV_DEFAULT
+    Binding: STB_GLOBAL
+  - Name: internal
+    Visibility: STV_INTERNAL
+    Binding: STB_GLOBAL
+  - Name: hidden
+    Visibility: STV_HIDDEN
+    Binding: STB_GLOBAL
+  - Name: protected
+    Visibility: STV_PROTECTED
+    Binding: STB_GLOBAL

Modified: llvm/trunk/test/tools/llvm-readobj/gnu-notes.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-readobj/gnu-notes.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-readobj/gnu-notes.test (original)
+++ llvm/trunk/test/tools/llvm-readobj/gnu-notes.test Wed Apr  3 07:53:42 2019
@@ -101,20 +101,22 @@ Sections:
     AddressAlign:    0x0000000000000004
     Content:         040000000900000004000000474E5500676F6C6420312E3131000000
 Symbols:
-  Local:
-    - Name:            reduced.c
-      Type:            STT_FILE
-    - Type:            STT_FILE
-  Global:
-    - Name:            main
-      Type:            STT_FUNC
-      Section:         .text
-      Value:           0x0000000000400140
-      Size:            0x0000000000000003
-    - Name:            _edata
-      Value:           0x0000000000401000
-    - Name:            __bss_start
-      Value:           0x0000000000401000
-    - Name:            _end
-      Value:           0x0000000000401000
+  - Name:            reduced.c
+    Type:            STT_FILE
+  - Type:            STT_FILE
+  - Name:            main
+    Type:            STT_FUNC
+    Section:         .text
+    Value:           0x0000000000400140
+    Size:            0x0000000000000003
+    Binding: STB_GLOBAL
+  - Name:            _edata
+    Value:           0x0000000000401000
+    Binding: STB_GLOBAL
+  - Name:            __bss_start
+    Value:           0x0000000000401000
+    Binding: STB_GLOBAL
+  - Name:            _end
+    Value:           0x0000000000401000
+    Binding: STB_GLOBAL
 ...

Modified: llvm/trunk/test/tools/obj2yaml/elf-gnu-unique-symbols.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/obj2yaml/elf-gnu-unique-symbols.yaml?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/obj2yaml/elf-gnu-unique-symbols.yaml (original)
+++ llvm/trunk/test/tools/obj2yaml/elf-gnu-unique-symbols.yaml Wed Apr  3 07:53:42 2019
@@ -11,10 +11,9 @@
 # CHECK-NEXT:   Type:      ET_REL
 # CHECK-NEXT:   Machine:   EM_X86_64
 # CHECK-NEXT: Symbols:
-# CHECK-NEXT:   GNUUnique:
-# CHECK-NEXT:     - Name:  foo
-# CHECK-NEXT:       Type:  STT_OBJECT
-# CHECK-NEXT: DynamicSymbols: {}
+# CHECK-NEXT:   - Name:    foo
+# CHECK-NEXT:     Type:    STT_OBJECT
+# CHECK-NEXT:     Binding: STB_GNU_UNIQUE
 # CHECK-NEXT: ...
 
 --- !ELF
@@ -25,6 +24,6 @@ FileHeader:
   Type:      ET_REL
   Machine:   EM_X86_64
 Symbols:
-  GNUUnique:
-    - Name:  foo
-      Type:  STT_OBJECT
+  - Name:    foo
+    Type:    STT_OBJECT
+    Binding: STB_GNU_UNIQUE

Modified: llvm/trunk/test/tools/obj2yaml/missing_symtab.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/obj2yaml/missing_symtab.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/obj2yaml/missing_symtab.test (original)
+++ llvm/trunk/test/tools/obj2yaml/missing_symtab.test Wed Apr  3 07:53:42 2019
@@ -2,4 +2,4 @@
 # test that we don't crash when passed object files without a symbol table
 # CHECK-LABEL: FileHeader:
 # CHECK-LABEL: Sections:
-# CHECK-LABEL: Symbols:
+# CHECK-NOT: Symbols:

Modified: llvm/trunk/test/tools/obj2yaml/special-symbol-indices.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/obj2yaml/special-symbol-indices.yaml?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/obj2yaml/special-symbol-indices.yaml (original)
+++ llvm/trunk/test/tools/obj2yaml/special-symbol-indices.yaml Wed Apr  3 07:53:42 2019
@@ -4,18 +4,22 @@
 ## Test checks that we are able to handle symbols with special/reserved indices.
 
 # CHECK:      Symbols:
-# CHECK-NEXT:   Global:
-# CHECK-NEXT:     - Name:    absolute
-# CHECK-NEXT:       Index:   SHN_ABS
-# CHECK-NEXT:       Value:   0x0000000000001234
-# CHECK-NEXT:     - Name:    common
-# CHECK-NEXT:       Index:   SHN_COMMON
-# CHECK-NEXT:     - Name:    valid_index
-# CHECK-NEXT:       Section: .text
-# CHECK-NEXT:     - Name:    processor_specific_index
-# CHECK-NEXT:       Index:   SHN_HEXAGON_SCOMMON_1
-# CHECK-NEXT:     - Name:    unknown_index
-# CHECK-NEXT:       Index:   0x0000FFFE
+# CHECK-NEXT:   - Name:    absolute
+# CHECK-NEXT:     Index:   SHN_ABS
+# CHECK-NEXT:     Binding: STB_GLOBAL
+# CHECK-NEXT:     Value:   0x0000000000001234
+# CHECK-NEXT:   - Name:    common
+# CHECK-NEXT:     Index:   SHN_COMMON
+# CHECK-NEXT:     Binding: STB_GLOBAL
+# CHECK-NEXT:   - Name:    valid_index
+# CHECK-NEXT:     Section: .text
+# CHECK-NEXT:     Binding: STB_GLOBAL
+# CHECK-NEXT:   - Name:    processor_specific_index
+# CHECK-NEXT:     Index:   SHN_HEXAGON_SCOMMON_1
+# CHECK-NEXT:     Binding: STB_GLOBAL
+# CHECK-NEXT:   - Name:    unknown_index
+# CHECK-NEXT:     Index:   0x0000FFFE
+# CHECK-NEXT:     Binding: STB_GLOBAL
 
 !ELF
 FileHeader:
@@ -27,18 +31,22 @@ Sections:
   - Name: .text
     Type: SHT_PROGBITS
 Symbols:
-  Global:
-    - Name:     absolute
-      Index:    SHN_ABS
-      Value:    0x1234
-    - Name:     common
-      Index:    SHN_COMMON
-    - Name:     valid_index
-      Index:    0x1
-    - Name:     processor_specific_index
-      Index:    SHN_HEXAGON_SCOMMON_1
-    - Name:     unknown_index
-      Index:    0xfffe
+  - Name:     absolute
+    Index:    SHN_ABS
+    Value:    0x1234
+    Binding:  STB_GLOBAL
+  - Name:     common
+    Index:    SHN_COMMON
+    Binding:  STB_GLOBAL
+  - Name:     valid_index
+    Index:    0x1
+    Binding:  STB_GLOBAL
+  - Name:     processor_specific_index
+    Index:    SHN_HEXAGON_SCOMMON_1
+    Binding:  STB_GLOBAL
+  - Name:     unknown_index
+    Index:    0xfffe
+    Binding:  STB_GLOBAL
 
 ## shn_xindex.o contains a symbol with st_shndx == SHN_XINDEX.
 ## We do not support it at this moment.

Modified: llvm/trunk/test/tools/obj2yaml/symbol-type.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/obj2yaml/symbol-type.yaml?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/obj2yaml/symbol-type.yaml (original)
+++ llvm/trunk/test/tools/obj2yaml/symbol-type.yaml Wed Apr  3 07:53:42 2019
@@ -2,11 +2,12 @@
 # RUN: obj2yaml %t | FileCheck %s
 
 # CHECK:      Symbols:
-# CHECK-NEXT:   Global:
-# CHECK-NEXT:     - Name: a_known_type
-# CHECK-NEXT:       Type: STT_OBJECT
-# CHECK-NEXT:     - Name: an_unknown_type
-# CHECK-NEXT:       Type: 0x07
+# CHECK-NEXT:   - Name:    a_known_type
+# CHECK-NEXT:     Type:    STT_OBJECT
+# CHECK-NEXT:     Binding: STB_GLOBAL
+# CHECK-NEXT:   - Name:    an_unknown_type
+# CHECK-NEXT:     Type:    0x07
+# CHECK-NEXT:     Binding: STB_GLOBAL
 
 !ELF
 FileHeader:
@@ -15,8 +16,9 @@ FileHeader:
   Type:            ET_REL
   Machine:         EM_X86_64
 Symbols:
-  Global:
-    - Name: a_known_type
-      Type: STT_OBJECT
-    - Name: an_unknown_type
-      Type: 0x7
+  - Name:    a_known_type
+    Type:    STT_OBJECT
+    Binding: STB_GLOBAL
+  - Name:    an_unknown_type
+    Type:    0x7
+    Binding: STB_GLOBAL

Modified: llvm/trunk/test/tools/obj2yaml/verdef-section.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/obj2yaml/verdef-section.yaml?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/obj2yaml/verdef-section.yaml (original)
+++ llvm/trunk/test/tools/obj2yaml/verdef-section.yaml Wed Apr  3 07:53:42 2019
@@ -67,6 +67,6 @@ Sections:
           - VERSION_2
           - VERSION_3
 DynamicSymbols:
-  Global:
-    - Name:            foo
+  - Name:    foo
+    Binding: STB_GLOBAL
 ...

Modified: llvm/trunk/test/tools/obj2yaml/verneed-section.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/obj2yaml/verneed-section.yaml?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/obj2yaml/verneed-section.yaml (original)
+++ llvm/trunk/test/tools/obj2yaml/verneed-section.yaml Wed Apr  3 07:53:42 2019
@@ -65,5 +65,5 @@ Sections:
             Flags:           12
             Other:           2
 DynamicSymbols:
-  Global:
-    - Name:            f1
+  - Name:    f1
+    Binding: STB_GLOBAL

Modified: llvm/trunk/test/tools/obj2yaml/versym-section.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/obj2yaml/versym-section.yaml?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/obj2yaml/versym-section.yaml (original)
+++ llvm/trunk/test/tools/obj2yaml/versym-section.yaml Wed Apr  3 07:53:42 2019
@@ -19,11 +19,11 @@
 # CHECK-NEXT:     AddressAlign:    0x0000000000000002
 # CHECK-NEXT:     EntSize:         0x0000000000000002
 # CHECK-NEXT:     Entries:         [ 0, 3, 4 ]
-# CHECK-NEXT: Symbols:         {}
 # CHECK-NEXT: DynamicSymbols:
-# CHECK-NEXT:   Global:
-# CHECK-NEXT:     - Name:            f1
-# CHECK-NEXT:     - Name:            f2
+# CHECK-NEXT:   - Name:    f1
+# CHECK-NEXT:     Binding: STB_GLOBAL
+# CHECK-NEXT:   - Name:    f2
+# CHECK-NEXT:     Binding: STB_GLOBAL
 
 --- !ELF
 FileHeader:
@@ -42,7 +42,8 @@ Sections:
     EntSize:         0x0000000000000002
     Entries:         [ 0, 3, 4 ]
 DynamicSymbols:
-  Global:
-    - Name:            f1
-    - Name:            f2
+  - Name:    f1
+    Binding: STB_GLOBAL
+  - Name:    f2
+    Binding: STB_GLOBAL
 ...

Modified: llvm/trunk/test/tools/sanstats/elf.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/sanstats/elf.test?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/sanstats/elf.test (original)
+++ llvm/trunk/test/tools/sanstats/elf.test Wed Apr  3 07:53:42 2019
@@ -171,33 +171,34 @@ Sections:
     Relocations:     
       - Offset:          0x0000000000000027
         Type:            R_X86_64_64
-Symbols:         
-  Local:           
-    - Name:            f.c
-      Type:            STT_FILE
-    - Type:            STT_SECTION
-      Section:         .text
-    - Type:            STT_SECTION
-      Section:         .debug_str
-    - Type:            STT_SECTION
-      Section:         .debug_abbrev
-    - Type:            STT_SECTION
-      Section:         .debug_info
-    - Type:            STT_SECTION
-      Section:         .debug_line
-  Global:          
-    - Name:            f1
-      Type:            STT_FUNC
-      Section:         .text
-      Size:            0x0000000000000006
-    - Name:            f2
-      Type:            STT_FUNC
-      Section:         .text
-      Value:           0x0000000000000010
-      Size:            0x0000000000000006
-    - Name:            f3
-      Type:            STT_FUNC
-      Section:         .text
-      Value:           0x0000000000000020
-      Size:            0x0000000000000006
+Symbols:
+  - Name:            f.c
+    Type:            STT_FILE
+  - Type:            STT_SECTION
+    Section:         .text
+  - Type:            STT_SECTION
+    Section:         .debug_str
+  - Type:            STT_SECTION
+    Section:         .debug_abbrev
+  - Type:            STT_SECTION
+    Section:         .debug_info
+  - Type:            STT_SECTION
+    Section:         .debug_line
+  - Name:            f1
+    Type:            STT_FUNC
+    Section:         .text
+    Size:            0x0000000000000006
+    Binding:         STB_GLOBAL
+  - Name:            f2
+    Type:            STT_FUNC
+    Section:         .text
+    Value:           0x0000000000000010
+    Size:            0x0000000000000006
+    Binding:         STB_GLOBAL
+  - Name:            f3
+    Type:            STT_FUNC
+    Section:         .text
+    Value:           0x0000000000000020
+    Size:            0x0000000000000006
+    Binding:         STB_GLOBAL
 ...

Modified: llvm/trunk/test/tools/yaml2obj/dynamic-symbols.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/yaml2obj/dynamic-symbols.yaml?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/yaml2obj/dynamic-symbols.yaml (original)
+++ llvm/trunk/test/tools/yaml2obj/dynamic-symbols.yaml Wed Apr  3 07:53:42 2019
@@ -14,18 +14,18 @@ Sections:
     Type: SHT_PROGBITS
     Flags: [ SHF_ALLOC, SHF_WRITE ]
 DynamicSymbols:
-  Global:
-    - Name: dynglobal
-      Type: STT_OBJECT
-      Section: .data
-  Weak:
-    - Name: dynweak
-      Type: STT_OBJECT
-      Section: .data
-  Local:
-    - Name: dynlocal
-      Type: STT_OBJECT
-      Section: .data
+  - Name: dynglobal
+    Type: STT_OBJECT
+    Section: .data
+    Binding: STB_GLOBAL
+  - Name: dynweak
+    Type: STT_OBJECT
+    Section: .data
+    Binding: STB_WEAK
+  - Name: dynlocal
+    Type: STT_OBJECT
+    Section: .data
+    Binding: STB_LOCAL
 
 # SECTION: Name: .dynsym
 # SECTION-NEXT: Type: SHT_DYNSYM

Modified: llvm/trunk/test/tools/yaml2obj/dynsym-dynstr-addr.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/yaml2obj/dynsym-dynstr-addr.yaml?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/yaml2obj/dynsym-dynstr-addr.yaml (original)
+++ llvm/trunk/test/tools/yaml2obj/dynsym-dynstr-addr.yaml Wed Apr  3 07:53:42 2019
@@ -36,5 +36,5 @@ Sections:
     Address:      0x2000
     EntSize:      0x18
 DynamicSymbols:
-  Global:
-    - Name: foo
+  - Name:    foo
+    Binding: STB_GLOBAL

Modified: llvm/trunk/test/tools/yaml2obj/elf-comdat-broken.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/yaml2obj/elf-comdat-broken.yaml?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/yaml2obj/elf-comdat-broken.yaml (original)
+++ llvm/trunk/test/tools/yaml2obj/elf-comdat-broken.yaml Wed Apr  3 07:53:42 2019
@@ -16,8 +16,8 @@ Sections:
       - SectionOrType: 0xFF
       - SectionOrType: 3
 Symbols:
-  Global:
-    - Name:            foo
+  - Name:    foo
+  - Binding: STB_GLOBAL
 
 ## Check we are able to produce SHT_GROUP section with a custom Type (0xFF).
 # CHECK:       Groups {

Modified: llvm/trunk/test/tools/yaml2obj/elf-gnu-unique-symbols.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/yaml2obj/elf-gnu-unique-symbols.yaml?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/yaml2obj/elf-gnu-unique-symbols.yaml (original)
+++ llvm/trunk/test/tools/yaml2obj/elf-gnu-unique-symbols.yaml Wed Apr  3 07:53:42 2019
@@ -16,6 +16,6 @@ FileHeader:
   Type:      ET_REL
   Machine:   EM_X86_64
 Symbols:
-  GNUUnique:
-    - Name:  foo
-      Type:  STT_OBJECT
+  - Name:    foo
+    Type:    STT_OBJECT
+    Binding: STB_GNU_UNIQUE

Added: llvm/trunk/test/tools/yaml2obj/elf-symbols-binding-order.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/yaml2obj/elf-symbols-binding-order.yaml?rev=357595&view=auto
==============================================================================
--- llvm/trunk/test/tools/yaml2obj/elf-symbols-binding-order.yaml (added)
+++ llvm/trunk/test/tools/yaml2obj/elf-symbols-binding-order.yaml Wed Apr  3 07:53:42 2019
@@ -0,0 +1,18 @@
+## Check we restrict placing local symbols after global in .symtab
+## We might want to change it later to allow doing that
+## for producing broken outputs.
+
+# RUN: not yaml2obj %s -o %t 2>&1 | FileCheck %s
+# CHECK: error: Local symbol 'bar' after global in Symbols list.
+
+--- !ELF
+FileHeader:
+  Class:           ELFCLASS64
+  Data:            ELFDATA2LSB
+  Type:            ET_REL
+  Machine:         EM_X86_64
+Symbols:
+  - Name:    foo
+    Binding: STB_GLOBAL
+  - Name:    bar
+    Binding: STB_LOCAL

Modified: llvm/trunk/test/tools/yaml2obj/elf-symtab-shinfo.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/yaml2obj/elf-symtab-shinfo.yaml?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/yaml2obj/elf-symtab-shinfo.yaml (original)
+++ llvm/trunk/test/tools/yaml2obj/elf-symtab-shinfo.yaml Wed Apr  3 07:53:42 2019
@@ -36,8 +36,8 @@ Sections:
     Info:          26
     Type:          SHT_SYMTAB
 Symbols:
-  Global:
-    - Name: foo
+  - Name:    foo
+    Binding: STB_GLOBAL
 DynamicSymbols:
-  Global:
-    - Name: bar
+  - Name:    bar
+    Binding: STB_GLOBAL

Modified: llvm/trunk/test/tools/yaml2obj/elf-symtab-shtype.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/yaml2obj/elf-symtab-shtype.yaml?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/yaml2obj/elf-symtab-shtype.yaml (original)
+++ llvm/trunk/test/tools/yaml2obj/elf-symtab-shtype.yaml Wed Apr  3 07:53:42 2019
@@ -17,5 +17,5 @@ Sections:
   - Name:            .symtab
     Type:            SHT_DYNAMIC
 Symbols:
-  Global:
-    - Name: foo
+  - Name:    foo
+    Binding: STB_GLOBAL

Modified: llvm/trunk/test/tools/yaml2obj/relocation-explicit-symbol-index.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/yaml2obj/relocation-explicit-symbol-index.yaml?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/yaml2obj/relocation-explicit-symbol-index.yaml (original)
+++ llvm/trunk/test/tools/yaml2obj/relocation-explicit-symbol-index.yaml Wed Apr  3 07:53:42 2019
@@ -32,5 +32,5 @@ Sections:
         Offset: 0
         Symbol: 0x1
 Symbols:
-  Global:
-    - Name: foo
+  - Name: foo
+    Binding: STB_GLOBAL

Modified: llvm/trunk/test/tools/yaml2obj/symbol-index.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/yaml2obj/symbol-index.yaml?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/yaml2obj/symbol-index.yaml (original)
+++ llvm/trunk/test/tools/yaml2obj/symbol-index.yaml Wed Apr  3 07:53:42 2019
@@ -11,25 +11,32 @@ Sections:
   - Name: .text
     Type: SHT_PROGBITS
 Symbols:
-  Global:
-    - Name:     absolute1
-      Index:    SHN_ABS
-      Value:    0x1234
-    - Name:     absolute2
-      Index:    0xfff1
-      Value:    0x4321
-    - Name:     common1
-      Index:    SHN_COMMON
-    - Name:     common2
-      Index:    0xfff2
-    - Name:     good
-      Index:    0x1
-    - Name:     bad
-      Index:    0x42
-    - Name:     undef1
-      Index:    SHN_UNDEF
-    - Name:     undef2
-      Index:    0
+  - Name:     absolute1
+    Index:    SHN_ABS
+    Value:    0x1234
+    Binding:  STB_GLOBAL
+  - Name:     absolute2
+    Index:    0xfff1
+    Value:    0x4321
+    Binding:  STB_GLOBAL
+  - Name:     common1
+    Index:    SHN_COMMON
+    Binding:  STB_GLOBAL 
+  - Name:     common2
+    Index:    0xfff2
+    Binding:  STB_GLOBAL 
+  - Name:     good
+    Index:    0x1
+    Binding:  STB_GLOBAL
+  - Name:     bad
+    Index:    0x42
+    Binding:  STB_GLOBAL
+  - Name:     undef1
+    Index:    SHN_UNDEF
+    Binding:  STB_GLOBAL
+  - Name:     undef2
+    Index:    0
+    Binding:  STB_GLOBAL
 
 # CHECK:      Symbol table '.symtab' contains 9 entries
 # CHECK-NEXT:   Num: {{.*}} Ndx Name

Modified: llvm/trunk/test/tools/yaml2obj/symbol-type.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/yaml2obj/symbol-type.yaml?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/yaml2obj/symbol-type.yaml (original)
+++ llvm/trunk/test/tools/yaml2obj/symbol-type.yaml Wed Apr  3 07:53:42 2019
@@ -26,18 +26,24 @@ Sections:
   - Name: .text
     Type: SHT_PROGBITS
 Symbols:
-  Global:
-    - Name: notype
-      Type: STT_NOTYPE
-    - Name: normal_type
-      Type: STT_OBJECT
-    - Name: .text
-      Type: STT_SECTION
-    - Name: known_hex
-      Type: 0x1
-    - Name: unknown_hex
-      Type: 0xb
-    - Name: known_int
-      Type: 1
-    - Name: unknown_int
-      Type: 11
+  - Name:    notype
+    Type:    STT_NOTYPE
+    Binding: STB_GLOBAL 
+  - Name:    normal_type
+    Type:    STT_OBJECT
+    Binding: STB_GLOBAL
+  - Name:    .text
+    Type:    STT_SECTION
+    Binding: STB_GLOBAL
+  - Name:    known_hex
+    Type:    0x1
+    Binding: STB_GLOBAL
+  - Name:    unknown_hex
+    Type:    0xb
+    Binding: STB_GLOBAL
+  - Name:    known_int
+    Type:    1
+    Binding: STB_GLOBAL
+  - Name:    unknown_int
+    Type:    11
+    Binding: STB_GLOBAL

Modified: llvm/trunk/test/tools/yaml2obj/verdef-section.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/yaml2obj/verdef-section.yaml?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/yaml2obj/verdef-section.yaml (original)
+++ llvm/trunk/test/tools/yaml2obj/verdef-section.yaml Wed Apr  3 07:53:42 2019
@@ -64,6 +64,6 @@ Sections:
           - VERSION_2
           - VERSION_3
 DynamicSymbols:
-  Global:
-    - Name:            foo
+  - Name:    foo
+    Binding: STB_GLOBAL
 ...

Modified: llvm/trunk/test/tools/yaml2obj/verneed-section.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/yaml2obj/verneed-section.yaml?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/yaml2obj/verneed-section.yaml (original)
+++ llvm/trunk/test/tools/yaml2obj/verneed-section.yaml Wed Apr  3 07:53:42 2019
@@ -69,5 +69,5 @@ Sections:
             Flags:           12
             Other:           2
 DynamicSymbols:
-  Global:
-    - Name:            f1
+  - Name:    f1
+    Binding: STB_GLOBAL

Modified: llvm/trunk/test/tools/yaml2obj/versym-section.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/yaml2obj/versym-section.yaml?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/test/tools/yaml2obj/versym-section.yaml (original)
+++ llvm/trunk/test/tools/yaml2obj/versym-section.yaml Wed Apr  3 07:53:42 2019
@@ -82,7 +82,8 @@ Sections:
             Flags:           0
             Other:           4
 DynamicSymbols:
-  Global:
-    - Name:            f1
-    - Name:            f2
+  - Name:    f1
+    Binding: STB_GLOBAL
+  - Name:    f2
+    Binding: STB_GLOBAL
 ...

Modified: llvm/trunk/tools/obj2yaml/elf2yaml.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/obj2yaml/elf2yaml.cpp?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/tools/obj2yaml/elf2yaml.cpp (original)
+++ llvm/trunk/tools/obj2yaml/elf2yaml.cpp Wed Apr  3 07:53:42 2019
@@ -42,7 +42,7 @@ class ELFDumper {
   ArrayRef<Elf_Word> ShndxTable;
 
   std::error_code dumpSymbols(const Elf_Shdr *Symtab,
-                              ELFYAML::SymbolsDef &Symbols);
+                              std::vector<ELFYAML::Symbol> &Symbols);
   std::error_code dumpSymbol(const Elf_Sym *Sym, const Elf_Shdr *SymTab,
                              StringRef StrTable, ELFYAML::Symbol &S);
   std::error_code dumpCommonSection(const Elf_Shdr *Shdr, ELFYAML::Section &S);
@@ -226,8 +226,9 @@ template <class ELFT> ErrorOr<ELFYAML::O
 }
 
 template <class ELFT>
-std::error_code ELFDumper<ELFT>::dumpSymbols(const Elf_Shdr *Symtab,
-                                             ELFYAML::SymbolsDef &Symbols) {
+std::error_code
+ELFDumper<ELFT>::dumpSymbols(const Elf_Shdr *Symtab,
+                             std::vector<ELFYAML::Symbol> &Symbols) {
   if (!Symtab)
     return std::error_code();
 
@@ -240,33 +241,11 @@ std::error_code ELFDumper<ELFT>::dumpSym
   if (!SymtabOrErr)
     return errorToErrorCode(SymtabOrErr.takeError());
 
-  bool IsFirstSym = true;
-  for (const auto &Sym : *SymtabOrErr) {
-    if (IsFirstSym) {
-      IsFirstSym = false;
-      continue;
-    }
-
+  for (const auto &Sym : (*SymtabOrErr).drop_front()) {
     ELFYAML::Symbol S;
     if (auto EC = dumpSymbol(&Sym, Symtab, StrTable, S))
       return EC;
-
-    switch (Sym.getBinding()) {
-    case ELF::STB_LOCAL:
-      Symbols.Local.push_back(S);
-      break;
-    case ELF::STB_GLOBAL:
-      Symbols.Global.push_back(S);
-      break;
-    case ELF::STB_WEAK:
-      Symbols.Weak.push_back(S);
-      break;
-    case ELF::STB_GNU_UNIQUE:
-      Symbols.GNUUnique.push_back(S);
-      break;
-    default:
-      llvm_unreachable("Unknown ELF symbol binding");
-    }
+    Symbols.push_back(S);
   }
 
   return std::error_code();
@@ -280,6 +259,7 @@ ELFDumper<ELFT>::dumpSymbol(const Elf_Sy
   S.Value = Sym->st_value;
   S.Size = Sym->st_size;
   S.Other = Sym->st_other;
+  S.Binding = Sym->getBinding();
 
   Expected<StringRef> SymbolNameOrErr = getSymbolName(Sym, StrTable, SymTab);
   if (!SymbolNameOrErr)

Modified: llvm/trunk/tools/yaml2obj/yaml2elf.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/yaml2obj/yaml2elf.cpp?rev=357595&r1=357594&r2=357595&view=diff
==============================================================================
--- llvm/trunk/tools/yaml2obj/yaml2elf.cpp (original)
+++ llvm/trunk/tools/yaml2obj/yaml2elf.cpp Wed Apr  3 07:53:42 2019
@@ -133,7 +133,7 @@ class ELFState {
   const ELFYAML::Object &Doc;
 
   bool buildSectionIndex();
-  bool buildSymbolIndex(const ELFYAML::SymbolsDef &);
+  bool buildSymbolIndex(ArrayRef<ELFYAML::Symbol> Symbols);
   void initELFHeader(Elf_Ehdr &Header);
   void initProgramHeaders(std::vector<Elf_Phdr> &PHeaders);
   bool initSectionHeaders(std::vector<Elf_Shdr> &SHeaders,
@@ -145,8 +145,7 @@ class ELFState {
                                ContiguousBlobAccumulator &CBA);
   void setProgramHeaderLayout(std::vector<Elf_Phdr> &PHeaders,
                               std::vector<Elf_Shdr> &SHeaders);
-  void addSymbols(const std::vector<ELFYAML::Symbol> &Symbols,
-                  std::vector<Elf_Sym> &Syms, unsigned SymbolBinding,
+  void addSymbols(ArrayRef<ELFYAML::Symbol> Symbols, std::vector<Elf_Sym> &Syms,
                   const StringTableBuilder &Strtab);
   void writeSectionContent(Elf_Shdr &SHeader,
                            const ELFYAML::RawContentSection &Section,
@@ -171,7 +170,6 @@ class ELFState {
   bool writeSectionContent(Elf_Shdr &SHeader,
                            const ELFYAML::DynamicSection &Section,
                            ContiguousBlobAccumulator &CBA);
-  bool hasDynamicSymbols() const;
   SmallVector<const char *, 5> implicitSectionNames() const;
 
   // - SHT_NULL entry (placed first, i.e. 0'th entry)
@@ -323,6 +321,13 @@ bool ELFState<ELFT>::initSectionHeaders(
   return true;
 }
 
+static size_t findFirstNonGlobal(ArrayRef<ELFYAML::Symbol> Symbols) {
+  for (size_t I = 0; I < Symbols.size(); ++I)
+    if (Symbols[I].Binding.value != ELF::STB_LOCAL)
+      return I;
+  return Symbols.size();
+}
+
 template <class ELFT>
 void ELFState<ELFT>::initSymtabSectionHeader(Elf_Shdr &SHeader,
                                              SymtabType STType,
@@ -335,7 +340,7 @@ void ELFState<ELFT>::initSymtabSectionHe
   const auto &Symbols = IsStatic ? Doc.Symbols : Doc.DynamicSymbols;
   auto &Strtab = IsStatic ? DotStrtab : DotDynstr;
   // One greater than symbol table index of the last local symbol.
-  SHeader.sh_info = Symbols.Local.size() + 1;
+  SHeader.sh_info = findFirstNonGlobal(Symbols) + 1;
   SHeader.sh_entsize = sizeof(Elf_Sym);
   SHeader.sh_addralign = 8;
 
@@ -359,10 +364,7 @@ void ELFState<ELFT>::initSymtabSectionHe
     Syms.push_back(Sym);
   }
 
-  addSymbols(Symbols.Local, Syms, ELF::STB_LOCAL, Strtab);
-  addSymbols(Symbols.Global, Syms, ELF::STB_GLOBAL, Strtab);
-  addSymbols(Symbols.Weak, Syms, ELF::STB_WEAK, Strtab);
-  addSymbols(Symbols.GNUUnique, Syms, ELF::STB_GNU_UNIQUE, Strtab);
+  addSymbols(Symbols, Syms, Strtab);
 
   writeArrayData(
       CBA.getOSAndAlignedOffset(SHeader.sh_offset, SHeader.sh_addralign),
@@ -471,16 +473,15 @@ void ELFState<ELFT>::setProgramHeaderLay
 }
 
 template <class ELFT>
-void ELFState<ELFT>::addSymbols(const std::vector<ELFYAML::Symbol> &Symbols,
+void ELFState<ELFT>::addSymbols(ArrayRef<ELFYAML::Symbol> Symbols,
                                 std::vector<Elf_Sym> &Syms,
-                                unsigned SymbolBinding,
                                 const StringTableBuilder &Strtab) {
   for (const auto &Sym : Symbols) {
     Elf_Sym Symbol;
     zero(Symbol);
     if (!Sym.Name.empty())
       Symbol.st_name = Strtab.getOffset(Sym.Name);
-    Symbol.setBindingAndType(SymbolBinding, Sym.Type);
+    Symbol.setBindingAndType(Sym.Binding, Sym.Type);
     if (!Sym.Section.empty()) {
       unsigned Index;
       if (SN2I.lookup(Sym.Section, Index)) {
@@ -796,45 +797,41 @@ template <class ELFT> bool ELFState<ELFT
 }
 
 template <class ELFT>
-bool ELFState<ELFT>::buildSymbolIndex(const ELFYAML::SymbolsDef &Symbols) {
+bool ELFState<ELFT>::buildSymbolIndex(ArrayRef<ELFYAML::Symbol> Symbols) {
+  bool GlobalSymbolSeen = false;
   std::size_t I = 0;
-  for (const std::vector<ELFYAML::Symbol> &V :
-       {Symbols.Local, Symbols.Global, Symbols.Weak, Symbols.GNUUnique}) {
-    for (const auto &Sym : V) {
-      ++I;
-      if (Sym.Name.empty())
-        continue;
-      if (SymN2I.addName(Sym.Name, I)) {
-        WithColor::error() << "Repeated symbol name: '" << Sym.Name << "'.\n";
-        return false;
-      }
+  for (const auto &Sym : Symbols) {
+    ++I;
+
+    StringRef Name = Sym.Name;
+    if (Sym.Binding.value == ELF::STB_LOCAL && GlobalSymbolSeen) {
+      WithColor::error() << "Local symbol '" + Name +
+                                "' after global in Symbols list.\n";
+      return false;
+    }
+    if (Sym.Binding.value != ELF::STB_LOCAL)
+      GlobalSymbolSeen = true;
+
+    if (!Name.empty() && SymN2I.addName(Name, I)) {
+      WithColor::error() << "Repeated symbol name: '" << Name << "'.\n";
+      return false;
     }
   }
   return true;
 }
 
 template <class ELFT> void ELFState<ELFT>::finalizeStrings() {
-  auto AddSymbols = [](StringTableBuilder &StrTab,
-                       const ELFYAML::SymbolsDef &Symbols) {
-    for (const auto &Sym : Symbols.Local)
-      StrTab.add(Sym.Name);
-    for (const auto &Sym : Symbols.Global)
-      StrTab.add(Sym.Name);
-    for (const auto &Sym : Symbols.Weak)
-      StrTab.add(Sym.Name);
-    for (const auto &Sym : Symbols.GNUUnique)
-      StrTab.add(Sym.Name);
-  };
-
   // Add the regular symbol names to .strtab section.
-  AddSymbols(DotStrtab, Doc.Symbols);
+  for (const ELFYAML::Symbol &Sym : Doc.Symbols)
+    DotStrtab.add(Sym.Name);
   DotStrtab.finalize();
 
-  if (!hasDynamicSymbols())
+  if (Doc.DynamicSymbols.empty())
     return;
 
   // Add the dynamic symbol names to .dynstr section.
-  AddSymbols(DotDynstr, Doc.DynamicSymbols);
+  for (const ELFYAML::Symbol &Sym : Doc.DynamicSymbols)
+    DotDynstr.add(Sym.Name);
 
   // SHT_GNU_verdef and SHT_GNU_verneed sections might also
   // add strings to .dynstr section.
@@ -901,7 +898,7 @@ int ELFState<ELFT>::writeELF(raw_ostream
   State.initStrtabSectionHeader(SHeaders[Index], ".strtab", State.DotStrtab, CBA);
   Index = State.SN2I.get(".shstrtab");
   State.initStrtabSectionHeader(SHeaders[Index], ".shstrtab", State.DotShStrtab, CBA);
-  if (State.hasDynamicSymbols()) {
+  if (!Doc.DynamicSymbols.empty()) {
     Index = State.SN2I.get(".dynsym");
     State.initSymtabSectionHeader(SHeaders[Index], SymtabType::Dynamic, CBA);
     SHeaders[Index].sh_flags |= ELF::SHF_ALLOC;
@@ -920,16 +917,9 @@ int ELFState<ELFT>::writeELF(raw_ostream
   return 0;
 }
 
-template <class ELFT> bool ELFState<ELFT>::hasDynamicSymbols() const {
-  return !Doc.DynamicSymbols.Global.empty() ||
-         !Doc.DynamicSymbols.Weak.empty() ||
-         !Doc.DynamicSymbols.Local.empty() ||
-         !Doc.DynamicSymbols.GNUUnique.empty();
-}
-
 template <class ELFT>
 SmallVector<const char *, 5> ELFState<ELFT>::implicitSectionNames() const {
-  if (!hasDynamicSymbols())
+  if (Doc.DynamicSymbols.empty())
     return {".symtab", ".strtab", ".shstrtab"};
   return {".symtab", ".strtab", ".shstrtab", ".dynsym", ".dynstr"};
 }




More information about the llvm-commits mailing list