Sync usage with man page.
[netbsd-mini2440.git] / external / bsd / pcc / dist / pcc-libs / csu / darwin / i386 / dylib1.c
blobaec3080708e40b643ea696644e1408debb247165
1 /* $Id: dylib1.c,v 1.1.1.1 2009/09/04 00:27:35 gmcgarry Exp $ */
2 /*-
3 * Copyright (c) 2009 Gregory McGarry <g.mcgarry@ieee.org>
5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 #include "common.h"
21 * void _dyld_func_lookup(const char *, void **);
23 * jump to the linker via the pointer in the __dyld section
25 asm(
26 " .text\n"
27 " .private_extern __dyld_func_lookup\n"
28 "__dyld_func_lookup:\n"
29 " call L__dyld_func_lookup$pb\n"
30 "L__dyld_func_lookup$pb:\n"
31 " popl %eax\n"
32 " movl Ldyld_func_lookup-L__dyld_func_lookup$pb(%eax),%eax\n"
33 " jmp *%eax\n"
37 * void dyld_stub_binding_helper(void)
39 asm(
40 " .data\n"
41 " .p2align 2\n"
42 "dyld__mach_header:\n"
43 " .long __mh_dylib_header\n"
44 " .text\n"
45 " .private_extern dyld_stub_binding_helper\n"
46 " .p2align 2\n"
47 "dyld_stub_binding_helper:\n"
48 " call Ldyld_stub_binding_helper$pb\n"
49 "Ldyld_stub_binding_helper$pb:\n"
50 " popl %eax\n"
51 " pushl dyld__mach_header-Ldyld_stub_binding_helper$pb(%eax)\n"
52 " movl Ldyld_lazy_binder-Ldyld_stub_binding_helper$pb(%eax),%eax\n"
53 " jmp *%eax\n"
57 * __dyld section
59 asm(
60 " .dyld\n"
61 " .p2align 2\n"
62 "Ldyld_lazy_binder:\n"
63 " .long 0x8fe01000\n"
64 "Ldyld_func_lookup:\n"
65 " .long 0x8fe01008\n"
68 asm("\t.subsections_via_symbols\n");
70 IDENT("$Id: dylib1.c,v 1.1.1.1 2009/09/04 00:27:35 gmcgarry Exp $");