mirror-llvm-project/bolt/unittests
Jinjie Huang 82488f0e71
[BOLT] Fix pwrite assertion failure via a new safePWrite wrapper (#198569)
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.
2026-07-24 19:55:26 +08:00
..
Core [BOLT] Fix pwrite assertion failure via a new safePWrite wrapper (#198569) 2026-07-24 19:55:26 +08:00
Passes [BOLT] Gate PointerAuthCFIFixup unit test on AArch64 target availability (#197464) 2026-05-19 08:46:52 -05:00
Profile [BOLT] Fixed PerfScript unittest for X86 (#207408) 2026-07-06 10:44:29 +02:00
CMakeLists.txt [BOLT] Improve DWARF CFI generation for pac-ret binaries (#163381) 2025-12-01 12:00:31 +01:00