1 #ifndef _INTERNAL_RELOC_H
2 #define _INTERNAL_RELOC_H
10 #if UINTPTR_MAX == 0xffffffff
11 typedef Elf32_Ehdr Ehdr
;
12 typedef Elf32_Phdr Phdr
;
13 typedef Elf32_Sym Sym
;
14 #define R_TYPE(x) ((x)&255)
15 #define R_SYM(x) ((x)>>8)
16 #define R_INFO ELF32_R_INFO
18 typedef Elf64_Ehdr Ehdr
;
19 typedef Elf64_Phdr Phdr
;
20 typedef Elf64_Sym Sym
;
21 #define R_TYPE(x) ((x)&0x7fffffff)
22 #define R_SYM(x) ((x)>>32)
23 #define R_INFO ELF64_R_INFO
26 /* These enum constants provide unmatchable default values for
27 * any relocation type the arch does not use. */
48 struct fdpic_loadseg
{
49 uintptr_t addr
, p_vaddr
, p_memsz
;
52 struct fdpic_loadmap
{
53 unsigned short version
, nsegs
;
54 struct fdpic_loadseg segs
[];
57 struct fdpic_dummy_loadmap
{
58 unsigned short version
, nsegs
;
59 struct fdpic_loadseg segs
[1];
64 #ifndef FDPIC_CONSTDISP_FLAG
65 #define FDPIC_CONSTDISP_FLAG 0
72 #ifndef DL_NOMMU_SUPPORT
73 #define DL_NOMMU_SUPPORT 0
76 #ifndef TLSDESC_BACKWARDS
77 #define TLSDESC_BACKWARDS 0
81 #define IS_RELATIVE(x,s) ( \
82 (R_TYPE(x) == REL_RELATIVE) || \
83 (R_TYPE(x) == REL_SYM_OR_REL && !R_SYM(x)) )
85 #define IS_RELATIVE(x,s) ( ( \
86 (R_TYPE(x) == REL_FUNCDESC_VAL) || \
87 (R_TYPE(x) == REL_SYMBOLIC) ) \
88 && (((s)[R_SYM(x)].st_info & 0xf) == STT_SECTION) )
91 #ifndef NEED_MIPS_GOT_RELOCS
92 #define NEED_MIPS_GOT_RELOCS 0
95 #ifndef DT_DEBUG_INDIRECT
96 #define DT_DEBUG_INDIRECT 0
99 #ifndef DT_DEBUG_INDIRECT_REL
100 #define DT_DEBUG_INDIRECT_REL 0
106 typedef void (*stage2_func
)(unsigned char *, size_t *);
108 hidden
void *__dlsym(void *restrict
, const char *restrict
, void *restrict
);
110 hidden
void __dl_seterr(const char *, ...);
111 hidden
int __dl_invalid_handle(void *);
112 hidden
void __dl_vseterr(const char *, va_list);
114 hidden
ptrdiff_t __tlsdesc_static(), __tlsdesc_dynamic();
116 hidden
extern int __malloc_replaced
;
117 hidden
extern int __aligned_alloc_replaced
;
118 hidden
void __malloc_donate(char *, char *);
119 hidden
int __malloc_allzerop(void *);