NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: port-vax/43273: ld.elf_so frame handling breaks exception unwinding for C++



The following reply was made to PR port-vax/43273; it has been noted by GNATS.

From: "Valeriy E. Ushakov" <uwe%stderr.spb.ru@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: port-vax/43273: ld.elf_so frame handling breaks exception 
unwinding for C++
Date: Fri, 12 Nov 2010 21:05:16 +0300

 This was a private mail, but since things stalled, I guess I paste it
 here for the record...
 
 The code in question is in libexec/ld.elf_so/arch/vax/rtld_start.S
 
 ----8<--------8<----
 Currently VAX plt entries look likes this:
 
   40 00        - mask = <DV=0, IV=1, no regs>
   16           - JSB
   ef           - (PC) + ...
   e0 ff ff ff  - ... displacement
   0c 00 00 00
 
 Since there are no registers saved on entry to the plt trampoline, the
 shortcut in _rtld_bind_start will never work (the comparison is also
 wrong b/c it doesn't mask out the SPA and S bits saved in the stack
 frame).
 
 Perhaps we can change plt entry mask to save all registers, i.e. to
 0x7fff = <DV=0, IV=1, R0..R11>?
 
 We also need to fix the comparison that triggers the shortcut:
 
 In the stack frame the halfword at 6(%fp) is:
 
   111 1 11
   543 2 109876543210
   SPA S  saved regs (== all 1s with the changed plt mask)
 
 The mask at the beginning of the procedure at (%r0) is:
 
   1 1 11 11
   5 4 32 109876543210
   D I MBZ saved regs
   V V
 
 So we need to
 
 1) only compare low 12 bits of the arguments
 
 2) if we take the shortcut, we need to set DV and IV bits of the PSW
    according to DV and IV bits according to the procedure mask (using
    bispsw/bicpsw/movpsl i guess)
 
 -uwe
 


Home | Main Index | Thread Index | Old Index