This is the mail archive of the
mailing list for the GCC project.
Help! DW function pointer encoding for PA
- From: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- To: gcc at gcc dot gnu dot org
- Cc: rth at redhat dot com
- Date: Thu, 21 Feb 2002 02:34:16 -0500 (EST)
- Subject: Help! DW function pointer encoding for PA
In trying to get dwarf2 exceptions and unwinding working under hppa-linux,
I have run into a problem that I don't know how to solve. The
stdexceptions.cc test program seg faults when linked with shared
libstdc++ and libgcc_s when _Unwind_RaiseException does an indirect call
to the personality function because the call doesn't use a PLABEL. A
PLABEL is required because the call goes from one library to another
and pic offset table register must be set. In order for $$dyncall
to recognize the function pointer as a PLABEL pointer, the 'L' bit
in the pointer must be set. We also need a PLABEL for the function.
There seem to be a number of issues. I have tried using indirect
encoding for pic global function pointers and munging the encoded address.
Indirect doesn't yield a plabel constructor for the function reference.
Maybe a special version of "dw2_force_const_mem" is needed?
When I munge the address in ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX to make it
look like a plabel, then the FDE search fails. So, it seems that even
if I managed to create a plabel for the function address, and a pointer
to the plabel with the 'L' bit set in the pointer, it's still unlikely
that the search will work because of the 'L' bit. Maybe, the best
solution is a port dependent method to fix function pointers that are
used for calls?
This is most serious for the personality function because it is called
directly. The jumps to the exception landing pads can be handled
although I think there are some minor issues with the priority level
of code which ideally needs to be inserted into the return pointer from
the context state.
Any thoughts on how to get this working with shared libraries?
J. David Anglin firstname.lastname@example.org
National Research Council of Canada (613) 990-0752 (FAX: 952-6605)