> At the moment, I am at a loss of how to try to fix this. Any ideas? > Is there any other language which has such a feature, so a bit of > judicious copy & paste could be applied?
(GNU) C and Ada since the dawn of time. There is an entire machinery in the middle-end and the back-ends to support this (look for trampolines/descriptors in the manual and the source code). This should essentially work out of the box for any language front-end. -- Eric Botcazou