head 1.10; access; symbols perseant-exfatfs-base-20250801:1.10 perseant-exfatfs-base-20240630:1.10 cjep_sun2x:1.10.0.44 cjep_sun2x-base:1.10 cjep_staticlib_x-base1:1.10 cjep_staticlib_x:1.10.0.42 cjep_staticlib_x-base:1.10 phil-wifi-20200421:1.10 phil-wifi-20200411:1.10 phil-wifi-20200406:1.10 pgoyette-compat-merge-20190127:1.10 pgoyette-compat-20190127:1.10 pgoyette-compat-20190118:1.10 pgoyette-compat-1226:1.10 pgoyette-compat-1126:1.10 pgoyette-compat-1020:1.10 pgoyette-compat-0930:1.10 pgoyette-compat-0906:1.10 pgoyette-compat-0728:1.10 pgoyette-compat-0625:1.10 pgoyette-compat-0521:1.10 pgoyette-compat-0502:1.10 pgoyette-compat-0422:1.10 pgoyette-compat-0415:1.10 pgoyette-compat-0407:1.10 pgoyette-compat-0330:1.10 pgoyette-compat-0322:1.10 pgoyette-compat-0315:1.10 pgoyette-compat:1.10.0.40 pgoyette-compat-base:1.10 perseant-stdc-iso10646:1.10.0.38 perseant-stdc-iso10646-base:1.10 prg-localcount2-base3:1.10 prg-localcount2-base2:1.10 prg-localcount2-base1:1.10 prg-localcount2:1.10.0.36 prg-localcount2-base:1.10 pgoyette-localcount-20170426:1.10 bouyer-socketcan-base1:1.10 pgoyette-localcount-20170320:1.10 bouyer-socketcan:1.10.0.34 bouyer-socketcan-base:1.10 pgoyette-localcount-20170107:1.10 pgoyette-localcount-20161104:1.10 localcount-20160914:1.10 pgoyette-localcount-20160806:1.10 pgoyette-localcount-20160726:1.10 pgoyette-localcount:1.10.0.32 pgoyette-localcount-base:1.10 netbsd-5-2-3-RELEASE:1.10 netbsd-5-1-5-RELEASE:1.10 yamt-pagecache-base9:1.10 yamt-pagecache-tag8:1.10 tls-earlyentropy:1.10.0.28 tls-earlyentropy-base:1.10 riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.10 riastradh-drm2-base3:1.10 netbsd-5-2-2-RELEASE:1.10 netbsd-5-1-4-RELEASE:1.10 netbsd-5-2-1-RELEASE:1.10 netbsd-5-1-3-RELEASE:1.10 agc-symver:1.10.0.30 agc-symver-base:1.10 tls-maxphys-base:1.10 yamt-pagecache-base8:1.10 netbsd-5-2:1.10.0.26 yamt-pagecache-base7:1.10 netbsd-5-2-RELEASE:1.10 netbsd-5-2-RC1:1.10 yamt-pagecache-base6:1.10 yamt-pagecache-base5:1.10 yamt-pagecache-base4:1.10 netbsd-5-1-2-RELEASE:1.10 netbsd-5-1-1-RELEASE:1.10 yamt-pagecache-base3:1.10 yamt-pagecache-base2:1.10 yamt-pagecache:1.10.0.24 yamt-pagecache-base:1.10 bouyer-quota2-nbase:1.10 bouyer-quota2:1.10.0.22 bouyer-quota2-base:1.10 matt-nb5-pq3:1.10.0.20 matt-nb5-pq3-base:1.10 netbsd-5-1:1.10.0.18 netbsd-5-1-RELEASE:1.10 netbsd-5-1-RC4:1.10 netbsd-5-1-RC3:1.10 netbsd-5-1-RC2:1.10 netbsd-5-1-RC1:1.10 netbsd-5-0-2-RELEASE:1.10 netbsd-5-0-1-RELEASE:1.10 jym-xensuspend-nbase:1.10 netbsd-5-0:1.10.0.16 netbsd-5-0-RELEASE:1.10 netbsd-5-0-RC4:1.10 netbsd-5-0-RC3:1.10 netbsd-5-0-RC2:1.10 jym-xensuspend:1.10.0.14 jym-xensuspend-base:1.10 netbsd-5-0-RC1:1.10 netbsd-5:1.10.0.12 netbsd-5-base:1.10 mjf-devfs2:1.10.0.10 mjf-devfs2-base:1.10 yamt-pf42-base4:1.10 yamt-pf42-base3:1.10 hpcarm-cleanup-nbase:1.10 yamt-pf42-base2:1.10 yamt-pf42:1.10.0.8 yamt-pf42-base:1.10 keiichi-mipv6:1.10.0.6 keiichi-mipv6-base:1.10 cube-autoconf:1.10.0.4 cube-autoconf-base:1.10 hpcarm-cleanup:1.10.0.2 hpcarm-cleanup-base:1.10 netbsd-1-3-PATCH003:1.1 netbsd-1-3-PATCH003-CANDIDATE2:1.1 netbsd-1-3-PATCH003-CANDIDATE1:1.1 netbsd-1-3-PATCH003-CANDIDATE0:1.1 ARM32-BROKEN-RELOCS:1.2.0.2 netbsd-1-3-PATCH002:1.1 netbsd-1-3-PATCH001:1.1 netbsd-1-3-RELEASE:1.1 netbsd-1-3-BETA:1.1 netbsd-1-3:1.1.0.2 netbsd-1-3-base:1.1; locks; strict; comment @# @; 1.10 date 98.12.17.15.38.58; author pk; state dead; branches; next 1.9; 1.9 date 98.10.31.08.59.58; author matt; state Exp; branches; next 1.8; 1.8 date 98.10.23.00.51.36; author matt; state Exp; branches; next 1.7; 1.7 date 98.10.19.03.09.33; author matt; state Exp; branches; next 1.6; 1.6 date 98.08.26.15.32.02; author matt; state Exp; branches; next 1.5; 1.5 date 98.08.21.01.03.49; author matt; state Exp; branches; next 1.4; 1.4 date 98.08.20.15.12.03; author matt; state Exp; branches; next 1.3; 1.3 date 98.08.18.18.46.16; author matt; state Exp; branches; next 1.2; 1.2 date 98.01.05.22.00.49; author cgd; state Exp; branches; next 1.1; 1.1 date 95.10.19.13.10.22; author ragge; state Exp; branches; next ; desc @@ 1.10 log @These files now live in `src/libexec/ld.aout_so/arch' @ text @/* $NetBSD: mdprologue.S,v 1.9 1998/10/31 08:59:58 matt Exp $ */ /* * Copyright (c) 1998 Matt Thomas * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* * i386 run-time link editor entry points. */ .text .globl _binder, _binder_entry .globl _rtl .type _rtl,@@function /* * _rtl(int version, struct crt_ldso *crtp) */ .align 2 _rtl: /* crt0 calls us here */ .word 0 /* no registers to save */ movl 8(ap),r0 /* load crtp into r0 */ /* setup arguments for rtld() */ /* * Add the 1st entry in the GOT (e.g. __DYNAMIC) to the base * address of ld.so and pushd that onto the stack. */ addl3 __GLOBAL_OFFSET_TABLE_,(r0),-(sp) pushl r0 /* 2nd arg == crtp */ pushl 4(ap) /* 1st arg == version */ calls $3,_rtld /* _rtld(version, crtp, DYNAMIC) */ movpsl -(sp) /* flush the instruction cache */ pushab 1f /* by issuing an */ rei /* rei. */ 1: ret /* * First call to a procedure generally comes through here for binding. * We got here via JSB so now (sp) is inside our jmpslot_t. So we * simply preserve our registers, push the address of jmpslot_t for * _binder. Save the address we are supported to call (which was * returned in R0) in the stack location that the JSB used to store * its return address (which we don't care about anymore). * * Check to see the function has a zero entry mask. Since we * were called with a zero entry, if the function we need to call * also has a zero entry mask, we can let it use our call frame * and jump inside of it to its first instruction. Otherwise we'll * call the actual function the slow way and return. * * The above optimization is required in order for vfork(2) to * work properly in shared libraries. DO NOT REMOVE IT. */ .align 1 .type _binder_entry,@@label _binder_entry: pushr $0x3f /* save r0 to r5 */ #ifdef DEBUG pushl $29 pushab LC1 pushl $2 calls $3,_write #endif subl3 $8, 24(sp), -(sp) /* point to beginning of jmpslot */ bicl2 $3, (sp) calls $1, _binder /* _binder(jsp) */ movpsl -(sp) /* flush the instruction cache */ pushab 1f /* by issuing an */ rei /* rei. */ 1: movl r0, 24(sp) /* save return address onto stack */ popr $0x3f /* restore r0 to r5 */ tstw *(sp) /* does the entry mask save any regs */ bneq 2f /* yes? do it the hard way */ addl2 $2,(sp) /* no? skip past the mask */ rsb /* and jump to it */ 2: callg (ap), *(sp)+ /* return value from _binder() == actual */ ret #ifdef DEBUG LC1: .asciz "ld.so: entered _binder_entry\n" #endif @ 1.9 log @Remove reference to unused include file. @ text @d1 1 a1 1 /* $NetBSD: mdprologue.S,v 1.8 1998/10/23 00:51:36 matt Exp $ */ @ 1.8 log @More fixes and optimizations for VAX shared library support. Including one that makes vfork work. @ text @d1 1 a1 1 /* $NetBSD: mdprologue.S,v 1.7 1998/10/19 03:09:33 matt Exp $ */ a32 2 #include @ 1.7 log @Back out change to md_make_gotreloc which added 4 arguement of got_t *. Add argument to md_fix_jmpslot indicating whether this the first (i.e tranfer) jmpslot or not. Add better support for VAX (the VAX can support pure text code; let ld that advantage of it). Checking in verified and working versions of rtld VAX support routines. @ text @d1 1 a1 1 /* $NetBSD: mdprologue.S,v 1.6 1998/08/26 15:32:02 matt Exp $ */ d65 14 a78 4 * We got here via JSB so now (sp) is pointing to the reloc_index * inside our jmpslot_t. So we simply preserve our registers, * pushd the address again for _binder. Save R0 on the stack that * the JSB used. Call the actual function and return. d90 2 a91 1 subl3 $9, 24(sp), -(sp) /* point to beginning of jmpslot */ d93 4 a96 1 movl r0, 24(sp) d98 5 a102 1 callg (ap), *(sp)+ /* return value from _binder() == actual */ @ 1.6 log @Fix some obvious bugs. @ text @d1 1 a1 1 /* $NetBSD: mdprologue.S,v 1.5 1998/08/21 01:03:49 matt Exp $ */ d38 2 d45 1 a45 1 .align 1 a49 1 /* movab _binder_entry, __PROCEDURE_LINKAGE_TABLE_+4 */ d58 4 a61 1 ret d71 1 d74 7 a80 1 pushl 24(sp) d86 3 @ 1.5 log @More changes for shareable libraries and PIC code @ text @d1 1 a1 1 /* $NetBSD: mdprologue.S,v 1.4 1998/08/20 15:12:03 matt Exp $ */ a37 1 .globl _GLOBAL_OFFSET_TABLE_ d43 1 d46 1 a46 1 movl 4(sp),r0 /* load crtp into r0 */ d48 1 d55 1 a55 1 pushl (ap) /* 1st arg == version */ d66 1 a66 1 @ 1.4 log @Get md.c to compile again. Get mdprologue.S to assemble. [Now at least ld and rtld compile and link.] @ text @d1 1 a1 1 /* $NetBSD: mdprologue.S,v 1.3 1998/08/18 18:46:16 matt Exp $ */ d52 1 a52 1 addl3 _GLOBAL_OFFSET_TABLE_,(r0),-(sp) @ 1.3 log @Untested(!!) beginning of VAX a.out shared library support. This is a work in progress. @ text @d1 1 a1 1 /* $NetBSD: mdprologue.S,v 1.2 1998/01/05 22:00:49 cgd Exp $ */ d38 1 d44 8 a51 6 _rtl: # crt0 calls us here .word 0 # no registers to save movl 4(sp),r0 # load crtp into r0 # setup arguments for rtld() # Add the 1st entry in the GOT (e.g. __DYNAMIC) to the base # address of ld.so and pushd that onto the stack. d53 3 a55 3 pushl r0 # 2nd arg == crtp pushl 0(ap) # 1st arg == version calls $3,_rtld # _rtld(version, crtp, DYNAMIC) d58 7 a64 5 # First call to a procedure generally comes through here for binding. # We got here via JSB so now (sp) is pointing to the reloc_index # inside our jmpslot_t. So we simply preserve our registers, # pushd the address again for _binder. Save R0 on the stack that # the JSB used. Call the actual function and return. d67 1 a67 6 pushl r5 pushl r4 pushl r3 pushl r2 pushl r1 pushl r0 d69 1 a69 1 calls #1, _binder # _binder(jsp) d71 2 a72 7 popl r0 popl r1 popl r2 popl r3 popl r4 popl r5 callg (ap), @@(sp)+ # return value from _binder() == actual @ 1.2 log @RCS Id police @ text @d1 1 a1 1 /* $NetBSD$ */ d4 24 a27 1 * VAX doesn't support PIC (yet?) d29 50 @ 1.1 log @Vax support for ld, so we (at least) can link static binaries. @ text @d1 2 @