[obj2yaml] - Do not miss section index for special symbols.
authorGeorge Rimar <grimar@accesssoftek.com>
Fri, 22 Feb 2019 08:45:21 +0000 (08:45 +0000)
committerGeorge Rimar <grimar@accesssoftek.com>
Fri, 22 Feb 2019 08:45:21 +0000 (08:45 +0000)
commit11358dd65d29a7ae50861aa5711092d7e9dd66d0
tree28ffe2cba36a31f0b881dc4e6248e1a7cd738dff
parent151100787d35ebdba8584f3c3df7b9db33749190
[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

llvm-svn: 354661
llvm/test/tools/obj2yaml/Inputs/shn_xindex.o [new file with mode: 0644]
llvm/test/tools/obj2yaml/special-symbol-indices.yaml [new file with mode: 0644]
llvm/tools/obj2yaml/elf2yaml.cpp