Source-Changes-HG archive

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

[src/trunk]: src/libexec/ld.elf_so/arch/vax Put back the short-circuiting cod...



details:   https://anonhg.NetBSD.org/src/rev/53ceef85bf8e
branches:  trunk
changeset: 537119:53ceef85bf8e
user:      mycroft <mycroft%NetBSD.org@localhost>
date:      Fri Sep 27 03:34:22 2002 +0000

description:
Put back the short-circuiting code -- Matt claims there are functions that rely
on it.
OTOH, don't bother saving r6 a second time.

diffstat:

 libexec/ld.elf_so/arch/vax/rtld_start.S |  20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)

diffs (38 lines):

diff -r 9fcf0b4d53f6 -r 53ceef85bf8e libexec/ld.elf_so/arch/vax/rtld_start.S
--- a/libexec/ld.elf_so/arch/vax/rtld_start.S   Fri Sep 27 03:33:33 2002 +0000
+++ b/libexec/ld.elf_so/arch/vax/rtld_start.S   Fri Sep 27 03:34:22 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rtld_start.S,v 1.12 2002/09/27 02:46:05 mycroft Exp $  */
+/*     $NetBSD: rtld_start.S,v 1.13 2002/09/27 03:34:22 mycroft Exp $  */
 
 /*
  * Copyright 1996 Matt Thomas <matt%3am-software.com@localhost>
@@ -60,15 +60,23 @@
 
 /*
  * Lazy binding entry point, called via PLT.
+ *
+ * Note: Some functions rely on there not being an additional call frame;
+ * hence the `optimization' to avoid the callg opportunistically.
  */
 ALTENTRY(_rtld_bind_start)
-       pushr   $0xff           /* save R0-R7 */
-       movq    32(%sp),%r0     /* get addresses of plt.got & reloc index */
+       pushr   $0xbf           /* save R0-R5,R7 */
+       movq    28(%sp),%r0     /* get addresses of plt.got & reloc index */
        pushl   (%r1)           /* push relocation index */
        pushl   %r0             /* push address of obj entry */
        calls   $2,_rtld_bind
-       movl    %r0,36(%sp)     /* save return address onto stack */
-       popr    $0xff           /* restore R0-R7 (cond flags not modified) */
-       addl2   $4,%sp
+       movl    %r0,32(%sp)     /* save return address onto stack */
+       bicw3   6(%fp),(%r0),%r0/* does the entry mask save any additional regs */
+       popr    $0xbf           /* restore R0-R5,R7 (cond flags not modified) */
+       bneq    4f              /* yes? do it the hard way */
+       addl2   $4,%sp          /* no? skip past plt.got on stack */
+       addl2   $2,(%sp)                /*    skip past the mask */
+       rsb                     /*    and jump to it */
+4:     addl2   $4,%sp
        callg   (%ap),*(%sp)+   /* return value from _rtld_bind() == actual */
        ret



Home | Main Index | Thread Index | Old Index