[obj2yaml] - Do not miss section index for special symbols.

This fixes https://bugs.llvm.org/show_bug.cgi?id=40786 
("obj2yaml symbol output missing section index for SHN_ABS and SHN_COMMON symbols")

Since SHN_ABS and SHN_COMMON symbols are special, we should preserve
the st_shndx for them. The patch does this for them and the other special symbols.

The test case is based on the test provided by James Henderson at the bug page!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354661 91177308-0d34-0410-b5e6-96231b3b80d8
3 files changed