public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Help! DW function pointer encoding for PA
@ 2002-02-20 23:48 John David Anglin
  2002-02-21  0:52 ` Richard Henderson
  0 siblings, 1 reply; 5+ messages in thread
From: John David Anglin @ 2002-02-20 23:48 UTC (permalink / raw)
  To: gcc; +Cc: rth

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)

^ permalink raw reply	[flat|nested] 5+ messages in thread
[parent not found: <no.id>]

end of thread, other threads:[~2002-02-22  3:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-20 23:48 Help! DW function pointer encoding for PA John David Anglin
2002-02-21  0:52 ` Richard Henderson
2002-02-21 11:33   ` John David Anglin
     [not found] <no.id>
2002-02-21 13:31 ` John David Anglin
2002-02-21 19:28   ` David Edelsohn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).