llvm-project
49bb9939 - [BOLT] Fix build-time assertion in RewriteInstance (#90540)

Commit
1 year ago
[BOLT] Fix build-time assertion in RewriteInstance (#90540) We use pwrite() in RewriteInstance to update contents of existing sections. pwrite() requires file position to be set past the written offset which we guarantee at the start of rewriteFile(). Then we had an implicit assumption in patchBuildID() that the file position will be set again in patchELFSymTabs() after being reset in patchELFPHDRTable(). That assumption was broken in #90300. The fix is to save and restore file position in patchELFPHDRTable(). Then we don't have to update it again in patchELFSymTabs().
Author
Parents
Loading