1 /* Any assembly language/system dependent hacks needed to setup boot1.c so it
2 * will work as expected and cope with whatever platform specific wierdness is
3 * needed for this architecture. See arm/boot1_arch.h for an example of what
10 .type _start,%function\n\
13 .register %g2, #scratch\n\
15 /* Allocate space for functions to drop their arguments. */\n\
17 /* Pass pointer to argument block to _dl_start. */\n\
21 .globl _dl_start_user\n\
22 .type _dl_start_user, @function\n\
24 /* Load the PIC register. */\n\
26 sethi %hi(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7\n\
27 2: or %l7, %lo(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7\n\
29 /* Save the user entry point address in %l0 */\n\
31 /* See if we were run as a command with the executable file name as an\n\
32 extra leading argument. If so, adjust the contents of the stack. */\n\
33 sethi %hi(_dl_skip_args), %g2\n\
34 or %g2, %lo(_dl_skip_args), %g2\n\
38 /* Pass our finalizer function to the user in %g1. */\n\
39 sethi %hi(_dl_fini), %g1\n\
40 or %g1, %lo(_dl_fini), %g1\n\
42 /* Jump to the user's entry point and deallocate the extra stack we got. */\n\
45 .size _dl_start_user, . - _dl_start_user\n\
50 * Get a pointer to the argv array. On many platforms this can be just
51 * the address of the first argument, on other platforms we need to
52 * do something a little more subtle here. We assume that argc is stored
53 * at the word just below the argvp that we return here.
55 #define GET_ARGV(ARGVP, ARGS) ARGVP = (((unsigned long *) ARGS) + 1)
58 * Here is a macro to perform a relocation. This is only used when
59 * bootstrapping the dynamic loader.
61 #define PERFORM_BOOTSTRAP_RELOC(RELP,REL,SYMBOL,LOAD,SYMTAB) \
62 switch(ELF_R_TYPE((RELP)->r_info)) { \
64 case R_SPARC_GLOB_DAT: \
65 *REL = SYMBOL + (RELP)->r_addend; \
67 case R_SPARC_JMP_SLOT: \
68 REL[1] = 0x03000000 | ((SYMBOL >> 10) & 0x3fffff); \
69 REL[2] = 0x81c06000 | (SYMBOL & 0x3ff); \
72 case R_SPARC_WDISP30: \
74 case R_SPARC_RELATIVE: \
75 *REL += (unsigned int) LOAD + (RELP)->r_addend; \