2 /* Various assmbly language/system dependent hacks that are required
3 so that we can minimize the amount of platform specific code. */
5 /* Define this if the system uses RELOCA. */
6 #define ELF_USES_RELOCA
8 /* Get a pointer to the argv array. On many platforms this can be
9 just the address if the first argument, on other platforms we need
10 to do something a little more subtle here. */
11 #define GET_ARGV(ARGVP, ARGS) ((ARGVP) = ((unsigned int *) &(ARGS)))
13 /* Initialization sequence for a GOT. */
14 #define INIT_GOT(GOT_BASE,MODULE) \
16 GOT_BASE[2] = (int) _dl_linux_resolve; \
17 GOT_BASE[1] = (int) (MODULE); \
20 /* Here is a macro to perform a relocation. This is only used when
21 bootstrapping the dynamic loader. RELP is the relocation that we
22 are performing, REL is the pointer to the address we are
23 relocating. SYMBOL is the symbol involved in the relocation, and
24 LOAD is the load address. */
25 #define PERFORM_BOOTSTRAP_RELOC(RELP,REL,SYMBOL,LOAD,SYMTAB) \
26 switch (ELF32_R_TYPE ((RELP)->r_info)) \
29 *(char *) (REL) = (SYMBOL) + (RELP)->r_addend; \
32 *(short *) (REL) = (SYMBOL) + (RELP)->r_addend; \
35 *(REL) = (SYMBOL) + (RELP)->r_addend; \
38 *(char *) (REL) = ((SYMBOL) + (RELP)->r_addend \
39 - (unsigned int) (REL)); \
42 *(short *) (REL) = ((SYMBOL) + (RELP)->r_addend \
43 - (unsigned int) (REL)); \
46 *(REL) = ((SYMBOL) + (RELP)->r_addend \
47 - (unsigned int) (REL)); \
49 case R_68K_GLOB_DAT: \
50 case R_68K_JMP_SLOT: \
53 case R_68K_RELATIVE: /* Compatibility kludge */ \
54 *(REL) = ((unsigned int) (LOAD) + ((RELP)->r_addend ? : *(REL))); \
61 /* Transfer control to the user's application, once the dynamic loader
65 __asm__ volatile ("unlk %%a6\n\t" \
67 : : "a" (_dl_elf_main));
71 /* Here we define the magic numbers that this dynamic loader should accept */
75 /* Used for error messages */
76 #define ELF_TARGET "m68k"
79 extern unsigned int _dl_linux_resolver (int, int, struct elf_resolve *, int);
81 /* Define this because we do not want to call .udiv in the library.
82 Not needed for m68k. */
83 #define do_rem(result, n, base) ((result) = (n) % (base))
85 /* 4096 bytes alignment */
86 #define PAGE_ALIGN 0xfffff000
87 #define ADDR_ALIGN 0xfff
88 #define OFFS_ALIGN 0x7ffff000