This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.
I get

        .hidden DW.ref.__gxx_personality_v0
	.weak   DW.ref.__gxx_personality_v0
	.section        .gnu.linkonce.d.DW.ref.__gxx_personality_v0,"aw",@progbits
	.align 4
	.type   DW.ref.__gxx_personality_v0,@object
	.size   DW.ref.__gxx_personality_v0,4
DW.ref.__gxx_personality_v0:
	.word   __gxx_personality_v0

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?

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]