reloc.h 727 字节
Newer Older
1 2
#include <endian.h>

R
Rich Felker 已提交
3 4
#if __BYTE_ORDER == __BIG_ENDIAN
#define ENDIAN_SUFFIX "eb"
B
Bobby Bingham 已提交
5 6 7 8
#else
#define ENDIAN_SUFFIX ""
#endif

R
Rich Felker 已提交
9 10 11 12 13 14 15
#if __SH_FPU_ANY__ || __SH4__
#define FP_SUFFIX ""
#else
#define FP_SUFFIX "-nofpu"
#endif

#define LDSO_ARCH "sh" ENDIAN_SUFFIX FP_SUFFIX
B
Bobby Bingham 已提交
16

17
#define TPOFF_K 8
B
Bobby Bingham 已提交
18

R
Rich Felker 已提交
19 20 21 22 23 24 25 26 27 28 29 30
#define REL_SYMBOLIC    R_SH_DIR32
#define REL_OFFSET      R_SH_REL32
#define REL_GOT         R_SH_GLOB_DAT
#define REL_PLT         R_SH_JMP_SLOT
#define REL_RELATIVE    R_SH_RELATIVE
#define REL_COPY        R_SH_COPY
#define REL_DTPMOD      R_SH_TLS_DTPMOD32
#define REL_DTPOFF      R_SH_TLS_DTPOFF32
#define REL_TPOFF       R_SH_TLS_TPOFF32

#define CRTJMP(pc,sp) __asm__ __volatile__( \
	"jmp @%0 ; mov %1,r15" : : "r"(pc), "r"(sp) : "memory" )