Erase original jump table relocations in relocation mode with -jump-tables=move
(or higher). Otherwise we end up updating the original data relocations which
may no longer reference existing labels, as demonstrated by the test case.
Zero out the original jump table entries to trigger a crash if we end up using them.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
The plan is to explicitly zero out the original jump table entries to trigger a crash if we end up using them.
Comment Actions
We discussed the solution. @maksfb – please check if it looks good. I didn't refactor the creation of a zero symbol, we still create them ad-hoc in a couple of places.
Comment Actions
Can't proceed with this change as is.
In one internal test we end up erasing a PIC jump table entry that is added accidentally because it spuriously evaluates to a valid address/instruction/basic block inside the current function, even though it is a start of a jump table in another function, causing a runtime crash.