Start recording st_other (i.e. visibility).

llvm-svn: 246577
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp
index ed1ae93..91a0bf5 100644
--- a/lld/ELF/Writer.cpp
+++ b/lld/ELF/Writer.cpp
@@ -330,6 +330,7 @@
       uint8_t Binding = InputSym->getBinding();
       ESym->setBindingAndType(Binding, Type);
       ESym->st_size = InputSym->st_size;
+      ESym->st_other = InputSym->st_other;
       if (InputSym->isAbsolute()) {
         ESym->st_shndx = SHN_ABS;
         ESym->st_value = InputSym->st_value;
diff --git a/lld/test/elf2/symbols.s b/lld/test/elf2/symbols.s
index 603739b..cfb36a2 100644
--- a/lld/test/elf2/symbols.s
+++ b/lld/test/elf2/symbols.s
@@ -33,6 +33,10 @@
 
 .comm common,4,4
 
+.global protected
+.protected protected
+protected:
+
 // CHECK:      Name: .text
 // CHECK-NEXT: Type: SHT_PROGBITS
 // CHECK-NEXT: Flags [
@@ -123,6 +127,15 @@
 // CHECK-NEXT:     Section: foobar
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
+// CHECK-NEXT:     Name: protected
+// CHECK-NEXT:     Value: 0x1010
+// CHECK-NEXT:     Size: 0
+// CHECK-NEXT:     Binding: Global
+// CHECK-NEXT:     Type: None
+// CHECK-NEXT:     Other: 3
+// CHECK-NEXT:     Section: foobar
+// CHECK-NEXT:   }
+// CHECK-NEXT:   Symbol {
 // CHECK-NEXT:     Name: zed3
 // CHECK-NEXT:     Value: 0x1010
 // CHECK-NEXT:     Size: 4