[BOLT] Preserve original LSDA type encoding
authorrevunov.denis@huawei.com <revunov.denis@huawei-partners.com>
Wed, 14 Sep 2022 16:29:48 +0000 (16:29 +0000)
committerrevunov.denis@huawei.com <revunov.denis@huawei-partners.com>
Wed, 14 Sep 2022 16:33:47 +0000 (16:33 +0000)
commit553c23895217cfe24404a50dede2416c9e1a3a5e
tree9d5dc309e7825e7495181c8684518fe459044c98
parentf1848b0a0ed70fc91eff50f6c47561ca24362a37
[BOLT] Preserve original LSDA type encoding

In non-pie binaries BOLT unconditionally converted type encoding
from indirect to absptr, which broke std exceptions since pointers
to their typeinfo were only assigned at runtime in .data section.
In this patch we preserve original encoding so that indirect
remains indirect and can be resolved at runtime, and absolute remains absolute.

Reviewed By: rafauler, maksfb

Differential Revision: https://reviews.llvm.org/D132484
bolt/include/bolt/Core/BinaryContext.h
bolt/include/bolt/Core/BinaryFunction.h
bolt/lib/Core/BinaryContext.cpp
bolt/lib/Core/BinaryEmitter.cpp
bolt/lib/Core/Exceptions.cpp
bolt/test/runtime/exceptions-no-pie.cpp [new file with mode: 0644]