From ce001f45bc3379962988f177214a9edd07d8d311 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Sun, 11 Sep 2011 11:15:50 +0000 Subject: [PATCH] Remove non-TLS support for ARM. --- ChangeLog.arm | 8 ++++++++ sysdeps/arm/dl-machine.h | 16 ++-------------- sysdeps/arm/dl-tlsdesc.S | 5 +---- sysdeps/arm/libc-tls.c | 6 +----- sysdeps/arm/nptl/tls.h | 5 +---- sysdeps/arm/tlsdesc.c | 5 +---- sysdeps/arm/tlsdesc.sym | 4 ---- sysdeps/unix/arm/sysdep.S | 43 +------------------------------------------ 8 files changed, 15 insertions(+), 77 deletions(-) diff --git a/ChangeLog.arm b/ChangeLog.arm index 569b98f..93eee30 100644 --- a/ChangeLog.arm +++ b/ChangeLog.arm @@ -1,3 +1,11 @@ +2011-09-11 Joseph Myers + + * sysdeps/arm/dl-machine.h, sysdeps/arm/dl-tlsdesc.S, + sysdeps/arm/libc-tls.c, sysdeps/arm/nptl/tls.h, + sysdeps/arm/tlsdesc.c, sysdeps/arm/tlsdesc.sym, + sysdeps/unix/arm/sysdep.S: Remove !USE_THREAD and !USE_TLS cases. + Don't define USE_TLS. + 2011-08-18 Ramana Radhakrishnan * sysdeps/unix/sysv/linux/arm/eabi/Makefile: Add libc-do-syscall diff --git a/sysdeps/arm/dl-machine.h b/sysdeps/arm/dl-machine.h index b5d477b..1ba7700 100644 --- a/sysdeps/arm/dl-machine.h +++ b/sysdeps/arm/dl-machine.h @@ -1,6 +1,6 @@ /* Machine-dependent ELF dynamic relocation inline functions. ARM version. Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005, - 2006, 2009, 2010 Free Software Foundation, Inc. + 2006, 2009, 2010, 2011 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -242,18 +242,12 @@ _dl_start_user:\n\ define the value. ELF_RTYPE_CLASS_NOCOPY iff TYPE should not be allowed to resolve to one of the main executable's symbols, as for a COPY reloc. */ -#if defined USE_TLS && (!defined RTLD_BOOTSTRAP || USE___THREAD) -# define elf_machine_type_class(type) \ +#define elf_machine_type_class(type) \ ((((type) == R_ARM_JUMP_SLOT || (type) == R_ARM_TLS_DTPMOD32 \ || (type) == R_ARM_TLS_DTPOFF32 || (type) == R_ARM_TLS_TPOFF32 \ || (type) == R_ARM_TLS_DESC) \ * ELF_RTYPE_CLASS_PLT) \ | (((type) == R_ARM_COPY) * ELF_RTYPE_CLASS_COPY)) -#else -#define elf_machine_type_class(type) \ - ((((type) == R_ARM_JUMP_SLOT) * ELF_RTYPE_CLASS_PLT) \ - | (((type) == R_ARM_COPY) * ELF_RTYPE_CLASS_COPY)) -#endif /* A reloc type used for ld.so cmdline arg lookups to reject PLT entries. */ #define ELF_MACHINE_JMP_SLOT R_ARM_JUMP_SLOT @@ -494,7 +488,6 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc, } break; #if !defined RTLD_BOOTSTRAP -#if defined USE_TLS case R_ARM_TLS_DTPMOD32: /* Get the information from the link map returned by the resolv function. */ @@ -514,7 +507,6 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc, *reloc_addr += sym->st_value + sym_map->l_tls_offset; } break; -#endif case R_ARM_IRELATIVE: value = map->l_addr + *reloc_addr; value = ((Elf32_Addr (*) (void)) value) (); @@ -608,7 +600,6 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc, } break; #if !defined RTLD_BOOTSTRAP -#if defined USE_TLS case R_ARM_TLS_DTPMOD32: /* Get the information from the link map returned by the resolv function. */ @@ -628,7 +619,6 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc, + reloc->r_addend); } break; -#endif case R_ARM_IRELATIVE: value = map->l_addr + *reloc_addr; value = ((Elf32_Addr (*) (void)) value) (); @@ -678,7 +668,6 @@ elf_machine_lazy_rel (struct link_map *map, else *reloc_addr = map->l_mach.plt; } -#ifdef USE_TLS else if (__builtin_expect (r_type == R_ARM_TLS_DESC, 1)) { struct tlsdesc volatile *td = @@ -691,7 +680,6 @@ elf_machine_lazy_rel (struct link_map *map, td->entry = (void*)(D_PTR (map, l_info[ADDRIDX (DT_TLSDESC_PLT)]) + map->l_addr); } -#endif else _dl_reloc_bad_type (map, r_type, 1); } diff --git a/sysdeps/arm/dl-tlsdesc.S b/sysdeps/arm/dl-tlsdesc.S index 19e4ed3..c192fc9 100644 --- a/sysdeps/arm/dl-tlsdesc.S +++ b/sysdeps/arm/dl-tlsdesc.S @@ -1,5 +1,5 @@ /* Thread-local storage handling in the ELF dynamic linker. ARM version. - Copyright (C) 2006, 2010 Free Software Foundation, Inc. + Copyright (C) 2006, 2010, 2011 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -31,7 +31,6 @@ @ emit debug information with cfi @ use arm-specific pseudos for unwinding itself .cfi_sections .debug_frame -#ifdef USE_TLS .hidden _dl_tlsdesc_return .global _dl_tlsdesc_return .type _dl_tlsdesc_return,#function @@ -218,5 +217,3 @@ _dl_tlsdesc_resolve_hold: .fnend cfi_endproc .size _dl_tlsdesc_resolve_hold, .-_dl_tlsdesc_resolve_hold - -#endif /* USE_TLS */ diff --git a/sysdeps/arm/libc-tls.c b/sysdeps/arm/libc-tls.c index affb189..a6271bb 100644 --- a/sysdeps/arm/libc-tls.c +++ b/sysdeps/arm/libc-tls.c @@ -1,5 +1,5 @@ /* Thread-local storage handling in the ELF dynamic linker. ARM version. - Copyright (C) 2005 Free Software Foundation, Inc. + Copyright (C) 2005, 2011 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -20,8 +20,6 @@ #include #include -#if USE_TLS - /* On ARM, linker optimizations are not required, so __tls_get_addr can be called even in statically linked binaries. In this case module must be always 1 and PT_TLS segment exist in the binary, otherwise it @@ -33,5 +31,3 @@ __tls_get_addr (tls_index *ti) dtv_t *dtv = THREAD_DTV (); return (char *) dtv[1].pointer.val + ti->ti_offset; } - -#endif diff --git a/sysdeps/arm/nptl/tls.h b/sysdeps/arm/nptl/tls.h index f257b93..82a6881 100644 --- a/sysdeps/arm/nptl/tls.h +++ b/sysdeps/arm/nptl/tls.h @@ -1,5 +1,5 @@ /* Definition for thread-local data handling. NPTL/ARM version. - Copyright (C) 2005, 2007 Free Software Foundation, Inc. + Copyright (C) 2005, 2007, 2011 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -48,9 +48,6 @@ typedef union dtv # error "TLS support is required." #endif -/* Signal that TLS support is available. */ -# define USE_TLS 1 - #ifndef __ASSEMBLER__ /* Get system call information. */ diff --git a/sysdeps/arm/tlsdesc.c b/sysdeps/arm/tlsdesc.c index e0b970f..811d66b 100644 --- a/sysdeps/arm/tlsdesc.c +++ b/sysdeps/arm/tlsdesc.c @@ -1,5 +1,5 @@ /* Manage TLS descriptors. ARM version. - Copyright (C) 2005, 2010 Free Software Foundation, Inc. + Copyright (C) 2005, 2010, 2011 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -24,8 +24,6 @@ #include #include -#ifdef USE_TLS - /* This function is used to lazily resolve TLS_DESC REL relocations Besides the TLS descriptor itself, we get the module's got address as the second parameter. */ @@ -161,4 +159,3 @@ _dl_unmap (struct link_map *map) htab_delete (map->l_mach.tlsdesc_table); #endif } -#endif diff --git a/sysdeps/arm/tlsdesc.sym b/sysdeps/arm/tlsdesc.sym index a1deb21..3f3a13e 100644 --- a/sysdeps/arm/tlsdesc.sym +++ b/sysdeps/arm/tlsdesc.sym @@ -7,13 +7,9 @@ -- -- Abuse tls.h macros to derive offsets relative to the thread register. -#if defined USE_TLS - TLSDESC_ARG offsetof(struct tlsdesc, argument.pointer) TLSDESC_GEN_COUNT offsetof(struct tlsdesc_dynamic_arg, gen_count) TLSDESC_MODID offsetof(struct tlsdesc_dynamic_arg, tlsinfo.ti_module) TLSDESC_MODOFF offsetof(struct tlsdesc_dynamic_arg, tlsinfo.ti_offset) - -#endif diff --git a/sysdeps/unix/arm/sysdep.S b/sysdeps/unix/arm/sysdep.S index d3ad81b..dcd3ce2 100644 --- a/sysdeps/unix/arm/sysdep.S +++ b/sysdeps/unix/arm/sysdep.S @@ -1,5 +1,5 @@ /* Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2002, 2003, - 2004, 2005, 2009 + 2004, 2005, 2009, 2011 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -42,7 +42,6 @@ syscall_error: moveq r0, $EAGAIN /* Yes; translate it to EAGAIN. */ #endif -#if USE___THREAD mov ip, lr cfi_register (lr, ip) mov r1, r0 @@ -58,46 +57,6 @@ syscall_error: RETINSTR (, ip) 1: .word errno(gottpoff) + (. - 2b - 8) -#elif RTLD_PRIVATE_ERRNO - ldr r1, 1f -0: str r0, [pc, r1] - mvn r0, $0 - DO_RET(r14) - -1: .word C_SYMBOL_NAME(rtld_errno) - 0b - 8 -#elif defined(_LIBC_REENTRANT) - str lr, [sp, #-4]! - cfi_adjust_cfa_offset (4) - cfi_rel_offset (lr, 0) - str r0, [sp, #-4]! - cfi_adjust_cfa_offset (4) - bl PLTJMP(C_SYMBOL_NAME(__errno_location)) - ldr r1, [sp], #4 - cfi_adjust_cfa_offset (-4) - str r1, [r0] - mvn r0, $0 - ldr pc, [sp], #4 -#else -#ifndef PIC - ldr r1, 1f - str r0, [r1] - mvn r0, $0 - DO_RET (r14) - -1: .long C_SYMBOL_NAME(errno) -#else - @ we have to establish our PIC register - ldr r2, 1f - ldr r1, 2f -0: add r2, pc, r2 - str r0, [r1, r2] - mvn r0, $0 - DO_RET (r14) - -1: .word _GLOBAL_OFFSET_TABLE_ - 0b - 8 -2: .word C_SYMBOL_NAME(errno)(GOTOFF) -#endif -#endif #undef __syscall_error END (__syscall_error) -- 2.7.4