diff options
author | Ulrich Drepper <drepper@gmail.com> | 2011-09-10 16:50:28 -0400 |
---|---|---|
committer | Ulrich Drepper <drepper@gmail.com> | 2011-09-10 16:50:28 -0400 |
commit | d063d164335938d557460bebaa7cfe388157b627 (patch) | |
tree | 92ef3f54771c0a28190b76ee45f90d16fd39714f /sysdeps/powerpc | |
parent | 3ce1f2959437e952b9db4eaeed2407424f11a4d1 (diff) | |
download | glibc-d063d164335938d557460bebaa7cfe388157b627.tar glibc-d063d164335938d557460bebaa7cfe388157b627.tar.gz glibc-d063d164335938d557460bebaa7cfe388157b627.tar.bz2 glibc-d063d164335938d557460bebaa7cfe388157b627.zip |
Remove support for !USE___THREAD
Diffstat (limited to 'sysdeps/powerpc')
-rw-r--r-- | sysdeps/powerpc/powerpc32/dl-machine.h | 13 | ||||
-rw-r--r-- | sysdeps/powerpc/powerpc64/dl-machine.h | 90 |
2 files changed, 45 insertions, 58 deletions
diff --git a/sysdeps/powerpc/powerpc32/dl-machine.h b/sysdeps/powerpc/powerpc32/dl-machine.h index 5351d9691d..e7052b69d5 100644 --- a/sysdeps/powerpc/powerpc32/dl-machine.h +++ b/sysdeps/powerpc/powerpc32/dl-machine.h @@ -1,5 +1,5 @@ /* Machine-dependent ELF dynamic relocation inline functions. PowerPC version. - Copyright (C) 1995-2002, 2003, 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 1995-2003, 2005, 2006, 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 @@ -135,7 +135,6 @@ __elf_preferred_address(struct link_map *loader, size_t maplength, /* We never want to use a PLT entry as the destination of a reloc, when what is being relocated is a branch. This is partly for efficiency, but mostly so we avoid loops. */ -#if !defined RTLD_BOOTSTRAP || USE___THREAD #define elf_machine_type_class(type) \ ((((type) == R_PPC_JMP_SLOT \ || (type) == R_PPC_REL24 \ @@ -143,13 +142,6 @@ __elf_preferred_address(struct link_map *loader, size_t maplength, && (type) <= R_PPC_DTPREL32) \ || (type) == R_PPC_ADDR24) * ELF_RTYPE_CLASS_PLT) \ | (((type) == R_PPC_COPY) * ELF_RTYPE_CLASS_COPY)) -#else -#define elf_machine_type_class(type) \ - ((((type) == R_PPC_JMP_SLOT \ - || (type) == R_PPC_REL24 \ - || (type) == R_PPC_ADDR24) * ELF_RTYPE_CLASS_PLT) \ - | (((type) == R_PPC_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_PPC_JMP_SLOT @@ -331,8 +323,7 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc, *reloc_addr = value; break; -#if (!defined RTLD_BOOTSTRAP || USE___THREAD) \ - && !defined RESOLVE_CONFLICT_FIND_MAP +#ifndef RESOLVE_CONFLICT_FIND_MAP # ifdef RTLD_BOOTSTRAP # define NOT_BOOTSTRAP 0 # else diff --git a/sysdeps/powerpc/powerpc64/dl-machine.h b/sysdeps/powerpc/powerpc64/dl-machine.h index 901a44e4b3..2defc44b19 100644 --- a/sysdeps/powerpc/powerpc64/dl-machine.h +++ b/sysdeps/powerpc/powerpc64/dl-machine.h @@ -1,6 +1,6 @@ /* Machine-dependent ELF dynamic relocation inline functions. PowerPC64 version. - Copyright 1995-2005, 2006, 2008, 2010 Free Software Foundation, Inc. + Copyright 1995-2005, 2006, 2008, 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 @@ -376,9 +376,9 @@ elf_machine_runtime_setup (struct link_map *map, int lazy, int profile) branch using two instructions; Past that point, glink uses three instructions. */ if (i < 0x8000) - glink_offset += 2; + glink_offset += 2; else - glink_offset += 3; + glink_offset += 3; } /* Now, we've modified data. We need to write the changes from @@ -492,10 +492,10 @@ elf_machine_plt_value (struct link_map *map, const Elf64_Rela *reloc, #define dont_expect(X) __builtin_expect ((X), 0) extern void _dl_reloc_overflow (struct link_map *map, - const char *name, - Elf64_Addr *const reloc_addr, - const Elf64_Sym *refsym) - attribute_hidden; + const char *name, + Elf64_Addr *const reloc_addr, + const Elf64_Sym *refsym) + attribute_hidden; auto inline void __attribute__ ((always_inline)) elf_machine_rela_relative (Elf64_Addr l_addr, const Elf64_Rela *reloc, @@ -505,7 +505,6 @@ elf_machine_rela_relative (Elf64_Addr l_addr, const Elf64_Rela *reloc, *reloc_addr = l_addr + reloc->r_addend; } -#if !defined RTLD_BOOTSTRAP || USE___THREAD /* This computes the value used by TPREL* relocs. */ auto inline Elf64_Addr __attribute__ ((always_inline, const)) elf_machine_tprel (struct link_map *map, @@ -513,18 +512,17 @@ elf_machine_tprel (struct link_map *map, const Elf64_Sym *sym, const Elf64_Rela *reloc) { -# ifndef RTLD_BOOTSTRAP +#ifndef RTLD_BOOTSTRAP if (sym_map) { CHECK_STATIC_TLS (map, sym_map); -# endif +#endif return TLS_TPREL_VALUE (sym_map, sym, reloc); -# ifndef RTLD_BOOTSTRAP +#ifndef RTLD_BOOTSTRAP } -# endif +#endif return 0; } -#endif /* Call function at address VALUE (an OPD entry) to resolve ifunc relocs. */ auto inline Elf64_Addr __attribute__ ((always_inline)) @@ -611,26 +609,25 @@ elf_machine_rela (struct link_map *map, #endif return; -#if !defined RTLD_BOOTSTRAP || USE___THREAD case R_PPC64_DTPMOD64: -# ifdef RTLD_BOOTSTRAP +#ifdef RTLD_BOOTSTRAP /* During startup the dynamic linker is always index 1. */ *reloc_addr = 1; -# else +#else /* Get the information from the link map returned by the resolve function. */ if (sym_map != NULL) - *reloc_addr = sym_map->l_tls_modid; -# endif + *reloc_addr = sym_map->l_tls_modid; +#endif return; case R_PPC64_DTPREL64: /* During relocation all TLS symbols are defined and used. - Therefore the offset is already correct. */ -# ifndef RTLD_BOOTSTRAP + Therefore the offset is already correct. */ +#ifndef RTLD_BOOTSTRAP if (sym_map != NULL) *reloc_addr = TLS_DTPREL_VALUE (sym, reloc); -# endif +#endif return; case R_PPC64_TPREL64: @@ -640,21 +637,21 @@ elf_machine_rela (struct link_map *map, case R_PPC64_TPREL16_LO_DS: value = elf_machine_tprel (map, sym_map, sym, reloc); if (dont_expect ((value & 3) != 0)) - _dl_reloc_overflow (map, "R_PPC64_TPREL16_LO_DS", reloc_addr, refsym); + _dl_reloc_overflow (map, "R_PPC64_TPREL16_LO_DS", reloc_addr, refsym); BIT_INSERT (*(Elf64_Half *) reloc_addr, value, 0xfffc); break; case R_PPC64_TPREL16_DS: value = elf_machine_tprel (map, sym_map, sym, reloc); if (dont_expect ((value + 0x8000) >= 0x10000 || (value & 3) != 0)) - _dl_reloc_overflow (map, "R_PPC64_TPREL16_DS", reloc_addr, refsym); + _dl_reloc_overflow (map, "R_PPC64_TPREL16_DS", reloc_addr, refsym); BIT_INSERT (*(Elf64_Half *) reloc_addr, value, 0xfffc); break; case R_PPC64_TPREL16: value = elf_machine_tprel (map, sym_map, sym, reloc); if (dont_expect ((value + 0x8000) >= 0x10000)) - _dl_reloc_overflow (map, "R_PPC64_TPREL16", reloc_addr, refsym); + _dl_reloc_overflow (map, "R_PPC64_TPREL16", reloc_addr, refsym); *(Elf64_Half *) reloc_addr = PPC_LO (value); break; @@ -692,12 +689,11 @@ elf_machine_rela (struct link_map *map, value = elf_machine_tprel (map, sym_map, sym, reloc); *(Elf64_Half *) reloc_addr = PPC_HIGHESTA (value); break; -#endif #ifndef RTLD_BOOTSTRAP /* None of the following appear in ld.so */ case R_PPC64_ADDR16_LO_DS: if (dont_expect ((value & 3) != 0)) - _dl_reloc_overflow (map, "R_PPC64_ADDR16_LO_DS", reloc_addr, refsym); + _dl_reloc_overflow (map, "R_PPC64_ADDR16_LO_DS", reloc_addr, refsym); BIT_INSERT (*(Elf64_Half *) reloc_addr, value, 0xfffc); break; @@ -715,29 +711,29 @@ elf_machine_rela (struct link_map *map, case R_PPC64_ADDR30: { - Elf64_Addr delta = value - (Elf64_Xword) reloc_addr; - if (dont_expect ((delta + 0x80000000) >= 0x10000000 + Elf64_Addr delta = value - (Elf64_Xword) reloc_addr; + if (dont_expect ((delta + 0x80000000) >= 0x10000000 || (delta & 3) != 0)) - _dl_reloc_overflow (map, "R_PPC64_ADDR30", reloc_addr, refsym); - BIT_INSERT (*(Elf64_Word *) reloc_addr, delta, 0xfffffffc); + _dl_reloc_overflow (map, "R_PPC64_ADDR30", reloc_addr, refsym); + BIT_INSERT (*(Elf64_Word *) reloc_addr, delta, 0xfffffffc); } break; case R_PPC64_COPY: if (dont_expect (sym == NULL)) /* This can happen in trace mode when an object could not be found. */ - return; + return; if (dont_expect (sym->st_size > refsym->st_size || (GLRO(dl_verbose) && sym->st_size < refsym->st_size))) { - const char *strtab; + const char *strtab; - strtab = (const void *) D_PTR (map, l_info[DT_STRTAB]); - _dl_error_printf ("%s: Symbol `%s' has different size" \ - " in shared object," \ - " consider re-linking\n", - _dl_argv[0] ?: "<program name unknown>", + strtab = (const void *) D_PTR (map, l_info[DT_STRTAB]); + _dl_error_printf ("%s: Symbol `%s' has different size" \ + " in shared object," \ + " consider re-linking\n", + _dl_argv[0] ?: "<program name unknown>", strtab + refsym->st_name); } memcpy (reloc_addr_arg, (char *) value, @@ -766,25 +762,25 @@ elf_machine_rela (struct link_map *map, case R_PPC64_ADDR32: if (dont_expect ((value + 0x80000000) >= 0x10000000)) - _dl_reloc_overflow (map, "R_PPC64_ADDR32", reloc_addr, refsym); + _dl_reloc_overflow (map, "R_PPC64_ADDR32", reloc_addr, refsym); *(Elf64_Word *) reloc_addr = value; return; case R_PPC64_ADDR24: if (dont_expect ((value + 0x2000000) >= 0x4000000 || (value & 3) != 0)) - _dl_reloc_overflow (map, "R_PPC64_ADDR24", reloc_addr, refsym); + _dl_reloc_overflow (map, "R_PPC64_ADDR24", reloc_addr, refsym); BIT_INSERT (*(Elf64_Word *) reloc_addr, value, 0x3fffffc); break; case R_PPC64_ADDR16: if (dont_expect ((value + 0x8000) >= 0x10000)) - _dl_reloc_overflow (map, "R_PPC64_ADDR16", reloc_addr, refsym); + _dl_reloc_overflow (map, "R_PPC64_ADDR16", reloc_addr, refsym); *(Elf64_Half *) reloc_addr = value; break; case R_PPC64_UADDR16: if (dont_expect ((value + 0x8000) >= 0x10000)) - _dl_reloc_overflow (map, "R_PPC64_UADDR16", reloc_addr, refsym); + _dl_reloc_overflow (map, "R_PPC64_UADDR16", reloc_addr, refsym); /* We are big-endian. */ ((char *) reloc_addr_arg)[0] = (value >> 8) & 0xff; ((char *) reloc_addr_arg)[1] = (value >> 0) & 0xff; @@ -792,7 +788,7 @@ elf_machine_rela (struct link_map *map, case R_PPC64_ADDR16_DS: if (dont_expect ((value + 0x8000) >= 0x10000 || (value & 3) != 0)) - _dl_reloc_overflow (map, "R_PPC64_ADDR16_DS", reloc_addr, refsym); + _dl_reloc_overflow (map, "R_PPC64_ADDR16_DS", reloc_addr, refsym); BIT_INSERT (*(Elf64_Half *) reloc_addr, value, 0xfffc); break; @@ -816,11 +812,11 @@ elf_machine_rela (struct link_map *map, case R_PPC64_ADDR14_BRTAKEN: case R_PPC64_ADDR14_BRNTAKEN: { - if (dont_expect ((value + 0x8000) >= 0x10000 || (value & 3) != 0)) + if (dont_expect ((value + 0x8000) >= 0x10000 || (value & 3) != 0)) _dl_reloc_overflow (map, "R_PPC64_ADDR14", reloc_addr, refsym); - Elf64_Word insn = *(Elf64_Word *) reloc_addr; - BIT_INSERT (insn, value, 0xfffc); - if (r_type != R_PPC64_ADDR14) + Elf64_Word insn = *(Elf64_Word *) reloc_addr; + BIT_INSERT (insn, value, 0xfffc); + if (r_type != R_PPC64_ADDR14) { insn &= ~(1 << 21); if (r_type == R_PPC64_ADDR14_BRTAKEN) @@ -830,7 +826,7 @@ elf_machine_rela (struct link_map *map, else if ((insn & (0x14 << 21)) == (0x10 << 21)) insn |= 0x08 << 21; } - *(Elf64_Word *) reloc_addr = insn; + *(Elf64_Word *) reloc_addr = insn; } break; |