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

Subversion Repositories or1k

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

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
 
6
/*
7
 * Define this if the system uses RELOCA.
8
 */
9
#undef ELF_USES_RELOCA
10
 
11
/*
12
 * Get a pointer to the argv array.  On many platforms this can be just
13
 * the address if the first argument, on other platforms we need to
14
 * do something a little more subtle here.
15
 */
16
#define GET_ARGV(ARGVP, ARGS) ARGVP = ((unsigned long*) & ARGS)
17
 
18
/*
19
 * Initialization sequence for a GOT.
20
 */
21
#define INIT_GOT(GOT_BASE,MODULE)                               \
22
do {                                                            \
23
  GOT_BASE[2] = (unsigned long) _dl_linux_resolve;              \
24
  GOT_BASE[1] = (unsigned long) MODULE;                         \
25
} while(0)
26
 
27
/*
28
 * Here is a macro to perform a relocation.  This is only used when
29
 * bootstrapping the dynamic loader.  RELP is the relocation that we
30
 * are performing, REL is the pointer to the address we are relocating.
31
 * SYMBOL is the symbol involved in the relocation, and LOAD is the
32
 * load address.
33
 */
34
#define PERFORM_BOOTSTRAP_RELOC(RELP,REL,SYMBOL,LOAD,SYMTAB)    \
35
        switch(ELF32_R_TYPE((RELP)->r_info)){                   \
36
        case R_386_32:                                          \
37
          *REL += SYMBOL;                                       \
38
          break;                                                \
39
        case R_386_PC32:                                        \
40
          *REL += SYMBOL - (unsigned long) REL;                 \
41
          break;                                                \
42
        case R_386_GLOB_DAT:                                    \
43
        case R_386_JMP_SLOT:                                    \
44
          *REL = SYMBOL;                                        \
45
          break;                                                \
46
        case R_386_RELATIVE:                                    \
47
          *REL += (unsigned long) LOAD;                         \
48
          break;                                                \
49
        default:                                                \
50
          _dl_exit(1);                                          \
51
        }
52
 
53
 
54
/*
55
 * Transfer control to the user's application, once the dynamic loader
56
 * is done.  This routine has to exit the current function, then
57
 * call the _dl_elf_main function.
58
 */
59
#define START()                                                 \
60
        __asm__ volatile ("leave\n\t"                           \
61
                    "jmp *%%eax\n\t"                            \
62
                    : "=a" (status) :   "a" (_dl_elf_main))
63
 
64
 
65
 
66
/* Here we define the magic numbers that this dynamic loader should accept */
67
 
68
#define MAGIC1 EM_386
69
#undef  MAGIC2
70
/* Used for error messages */
71
#define ELF_TARGET "386"
72
 
73
struct elf_resolve;
74
extern unsigned long _dl_linux_resolver(struct elf_resolve * tpnt, int reloc_entry);
75
 
76
#define do_rem(result, n, base)  result = (n % base)
77
 
78
/* 4096 bytes alignment */
79
#define PAGE_ALIGN 0xfffff000
80
#define ADDR_ALIGN 0xfff
81
#define OFFS_ALIGN 0x7ffff000

powered by: WebSVN 2.1.0

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