Remove non-TLS support for ARM.

This commit is contained in:
Joseph Myers 2011-09-11 11:15:50 +00:00
parent c26e391dd3
commit ce001f45bc
8 changed files with 15 additions and 77 deletions

View File

@ -1,3 +1,11 @@
2011-09-11 Joseph Myers <joseph@codesourcery.com>
* 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 <ramana.radhakrishnan@linaro.org> 2011-08-18 Ramana Radhakrishnan <ramana.radhakrishnan@linaro.org>
* sysdeps/unix/sysv/linux/arm/eabi/Makefile: Add libc-do-syscall * sysdeps/unix/sysv/linux/arm/eabi/Makefile: Add libc-do-syscall

View File

@ -1,6 +1,6 @@
/* Machine-dependent ELF dynamic relocation inline functions. ARM version. /* Machine-dependent ELF dynamic relocation inline functions. ARM version.
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005, 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. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@ -242,18 +242,12 @@ _dl_start_user:\n\
define the value. define the value.
ELF_RTYPE_CLASS_NOCOPY iff TYPE should not be allowed to resolve to one 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. */ 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_JUMP_SLOT || (type) == R_ARM_TLS_DTPMOD32 \
|| (type) == R_ARM_TLS_DTPOFF32 || (type) == R_ARM_TLS_TPOFF32 \ || (type) == R_ARM_TLS_DTPOFF32 || (type) == R_ARM_TLS_TPOFF32 \
|| (type) == R_ARM_TLS_DESC) \ || (type) == R_ARM_TLS_DESC) \
* ELF_RTYPE_CLASS_PLT) \ * ELF_RTYPE_CLASS_PLT) \
| (((type) == R_ARM_COPY) * ELF_RTYPE_CLASS_COPY)) | (((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. */ /* A reloc type used for ld.so cmdline arg lookups to reject PLT entries. */
#define ELF_MACHINE_JMP_SLOT R_ARM_JUMP_SLOT #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; break;
#if !defined RTLD_BOOTSTRAP #if !defined RTLD_BOOTSTRAP
#if defined USE_TLS
case R_ARM_TLS_DTPMOD32: case R_ARM_TLS_DTPMOD32:
/* Get the information from the link map returned by the /* Get the information from the link map returned by the
resolv function. */ 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; *reloc_addr += sym->st_value + sym_map->l_tls_offset;
} }
break; break;
#endif
case R_ARM_IRELATIVE: case R_ARM_IRELATIVE:
value = map->l_addr + *reloc_addr; value = map->l_addr + *reloc_addr;
value = ((Elf32_Addr (*) (void)) value) (); value = ((Elf32_Addr (*) (void)) value) ();
@ -608,7 +600,6 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
} }
break; break;
#if !defined RTLD_BOOTSTRAP #if !defined RTLD_BOOTSTRAP
#if defined USE_TLS
case R_ARM_TLS_DTPMOD32: case R_ARM_TLS_DTPMOD32:
/* Get the information from the link map returned by the /* Get the information from the link map returned by the
resolv function. */ resolv function. */
@ -628,7 +619,6 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
+ reloc->r_addend); + reloc->r_addend);
} }
break; break;
#endif
case R_ARM_IRELATIVE: case R_ARM_IRELATIVE:
value = map->l_addr + *reloc_addr; value = map->l_addr + *reloc_addr;
value = ((Elf32_Addr (*) (void)) value) (); value = ((Elf32_Addr (*) (void)) value) ();
@ -678,7 +668,6 @@ elf_machine_lazy_rel (struct link_map *map,
else else
*reloc_addr = map->l_mach.plt; *reloc_addr = map->l_mach.plt;
} }
#ifdef USE_TLS
else if (__builtin_expect (r_type == R_ARM_TLS_DESC, 1)) else if (__builtin_expect (r_type == R_ARM_TLS_DESC, 1))
{ {
struct tlsdesc volatile *td = 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)]) td->entry = (void*)(D_PTR (map, l_info[ADDRIDX (DT_TLSDESC_PLT)])
+ map->l_addr); + map->l_addr);
} }
#endif
else else
_dl_reloc_bad_type (map, r_type, 1); _dl_reloc_bad_type (map, r_type, 1);
} }

View File

@ -1,5 +1,5 @@
/* Thread-local storage handling in the ELF dynamic linker. ARM version. /* 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. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@ -31,7 +31,6 @@
@ emit debug information with cfi @ emit debug information with cfi
@ use arm-specific pseudos for unwinding itself @ use arm-specific pseudos for unwinding itself
.cfi_sections .debug_frame .cfi_sections .debug_frame
#ifdef USE_TLS
.hidden _dl_tlsdesc_return .hidden _dl_tlsdesc_return
.global _dl_tlsdesc_return .global _dl_tlsdesc_return
.type _dl_tlsdesc_return,#function .type _dl_tlsdesc_return,#function
@ -218,5 +217,3 @@ _dl_tlsdesc_resolve_hold:
.fnend .fnend
cfi_endproc cfi_endproc
.size _dl_tlsdesc_resolve_hold, .-_dl_tlsdesc_resolve_hold .size _dl_tlsdesc_resolve_hold, .-_dl_tlsdesc_resolve_hold
#endif /* USE_TLS */

View File

@ -1,5 +1,5 @@
/* Thread-local storage handling in the ELF dynamic linker. ARM version. /* 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. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@ -20,8 +20,6 @@
#include <csu/libc-tls.c> #include <csu/libc-tls.c>
#include <dl-tls.h> #include <dl-tls.h>
#if USE_TLS
/* On ARM, linker optimizations are not required, so __tls_get_addr /* On ARM, linker optimizations are not required, so __tls_get_addr
can be called even in statically linked binaries. In this case module 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 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 (); dtv_t *dtv = THREAD_DTV ();
return (char *) dtv[1].pointer.val + ti->ti_offset; return (char *) dtv[1].pointer.val + ti->ti_offset;
} }
#endif

View File

@ -1,5 +1,5 @@
/* Definition for thread-local data handling. NPTL/ARM version. /* 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. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or 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." # error "TLS support is required."
#endif #endif
/* Signal that TLS support is available. */
# define USE_TLS 1
#ifndef __ASSEMBLER__ #ifndef __ASSEMBLER__
/* Get system call information. */ /* Get system call information. */

View File

@ -1,5 +1,5 @@
/* Manage TLS descriptors. ARM version. /* 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. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@ -24,8 +24,6 @@
#include <dl-tlsdesc.h> #include <dl-tlsdesc.h>
#include <tlsdeschtab.h> #include <tlsdeschtab.h>
#ifdef USE_TLS
/* This function is used to lazily resolve TLS_DESC REL relocations /* This function is used to lazily resolve TLS_DESC REL relocations
Besides the TLS descriptor itself, we get the module's got address Besides the TLS descriptor itself, we get the module's got address
as the second parameter. */ as the second parameter. */
@ -161,4 +159,3 @@ _dl_unmap (struct link_map *map)
htab_delete (map->l_mach.tlsdesc_table); htab_delete (map->l_mach.tlsdesc_table);
#endif #endif
} }
#endif

View File

@ -7,13 +7,9 @@
-- --
-- Abuse tls.h macros to derive offsets relative to the thread register. -- Abuse tls.h macros to derive offsets relative to the thread register.
#if defined USE_TLS
TLSDESC_ARG offsetof(struct tlsdesc, argument.pointer) TLSDESC_ARG offsetof(struct tlsdesc, argument.pointer)
TLSDESC_GEN_COUNT offsetof(struct tlsdesc_dynamic_arg, gen_count) TLSDESC_GEN_COUNT offsetof(struct tlsdesc_dynamic_arg, gen_count)
TLSDESC_MODID offsetof(struct tlsdesc_dynamic_arg, tlsinfo.ti_module) TLSDESC_MODID offsetof(struct tlsdesc_dynamic_arg, tlsinfo.ti_module)
TLSDESC_MODOFF offsetof(struct tlsdesc_dynamic_arg, tlsinfo.ti_offset) TLSDESC_MODOFF offsetof(struct tlsdesc_dynamic_arg, tlsinfo.ti_offset)
#endif

View File

@ -1,5 +1,5 @@
/* Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2002, 2003, /* Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2002, 2003,
2004, 2005, 2009 2004, 2005, 2009, 2011
Free Software Foundation, Inc. Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
@ -42,7 +42,6 @@ syscall_error:
moveq r0, $EAGAIN /* Yes; translate it to EAGAIN. */ moveq r0, $EAGAIN /* Yes; translate it to EAGAIN. */
#endif #endif
#if USE___THREAD
mov ip, lr mov ip, lr
cfi_register (lr, ip) cfi_register (lr, ip)
mov r1, r0 mov r1, r0
@ -58,46 +57,6 @@ syscall_error:
RETINSTR (, ip) RETINSTR (, ip)
1: .word errno(gottpoff) + (. - 2b - 8) 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 #undef __syscall_error
END (__syscall_error) END (__syscall_error)