Hacker News new | ask | show | jobs
by cowlevel 29 days ago
Why does it need to know code size to put function addresses in the jump table?
1 comments

Not necessarily function addresses but jump table targets. Those can be in the middle of a subroutine. If you don't know the addresses then you need to keep them symbolic and if they're symbolic they are subject to change, for instance they could end up 'on the bubble' of fitting in a small offset or they might just spill over into a larger one. And that would change the data type of the jump table. If you have a built in binary code generator then will know the addresses exactly at compile time.
But the jump table uses full 64-bit absolute addresses. It can fit anything.