* elf/dl-reloc.c (allocate_static_tls): Rename to...

(_dl_allocate_static_tls): ... this function.  No longer static.
	(CHECK_STATIC_TLS): Adjust.
	* sysdeps/generic/ldsodefs.h (_dl_allocate_static_tls): New prototype.
	* sysdeps/powerpc/powerpc32/dl-machine.h (__process_machine_rela):
	Add SYM_MAP argument.
	(elf_machine_rela): Adjust caller.  Declare SYM_MAP unconditionally.
	Check if SYM_MAP != NULL for R_PPC_DTPREL32.  Only handle 32-bit
	TLS relocs here.  #ifdef out relocs which never appear in
	.gnu.conflict section from dl-conflict.c processing.
	* sysdeps/powerpc/powerpc32/dl-machine.c (__process_machine_rela):
	Add SYM_MAP argument.  Handle 16-bit TLS relocs here.

	* sysdeps/s390/s390-32/dl-machine.h (elf_machine_rela): #ifdef
	out relocs which never appear in .gnu.conflict section from
	dl-conflict.c processing.
	* sysdeps/s390/s390-64/dl-machine.h (elf_machine_rela): Likewise.
	* sysdeps/x86_64/dl-machine.h (elf_machine_rela): Likewise.
	* sysdeps/i386/dl-machine.h (elf_machine_rela): Likewise.
	Use r_type in RESOLVE macro.
This commit is contained in:
Roland McGrath 2003-04-24 17:11:08 +00:00
parent 545dbc9345
commit 8e27f45e05
5 changed files with 46 additions and 8 deletions

View File

@ -1,3 +1,26 @@
2003-04-24 Jakub Jelinek <jakub@redhat.com>
* elf/dl-reloc.c (allocate_static_tls): Rename to...
(_dl_allocate_static_tls): ... this function. No longer static.
(CHECK_STATIC_TLS): Adjust.
* sysdeps/generic/ldsodefs.h (_dl_allocate_static_tls): New prototype.
* sysdeps/powerpc/powerpc32/dl-machine.h (__process_machine_rela):
Add SYM_MAP argument.
(elf_machine_rela): Adjust caller. Declare SYM_MAP unconditionally.
Check if SYM_MAP != NULL for R_PPC_DTPREL32. Only handle 32-bit
TLS relocs here. #ifdef out relocs which never appear in
.gnu.conflict section from dl-conflict.c processing.
* sysdeps/powerpc/powerpc32/dl-machine.c (__process_machine_rela):
Add SYM_MAP argument. Handle 16-bit TLS relocs here.
* sysdeps/s390/s390-32/dl-machine.h (elf_machine_rela): #ifdef
out relocs which never appear in .gnu.conflict section from
dl-conflict.c processing.
* sysdeps/s390/s390-64/dl-machine.h (elf_machine_rela): Likewise.
* sysdeps/x86_64/dl-machine.h (elf_machine_rela): Likewise.
* sysdeps/i386/dl-machine.h (elf_machine_rela): Likewise.
Use r_type in RESOLVE macro.
2003-04-23 Ulrich Drepper <drepper@redhat.com>
* nis/ypclnt.c (__yp_bind): Expect ypdb parameter to always we !=

View File

@ -521,7 +521,7 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
struct link_map *sym_map = RESOLVE_MAP (&sym, version, r_type);
Elf32_Addr value = sym == NULL ? 0 : sym_map->l_addr + sym->st_value;
# else
Elf32_Addr value = RESOLVE (&sym, version, ELF32_R_TYPE (reloc->r_info));
Elf32_Addr value = RESOLVE (&sym, version, r_type);
if (sym != NULL)
value += sym->st_value;
# endif
@ -533,11 +533,13 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
case R_386_32:
*reloc_addr = value + reloc->r_addend;
break;
# ifndef RESOLVE_CONFLICT_FIND_MAP
/* Not needed for dl-conflict.c. */
case R_386_PC32:
*reloc_addr = (value + reloc->r_addend - (Elf32_Addr) reloc_addr);
break;
# ifdef USE_TLS
# ifdef USE_TLS
case R_386_TLS_DTPMOD32:
/* Get the information from the link map returned by the
resolv function. */
@ -570,9 +572,7 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
= (sym == NULL ? 0 : sym->st_value - sym_map->l_tls_offset)
+ reloc->r_addend;
break;
# endif /* use TLS */
# ifndef RESOLVE_CONFLICT_FIND_MAP
/* Not needed for dl-conflict.c. */
# endif /* use TLS */
case R_386_COPY:
if (sym == NULL)
/* This can happen in trace mode if an object could not be

View File

@ -424,7 +424,8 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
*reloc_addr = value + reloc->r_addend;
break;
#if defined USE_TLS && (!defined RTLD_BOOTSTRAP || USE___THREAD)
#if defined USE_TLS && (!defined RTLD_BOOTSTRAP || USE___THREAD) \
&& !defined RESOLVE_CONFLICT_FIND_MAP
case R_390_TLS_DTPMOD:
# ifdef RTLD_BOOTSTRAP
/* During startup the dynamic linker is always the module
@ -466,6 +467,8 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
#endif /* use TLS */
#ifndef RTLD_BOOTSTRAP
# ifndef RESOLVE_CONFLICT_FIND_MAP
/* Not needed in dl-conflict.c. */
case R_390_COPY:
if (sym == NULL)
/* This can happen in trace mode if an object could not be
@ -486,6 +489,7 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
memcpy (reloc_addr, (void *) value, MIN (sym->st_size,
refsym->st_size));
break;
# endif
case R_390_32:
*reloc_addr = value + reloc->r_addend;
break;
@ -495,6 +499,7 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
case R_390_8:
*(char *) reloc_addr = value + reloc->r_addend;
break;
# ifndef RESOLVE_CONFLICT_FIND_MAP
case R_390_PC32:
*reloc_addr = value + reloc->r_addend - (Elf32_Addr) reloc_addr;
break;
@ -509,6 +514,7 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
break;
case R_390_NONE:
break;
# endif
#endif
#if !defined(RTLD_BOOTSTRAP) || defined(_NDEBUG)
default:

View File

@ -392,7 +392,8 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
*reloc_addr = value + reloc->r_addend;
break;
#if defined USE_TLS && (!defined RTLD_BOOTSTRAP || USE___THREAD)
#if defined USE_TLS && (!defined RTLD_BOOTSTRAP || USE___THREAD) \
&& !defined RESOLVE_CONFLICT_FIND_MAP
case R_390_TLS_DTPMOD:
# ifdef RTLD_BOOTSTRAP
/* During startup the dynamic linker is always the module
@ -434,6 +435,8 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
#endif /* use TLS */
#ifndef RTLD_BOOTSTRAP
# ifndef RESOLVE_CONFLICT_FIND_MAP
/* Not needed for dl-conflict.c. */
case R_390_COPY:
if (sym == NULL)
/* This can happen in trace mode if an object could not be
@ -454,6 +457,7 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
memcpy (reloc_addr, (void *) value, MIN (sym->st_size,
refsym->st_size));
break;
# endif
case R_390_64:
*reloc_addr = value + reloc->r_addend;
break;
@ -466,6 +470,7 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
case R_390_8:
*(char *) reloc_addr = value + reloc->r_addend;
break;
# ifndef RESOLVE_CONFLICT_FIND_MAP
case R_390_PC64:
*reloc_addr = value +reloc->r_addend - (Elf64_Addr) reloc_addr;
break;
@ -489,6 +494,7 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
break;
case R_390_NONE:
break;
# endif
#endif
#if !defined(RTLD_BOOTSTRAP) || defined(_NDEBUG)
default:

View File

@ -400,7 +400,7 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
*reloc_addr = value + reloc->r_addend;
break;
#ifdef USE_TLS
#if defined USE_TLS && !defined RESOLVE_CONFLICT_FIND_MAP
case R_X86_64_DTPMOD64:
# ifdef RTLD_BOOTSTRAP
/* During startup the dynamic linker is always the module
@ -459,6 +459,8 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
strtab + refsym->st_name);
}
break;
# ifndef RESOLVE_CONFLICT_FIND_MAP
/* Not needed for dl-conflict.c. */
case R_X86_64_PC32:
*(unsigned int *) reloc_addr = value + reloc->r_addend
- (Elf64_Addr) reloc_addr;
@ -495,6 +497,7 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
memcpy (reloc_addr, (void *) value, MIN (sym->st_size,
refsym->st_size));
break;
# endif
default:
_dl_reloc_bad_type (map, r_type, 0);
break;