Commit 49bb993
authored
[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().1 parent 7a8d15e commit 49bb993
1 file changed
+3
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4047 | 4047 | | |
4048 | 4048 | | |
4049 | 4049 | | |
| 4050 | + | |
4050 | 4051 | | |
4051 | 4052 | | |
4052 | 4053 | | |
| |||
4151 | 4152 | | |
4152 | 4153 | | |
4153 | 4154 | | |
| 4155 | + | |
| 4156 | + | |
4154 | 4157 | | |
4155 | 4158 | | |
4156 | 4159 | | |
| |||
5041 | 5044 | | |
5042 | 5045 | | |
5043 | 5046 | | |
5044 | | - | |
5045 | | - | |
5046 | | - | |
5047 | | - | |
5048 | 5047 | | |
5049 | 5048 | | |
5050 | 5049 | | |
| |||
0 commit comments