[elfabi] Fix a bug when .dynsym contains no non-local symbol
authorHaowei Wu <haowei@google.com>
Thu, 18 Feb 2021 04:10:44 +0000 (20:10 -0800)
committerHaowei Wu <haowei@google.com>
Fri, 19 Feb 2021 19:36:53 +0000 (11:36 -0800)
commit784c7debb21795a0c0a4188590a7eac14f170744
treeb65374f33e17c83bbbb28af53d79bd1c07ad20d5
parentdbc89028d737a2f116a376c3378ae1eee94239c0
[elfabi] Fix a bug when .dynsym contains no non-local symbol

This patch fixed a bug when elbabi was supplied with a tbe file
contains no non-local symbol. Before this patch, it wrote 0 to
sh_info of the .dynsym section, making the ELF stub file invalid.
This patch fixed this issue.

Differential Revision: https://reviews.llvm.org/D96930
llvm/lib/InterfaceStub/ELFObjHandler.cpp
llvm/test/tools/llvm-elfabi/write-stub-no-nonlocal-symbol.test [new file with mode: 0644]