From 742c1b5f14aebb2ff73e3192661cb09ca58b8ab1 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Mon, 25 Jan 2010 14:24:26 -0800 Subject: mips/ldso: Check for TLS relocation in elf_machine_type_class. * Store the symbol adress received from _dl_find_hash and do not recompute it. Signed-off-by: Khem Raj --- ldso/ldso/mips/dl-sysdep.h | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'ldso/ldso/mips/dl-sysdep.h') diff --git a/ldso/ldso/mips/dl-sysdep.h b/ldso/ldso/mips/dl-sysdep.h index 30d84fbc5..c1aad6661 100644 --- a/ldso/ldso/mips/dl-sysdep.h +++ b/ldso/ldso/mips/dl-sysdep.h @@ -163,9 +163,25 @@ void _dl_perform_mips_global_got_relocations(struct elf_resolve *tpnt, int lazy) #define OFFS_ALIGN (0x10000000000UL-0x1000) #endif /* O32 || N32 */ -#define elf_machine_type_class(type) \ - ((((type) == R_MIPS_JUMP_SLOT) * ELF_RTYPE_CLASS_PLT) \ +#if defined USE_TLS +# if _MIPS_SIM == _MIPS_SIM_ABI64 +# define elf_machine_type_class(type) \ + ((((type) == R_MIPS_JUMP_SLOT || (type) == R_MIPS_TLS_DTPMOD64 \ + || (type) == R_MIPS_TLS_DTPREL64 || (type) == R_MIPS_TLS_TPREL64) \ + * ELF_RTYPE_CLASS_PLT) \ | (((type) == R_MIPS_COPY) * ELF_RTYPE_CLASS_COPY)) +# else +# define elf_machine_type_class(type) \ + ((((type) == R_MIPS_JUMP_SLOT || (type) == R_MIPS_TLS_DTPMOD32 \ + || (type) == R_MIPS_TLS_DTPREL32 || (type) == R_MIPS_TLS_TPREL32) \ + * ELF_RTYPE_CLASS_PLT) \ + | (((type) == R_MIPS_COPY) * ELF_RTYPE_CLASS_COPY)) +# endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ +#else +#define elf_machine_type_class(type) \ + ((((type) == R_MIPS_JUMP_SLOT) * ELF_RTYPE_CLASS_PLT) \ + | (((type) == R_MIPS_COPY) * ELF_RTYPE_CLASS_COPY)) +#endif /* USE_TLS */ #define OFFSET_GP_GOT 0x7ff0 -- cgit v1.2.3