]> git.proxmox.com Git - wasi-libc.git/blob - libc-top-half/musl/arch/mips64/reloc.h
Update to musl 1.2.0.
[wasi-libc.git] / libc-top-half / musl / arch / mips64 / reloc.h
1 #if __mips_isa_rev >= 6
2 #define ISA_SUFFIX "r6"
3 #else
4 #define ISA_SUFFIX ""
5 #endif
6
7 #if __BYTE_ORDER == __LITTLE_ENDIAN
8 #define ENDIAN_SUFFIX "el"
9 #else
10 #define ENDIAN_SUFFIX ""
11 #endif
12
13 #ifdef __mips_soft_float
14 #define FP_SUFFIX "-sf"
15 #else
16 #define FP_SUFFIX ""
17 #endif
18
19 #define LDSO_ARCH "mips64" ISA_SUFFIX ENDIAN_SUFFIX FP_SUFFIX
20
21 #define TPOFF_K (-0x7000)
22
23 #define REL_SYM_OR_REL 4611
24 #define REL_PLT R_MIPS_JUMP_SLOT
25 #define REL_COPY R_MIPS_COPY
26 #define REL_DTPMOD R_MIPS_TLS_DTPMOD64
27 #define REL_DTPOFF R_MIPS_TLS_DTPREL64
28 #define REL_TPOFF R_MIPS_TLS_TPREL64
29
30 #include <endian.h>
31
32 #undef R_TYPE
33 #undef R_SYM
34 #undef R_INFO
35 #define R_TYPE(x) (be64toh(x)&0x7fffffff)
36 #define R_SYM(x) (be32toh(be64toh(x)>>32))
37 #define R_INFO(s,t) (htobe64((uint64_t)htobe32(s)<<32 | (uint64_t)t))
38
39 #define NEED_MIPS_GOT_RELOCS 1
40 #define DT_DEBUG_INDIRECT DT_MIPS_RLD_MAP
41 #define ARCH_SYM_REJECT_UND(s) (!((s)->st_other & STO_MIPS_PLT))
42
43 #define CRTJMP(pc,sp) __asm__ __volatile__( \
44 "move $sp,%1 ; jr %0" : : "r"(pc), "r"(sp) : "memory" )
45
46 #define GETFUNCSYM(fp, sym, got) __asm__ ( \
47 ".hidden " #sym "\n" \
48 ".set push \n" \
49 ".set noreorder \n" \
50 ".align 8 \n" \
51 " bal 1f \n" \
52 " nop \n" \
53 " .gpdword . \n" \
54 " .gpdword " #sym " \n" \
55 "1: ld %0, ($ra) \n" \
56 " dsubu %0, $ra, %0 \n" \
57 " ld $ra, 8($ra) \n" \
58 " daddu %0, %0, $ra \n" \
59 ".set pop \n" \
60 : "=r"(*(fp)) : : "memory", "ra" )