]> granicus.if.org Git - llvm/commit
[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)
commit36dd3d39360137a73332afe5db3c4a7b40b3a50c
tree7f1e18d434153050c8e0df336bfac2453f8a7ea3
parentcd69a7dff888239d4e35b1e26ef6d4c65f2d1549
[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
test/tools/obj2yaml/Inputs/shn_xindex.o [new file with mode: 0644]
test/tools/obj2yaml/special-symbol-indices.yaml [new file with mode: 0644]
tools/obj2yaml/elf2yaml.cpp