add new syscall numbers from linux v5.1
[musl.git] / arch / sh / reloc.h
bloba1f16cb157dbf382e9e51bf3fda6f5f2b13ecde0
1 #include <endian.h>
3 #if __BYTE_ORDER == __BIG_ENDIAN
4 #define ENDIAN_SUFFIX "eb"
5 #else
6 #define ENDIAN_SUFFIX ""
7 #endif
9 #if __SH_FPU_ANY__ || __SH4__
10 #define FP_SUFFIX ""
11 #else
12 #define FP_SUFFIX "-nofpu"
13 #endif
15 #if __SH_FDPIC__
16 #define ABI_SUFFIX "-fdpic"
17 #else
18 #define ABI_SUFFIX ""
19 #endif
21 #define LDSO_ARCH "sh" ENDIAN_SUFFIX FP_SUFFIX ABI_SUFFIX
23 #define TPOFF_K 0
25 #define REL_SYMBOLIC R_SH_DIR32
26 #define REL_OFFSET R_SH_REL32
27 #define REL_GOT R_SH_GLOB_DAT
28 #define REL_PLT R_SH_JMP_SLOT
29 #define REL_RELATIVE R_SH_RELATIVE
30 #define REL_COPY R_SH_COPY
31 #define REL_DTPMOD R_SH_TLS_DTPMOD32
32 #define REL_DTPOFF R_SH_TLS_DTPOFF32
33 #define REL_TPOFF R_SH_TLS_TPOFF32
35 #define DL_NOMMU_SUPPORT 1
37 #if __SH_FDPIC__
38 #define REL_FUNCDESC R_SH_FUNCDESC
39 #define REL_FUNCDESC_VAL R_SH_FUNCDESC_VALUE
40 #undef REL_RELATIVE
41 #define DL_FDPIC 1
42 #define FDPIC_CONSTDISP_FLAG 0x100
43 #define CRTJMP(pc,sp) do { \
44 register size_t r8 __asm__("r8") = ((size_t *)(sp))[-2]; \
45 __asm__ __volatile__( "jmp @%0 ; mov %1,r15" \
46 : : "r"(pc), "r"(sp), "r"(r8) : "memory" ); } while(0)
47 #define GETFUNCSYM(fp, sym, got) __asm__ ( \
48 "mov.l 1f,%0 ; add %1,%0 ; bra 2f ; nop ; .align 2 \n" \
49 "1: .long " #sym "@GOTOFFFUNCDESC \n2:" \
50 : "=&r"(*fp) : "r"(got) : "memory" )
51 #else
52 #define CRTJMP(pc,sp) __asm__ __volatile__( \
53 "jmp @%0 ; mov %1,r15" : : "r"(pc), "r"(sp) : "memory" )
54 #endif