Now that the kernel provides code user programs are executing directly (I mean the vsyscall code on x86) it is necessary to add unwind information for that code as well. The unwind information is used not only in C++ code. The new thread code also uses it for the cancellation handling. If we have no such information available we would have to resort to using int $0x80 for all syscalls which are also cancellation points (read, write, ...). Providing the information from outside the kernel is problematic. First, we would have to recognize when a process starts which code is actually used and install the appropriate unwind table. Second, we would always have to keep libc and kernel in sync. There might be new code sequences in future and once the kernel is changed you'd need a new libc. Not good at all. Instead the best way I've found is to provide the info in the kernel. Fortunately this is associated with almost no cost. The unwind table is just a block of static data which is copied at system boot time into the vsyscall page just like the normal vsyscall code. To advertise the existence and location of the unwind table I've added one more AT_* constant. It might in theory be possible to reuse AT_SYSINFO and add a fixed offset but I'd rather not do this. If/When more code is added to the vsyscall page the unwind table gets larger and you want to have the liberty to move it out of the way. This also brings up an important point: even if more entry points into the vsyscall page are defined, there will always have to be only one unwind table. It is not necessary to add more and more AT_* values to advertise more tables. The attached patch just adds the AT_* value, makes sure the AT_* value is passed to applications, define the static data for the unwind blocks (two, one for int80 and the other for sysenter), and finally code to copy the data in place. Very simple and unintrusive. The patch is verified to work nicely and unwind now works even when I use vsyscall. I've added documentation of all the unwind info but it might still be not easy to generate new data if the code sequences are changed or new sequences are added. If you want, you can add a comment somewhere which instructs people to contact me to make the changes. The patch also includes a bonus: so far all the tables in the sysenter_setup() function will stay behing even if the function gets removed after startup. They are not marked appropriately. I've added __initdata marker, but actually it should be __initrodata if this would exist. Not that it makes much of a difference, the data is gone right away after booting. -- --------------. ,-. 444 Castro Street Ulrich Drepper \ ,-----------------' \ Mountain View, CA 94041 USA Red Hat `--' drepper at redhat.com `---------------------------