I am looking for a way to implement a function (pointer) with GNU lightning that has two entry points.
In native assembly, I would code something like this:
.align 16
entry1: jmp L0
.align 16
entry2: ...
...
L0: ...
The function would be represented by a pointer to entry1. If I wanted to jump to the second entry point, I would just add 16 to the pointer.
How can a similar thing be achieved with GNU lightning? So far, the best that has come to my mind is to use one more indirection. The "function pointer" points to a structure having the addresses of entry1 and entry2 as fields. (Let us assume we are in a trampoline so that the stack is already set up). But this is less efficient due to the extra indirection.
Is there a way to emulate the above native code with GNU lightning? And, if not, what would have to be added?
Marc