Background: Currently, BOLT seems to implicitly assume that the .dynsym section is located at a low offset within the binary, calling pwrite() directly to update it. Issue: In scenarios where the binary has been modified by tools like patchelf, sections like .dynsym may be moved to a high offset area. This can lead to a violation of the Offset + Size <= Pos assertion in pwrite(). A typical scenario is when the previous eh_frame_header update moves the stream cursor (pos) back to a low offset([code](https://github.com/llvm/llvm-project/blob/llvmorg-23-init/bolt/lib/Rewrite/RewriteInstance.cpp#L6387)). Fix: This patch resolves the pwrite assertion failure via a new safePWrite wrapper, which introduces a defensive check that verifies and conditionally adjusts the stream position. A corresponding test case has also been added. |
||
|---|---|---|
| .. | ||
| Core | ||
| Passes | ||
| Profile | ||
| CMakeLists.txt | ||