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

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [linux/] [uClibc/] [ldso/] [include/] [ld_hash.h] - Blame information for rev 1782

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1325 phoenix
#ifndef _LD_HASH_H_
2
#define _LD_HASH_H_
3
 
4
#ifndef RTLD_NEXT
5
#define RTLD_NEXT       ((void*)-1)
6
#endif
7
 
8
struct dyn_elf{
9
  unsigned long flags;
10
  struct elf_resolve * dyn;
11
  struct dyn_elf * next_handle;  /* Used by dlopen et al. */
12
  struct dyn_elf * next;
13
  struct dyn_elf * prev;
14
};
15
 
16
struct elf_resolve{
17
  /* These entries must be in this order to be compatible with the interface used
18
     by gdb to obtain the list of symbols. */
19
  ElfW(Addr) loadaddr;          /* Base address shared object is loaded at.  */
20
  char *libname;                /* Absolute file name object was found in.  */
21
  ElfW(Dyn) *dynamic_addr;      /* Dynamic section of the shared object.  */
22
  struct elf_resolve * next;
23
  struct elf_resolve * prev;
24
  /* Nothing after this address is used by gdb. */
25
  enum {elf_lib, elf_executable,program_interpreter, loaded_file} libtype;
26
  struct dyn_elf * symbol_scope;
27
  unsigned short usage_count;
28
  unsigned short int init_flag;
29
  unsigned int nbucket;
30
  unsigned long * elf_buckets;
31
  /*
32
   * These are only used with ELF style shared libraries
33
   */
34
  unsigned long nchain;
35
  unsigned long * chains;
36
  unsigned long dynamic_info[24];
37
 
38
  unsigned long dynamic_size;
39
  unsigned long n_phent;
40
  Elf32_Phdr * ppnt;
41
 
42
#if defined(__mips__)
43
  /* Needed for MIPS relocation */
44
  unsigned long mips_gotsym;
45
  unsigned long mips_local_gotno;
46
  unsigned long mips_symtabno;
47
#endif
48
 
49
#ifdef __powerpc__
50
  /* this is used to store the address of relocation data words, so
51
   * we don't have to calculate it every time, which requires a divide */
52
  unsigned long data_words;
53
#endif
54
};
55
 
56
#define COPY_RELOCS_DONE    1
57
#define RELOCS_DONE         2
58
#define JMP_RELOCS_DONE     4
59
#define INIT_FUNCS_CALLED   8
60
 
61
extern struct dyn_elf     * _dl_symbol_tables;
62
extern struct elf_resolve * _dl_loaded_modules;
63
extern struct dyn_elf     * _dl_handles;
64
 
65
extern struct elf_resolve * _dl_check_hashed_files(const char * libname);
66
extern struct elf_resolve * _dl_add_elf_hash_table(const char * libname,
67
        char * loadaddr, unsigned long * dynamic_info,
68
        unsigned long dynamic_addr, unsigned long dynamic_size);
69
 
70
enum caller_type{symbolrel=0,copyrel=1,resolver=2};
71
extern char * _dl_find_hash(const char * name, struct dyn_elf * rpnt1,
72
        struct elf_resolve * f_tpnt, enum caller_type);
73
 
74
extern int _dl_linux_dynamic_link(void);
75
 
76
extern char * _dl_library_path;
77
extern char * _dl_not_lazy;
78
extern unsigned long _dl_elf_hash(const char * name);
79
 
80
static inline int _dl_symbol(char * name)
81
{
82
  if(name[0] != '_' || name[1] != 'd' || name[2] != 'l' || name[3] != '_')
83
    return 0;
84
  return 1;
85
}
86
 
87
 
88
#define LD_ERROR_NOFILE 1
89
#define LD_ERROR_NOZERO 2
90
#define LD_ERROR_NOTELF 3
91
#define LD_ERROR_NOTMAGIC 4
92
#define LD_ERROR_NOTDYN 5
93
#define LD_ERROR_MMAP_FAILED 6
94
#define LD_ERROR_NODYNAMIC 7
95
#define LD_WRONG_RELOCS 8
96
#define LD_BAD_HANDLE 9
97
#define LD_NO_SYMBOL 10
98
 
99
 
100
 
101
#endif /* _LD_HASH_H_ */
102
 
103
 

powered by: WebSVN 2.1.0

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