OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [linux/] [uClibc/] [ldso/] [ldso/] [m68k/] [ld_sysdep.h] - Blame information for rev 1771

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1325 phoenix
 
2
/* Various assmbly language/system dependent hacks that are required
3
   so that we can minimize the amount of platform specific code. */
4
 
5
/* Define this if the system uses RELOCA.  */
6
#define ELF_USES_RELOCA
7
 
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)))
12
 
13
/* Initialization sequence for a GOT.  */
14
#define INIT_GOT(GOT_BASE,MODULE)               \
15
{                                               \
16
  GOT_BASE[2] = (int) _dl_linux_resolve;        \
17
  GOT_BASE[1] = (int) (MODULE);                 \
18
}
19
 
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))                        \
27
    {                                                           \
28
    case R_68K_8:                                               \
29
      *(char *) (REL) = (SYMBOL) + (RELP)->r_addend;            \
30
      break;                                                    \
31
    case R_68K_16:                                              \
32
      *(short *) (REL) = (SYMBOL) + (RELP)->r_addend;           \
33
      break;                                                    \
34
    case R_68K_32:                                              \
35
      *(REL) = (SYMBOL) + (RELP)->r_addend;                     \
36
      break;                                                    \
37
    case R_68K_PC8:                                             \
38
      *(char *) (REL) = ((SYMBOL) + (RELP)->r_addend            \
39
                         - (unsigned int) (REL));               \
40
      break;                                                    \
41
    case R_68K_PC16:                                            \
42
      *(short *) (REL) = ((SYMBOL) + (RELP)->r_addend           \
43
                          - (unsigned int) (REL));              \
44
      break;                                                    \
45
    case R_68K_PC32:                                            \
46
      *(REL) = ((SYMBOL) + (RELP)->r_addend                     \
47
                - (unsigned int) (REL));                        \
48
      break;                                                    \
49
    case R_68K_GLOB_DAT:                                        \
50
    case R_68K_JMP_SLOT:                                        \
51
      *(REL) = (SYMBOL);                                        \
52
      break;                                                    \
53
    case R_68K_RELATIVE:                /* Compatibility kludge */ \
54
      *(REL) = ((unsigned int) (LOAD) + ((RELP)->r_addend ? : *(REL))); \
55
      break;                                                    \
56
    default:                                                    \
57
      _dl_exit (1);                                             \
58
    }
59
 
60
 
61
/* Transfer control to the user's application, once the dynamic loader
62
   is done.  */
63
 
64
#define START()                                 \
65
  __asm__ volatile ("unlk %%a6\n\t"             \
66
                    "jmp %0@"                   \
67
                    : : "a" (_dl_elf_main));
68
 
69
 
70
 
71
/* Here we define the magic numbers that this dynamic loader should accept */
72
 
73
#define MAGIC1 EM_68K
74
#undef MAGIC2
75
/* Used for error messages */
76
#define ELF_TARGET "m68k"
77
 
78
struct elf_resolve;
79
extern unsigned int _dl_linux_resolver (int, int, struct elf_resolve *, int);
80
 
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))
84
 
85
/* 4096 bytes alignment */
86
#define PAGE_ALIGN 0xfffff000
87
#define ADDR_ALIGN 0xfff
88
#define OFFS_ALIGN 0x7ffff000

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.