diff options
author | Eric Andersen <andersen@codepoet.org> | 2004-02-17 10:55:59 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2004-02-17 10:55:59 +0000 |
commit | e5649e61768bfd26d48aa44076d2c1e801a3e8cb (patch) | |
tree | 948076ae77832a88ff4c774d34983b23dca769f3 /ldso/ldso/sparc/dl-sysdep.h | |
parent | 0dccbee4ebd749c5a3408be7594226db9f9c2005 (diff) |
Seperate out the startup stuff from the non-startup stuff.
Begin converting some big ugly macros to inline functions
instead
Diffstat (limited to 'ldso/ldso/sparc/dl-sysdep.h')
-rw-r--r-- | ldso/ldso/sparc/dl-sysdep.h | 58 |
1 files changed, 2 insertions, 56 deletions
diff --git a/ldso/ldso/sparc/dl-sysdep.h b/ldso/ldso/sparc/dl-sysdep.h index 72a85538e..c6ac89e11 100644 --- a/ldso/ldso/sparc/dl-sysdep.h +++ b/ldso/ldso/sparc/dl-sysdep.h @@ -5,20 +5,10 @@ */ #define LINUXBIN -/* - * Define this if the system uses RELOCA. - */ +/* Define this if the system uses RELOCA. */ #define ELF_USES_RELOCA /* - * Get a pointer to the argv array. On many platforms this can be just - * the address if the first argument, on other platforms we need to - * do something a little more subtle here. We assume that argc is stored - * at the word just below the argvp that we return here. - */ -#define GET_ARGV(ARGVP, ARGS) __asm__("\tadd %%fp,68,%0\n" : "=r" (ARGVP)); - -/* * Initialization sequence for a GOT. For the Sparc, this points to the * PLT, and we need to initialize a couple of the slots. The PLT should * look like: @@ -36,54 +26,10 @@ GOT_BASE[3] = (int) MODULE; \ } -/* - * Here is a macro to perform a relocation. This is only used when - * bootstrapping the dynamic loader. - */ -#define PERFORM_BOOTSTRAP_RELOC(RELP,REL,SYMBOL,LOAD,SYMTAB) \ - switch(ELF32_R_TYPE((RELP)->r_info)) { \ - case R_SPARC_32: \ - *REL = SYMBOL + (RELP)->r_addend; \ - break; \ - case R_SPARC_GLOB_DAT: \ - *REL = SYMBOL + (RELP)->r_addend; \ - break; \ - case R_SPARC_JMP_SLOT: \ - REL[1] = 0x03000000 | ((SYMBOL >> 10) & 0x3fffff); \ - REL[2] = 0x81c06000 | (SYMBOL & 0x3ff); \ - break; \ - case R_SPARC_NONE: \ - break; \ - case R_SPARC_WDISP30: \ - break; \ - case R_SPARC_RELATIVE: \ - *REL += (unsigned int) LOAD + (RELP)->r_addend; \ - break; \ - default: \ - _dl_exit(1); \ - } - - -/* - * Transfer control to the user's application, once the dynamic loader - * is done. The crt calls atexit with $g1 if not null, so we need to - * ensure that it contains NULL. - */ - -#define START() \ - __asm__ volatile ( \ - "add %%g0,%%g0,%%g1\n\t" \ - "jmpl %0, %%o7\n\t" \ - "restore %%g0,%%g0,%%g0\n\t" \ - : /*"=r" (status) */ : \ - "r" (_dl_elf_main): "g1", "o0", "o1") - - - /* Here we define the magic numbers that this dynamic loader should accept */ - #define MAGIC1 EM_SPARC #undef MAGIC2 + /* Used for error messages */ #define ELF_TARGET "Sparc" |