The function call that goes through PLT table may be performed from both ARM and Thumb code. This situation requires adding a veneer to original PLT code (which is always ARM) to effect Thumb-to-ARM transition.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/ReaderWriter/ELF/ARM/ARMRelocationPass.cpp | ||
---|---|---|
296–308 ↗ | (On Diff #22880) | Isnt a seperate entry in the PLT for a thumb call preferred ? |
555–556 ↗ | (On Diff #22880) | Say for example you call the same atom from thumb/arm, the current code would reuse the veneer generated by ARM for thumb too, is this correct ? |
lib/ReaderWriter/ELF/ARM/ARMRelocationPass.cpp | ||
---|---|---|
296–308 ↗ | (On Diff #22880) | When the same atom is called through PLT from both ARM and Thumb, it's enough to generate one PLT with transition code on top of it. ARM code will reference ARM instructions while Thumb code will first execute instruction mode switch. Obviously, I first implemented separate PLTs for ARM & Thumb, but then saw how gcc handles it in one PLT entry and decided that it's more optimal. |
555–556 ↗ | (On Diff #22880) | When the same atom is called from both modes, the one mode will call the code directly as mode switch is not needed, and the other will use the veneer generated. The conditions for veneer generation are checked in handleVeneer method, while this method only creates a veneer when requested. |