1570af302Sopenharmony_ci#if __mips_isa_rev >= 6 2570af302Sopenharmony_ci#define ISA_SUFFIX "r6" 3570af302Sopenharmony_ci#else 4570af302Sopenharmony_ci#define ISA_SUFFIX "" 5570af302Sopenharmony_ci#endif 6570af302Sopenharmony_ci 7570af302Sopenharmony_ci#if __BYTE_ORDER == __LITTLE_ENDIAN 8570af302Sopenharmony_ci#define ENDIAN_SUFFIX "el" 9570af302Sopenharmony_ci#else 10570af302Sopenharmony_ci#define ENDIAN_SUFFIX "" 11570af302Sopenharmony_ci#endif 12570af302Sopenharmony_ci 13570af302Sopenharmony_ci#ifdef __mips_soft_float 14570af302Sopenharmony_ci#define FP_SUFFIX "-sf" 15570af302Sopenharmony_ci#else 16570af302Sopenharmony_ci#define FP_SUFFIX "" 17570af302Sopenharmony_ci#endif 18570af302Sopenharmony_ci 19570af302Sopenharmony_ci#define LDSO_ARCH "mipsn32" ISA_SUFFIX ENDIAN_SUFFIX FP_SUFFIX 20570af302Sopenharmony_ci 21570af302Sopenharmony_ci#define TPOFF_K (-0x7000) 22570af302Sopenharmony_ci 23570af302Sopenharmony_ci#define REL_SYM_OR_REL R_MIPS_REL32 24570af302Sopenharmony_ci#define REL_PLT R_MIPS_JUMP_SLOT 25570af302Sopenharmony_ci#define REL_COPY R_MIPS_COPY 26570af302Sopenharmony_ci#define REL_DTPMOD R_MIPS_TLS_DTPMOD32 27570af302Sopenharmony_ci#define REL_DTPOFF R_MIPS_TLS_DTPREL32 28570af302Sopenharmony_ci#define REL_TPOFF R_MIPS_TLS_TPREL32 29570af302Sopenharmony_ci 30570af302Sopenharmony_ci#define NEED_MIPS_GOT_RELOCS 1 31570af302Sopenharmony_ci#define DT_DEBUG_INDIRECT DT_MIPS_RLD_MAP 32570af302Sopenharmony_ci#define DT_DEBUG_INDIRECT_REL DT_MIPS_RLD_MAP_REL 33570af302Sopenharmony_ci#define ARCH_SYM_REJECT_UND(s) (!((s)->st_other & STO_MIPS_PLT)) 34570af302Sopenharmony_ci 35570af302Sopenharmony_ci#define CRTJMP(pc,sp) __asm__ __volatile__( \ 36570af302Sopenharmony_ci "move $sp,%1 ; jr %0" : : "r"(pc), "r"(sp) : "memory" ) 37570af302Sopenharmony_ci 38570af302Sopenharmony_ci#define GETFUNCSYM(fp, sym, got) __asm__ ( \ 39570af302Sopenharmony_ci ".hidden " #sym "\n" \ 40570af302Sopenharmony_ci ".set push \n" \ 41570af302Sopenharmony_ci ".set noreorder \n" \ 42570af302Sopenharmony_ci " bal 1f \n" \ 43570af302Sopenharmony_ci " nop \n" \ 44570af302Sopenharmony_ci " .gpword . \n" \ 45570af302Sopenharmony_ci " .gpword " #sym " \n" \ 46570af302Sopenharmony_ci "1: lw %0, ($ra) \n" \ 47570af302Sopenharmony_ci " subu %0, $ra, %0 \n" \ 48570af302Sopenharmony_ci " lw $ra, 4($ra) \n" \ 49570af302Sopenharmony_ci " addu %0, %0, $ra \n" \ 50570af302Sopenharmony_ci ".set pop \n" \ 51570af302Sopenharmony_ci : "=r"(*(fp)) : : "memory", "ra" ) 52