[BOLT] Handle broken .dynsym in stripped binaries
authorHuan Nguyen <nhuhuan@yahoo.com>
Fri, 22 Jul 2022 18:23:38 +0000 (11:23 -0700)
committerAmir Ayupov <aaupov@fb.com>
Fri, 22 Jul 2022 18:24:09 +0000 (11:24 -0700)
commit8eb68d92d4d001abce9be91dce98f8ed7d70fa3c
tree15a08e8add5b4cf789f51ce17a0ab5c3f73d293d
parent0c86c4f50c1977850334d5841d900ca7538a8488
[BOLT] Handle broken .dynsym in stripped binaries

Strip tools cause a few symbols in .dynsym to have bad section index.
This update safely keeps such broken symbols intact.

Test Plan:
```
ninja check-bolt
```

Reviewed By: Amir

Differential Revision: https://reviews.llvm.org/D130073
bolt/lib/Rewrite/RewriteInstance.cpp
bolt/test/X86/Inputs/broken_dynsym.yaml [new file with mode: 0644]
bolt/test/X86/broken_dynsym.test [new file with mode: 0644]