This wouldn't be a hard optimization, and in fact it would make
shared libraries a bit easier for those cases where you can safely call
without going through a PLT (i.e. we are not using up a valuable .got
slot for a pointer). It would tend to be used for things like static
functions that we would want to do this in shared libs. For normal
executables, it is more just a question of whether the branch is in range or
not.
Remind me about this in about 4 months :-). I think the actual
code for this would be relatively simple. Note that we would leave behind
a NOP, since it would be a lot harder for the linker to compress this
out.
If someone else wants to attempt this they can, of course, and I
can give pointers as to what would be needed.
-Eric
-- "The woods are lovely, dark and deep. But I have promises to keep, And lines to code before I sleep, And lines to code before I sleep."