Since programs compiled after llvm15 are compile with pie by default, here if I remove the no-pie option, the Bolt-optimized program will run without SEGV errors.
I would like to know what caused the no-pie program SEGV. Thank you for your reply
In BOLT, we encode exception ranges in a way that allows us to place exception-handling code in any section or a group of sections. In practice, some exception handlers can actually be “warm”, i.e. are executed time to time. The encoding we use complies with the Itanium C++ ABI.
Unlike BOLT, LLVM backend “cheats” even under -fbasic-block-sections=all option and places all exception-handling code in the same section even when it’s comprised of multiple basic blocks. Then it uses a different encoding for LPStart member of exception ranges which libc++ has no issue with.