diff options
author | Ulrich Drepper <drepper@redhat.com> | 2001-08-26 09:17:23 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2001-08-26 09:17:23 +0000 |
commit | a711b01d34ca5de9857ca5d19235812674fccee6 (patch) | |
tree | 1073e9cf9b096ff80eee7263a6b885cc161f2e43 /sysdeps/i386 | |
parent | 7c69dc8bc888762333f5ccf1c8c7fb5883ffc6ed (diff) | |
download | glibc-a711b01d34ca5de9857ca5d19235812674fccee6.tar.gz glibc-a711b01d34ca5de9857ca5d19235812674fccee6.tar.xz glibc-a711b01d34ca5de9857ca5d19235812674fccee6.zip |
Update.
2001-08-26 Ulrich Drepper <drepper@redhat.com> * config.h.in: Add HAVE_Z_COMBRELOC. * configure.in: Add test for -z combreloc. * sysdeps/i386/dl-machine.h (elf_machine_rel): Minor cleanups and optimizations. Use HAVE_Z_COMBRELOC to avoid generaton of R_386_RELATIVE handling for ld.so startup.
Diffstat (limited to 'sysdeps/i386')
-rw-r--r-- | sysdeps/i386/dl-machine.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/sysdeps/i386/dl-machine.h b/sysdeps/i386/dl-machine.h index 6b6c91eb57..53d802203a 100644 --- a/sysdeps/i386/dl-machine.h +++ b/sysdeps/i386/dl-machine.h @@ -305,9 +305,10 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc, { const unsigned int r_type = ELF32_R_TYPE (reloc->r_info); +#if !defined RTLD_BOOTSTRAP || !defined HAVE_Z_COMBRELOC if (__builtin_expect (r_type == R_386_RELATIVE, 0)) { -#ifndef RTLD_BOOTSTRAP +# ifndef RTLD_BOOTSTRAP /* This is defined in rtld.c, but nowhere in the static libc.a; make the reference weak so static programs can still link. This declaration cannot be done when compiling rtld.c @@ -316,14 +317,15 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc, weak decl in the same file. */ weak_extern (_dl_rtld_map); if (map != &_dl_rtld_map) /* Already done in rtld itself. */ -#endif +# endif *reloc_addr += map->l_addr; } -#ifndef RTLD_BOOTSTRAP +# ifndef RTLD_BOOTSTRAP else if (__builtin_expect (r_type == R_386_NONE, 0)) return; -#endif +# endif else +#endif { #ifndef RTLD_BOOTSTRAP const Elf32_Sym *const refsym = sym; @@ -352,7 +354,7 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc, break; if (__builtin_expect (sym->st_size > refsym->st_size, 0) || (__builtin_expect (sym->st_size < refsym->st_size, 0) - && __builtin_expect (_dl_verbose, 0))) + && _dl_verbose)) { const char *strtab; @@ -365,8 +367,6 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc, memcpy (reloc_addr, (void *) value, MIN (sym->st_size, refsym->st_size)); break; -#endif -#if !defined RTLD_BOOTSTRAP || defined _NDEBUG default: /* We add these checks in the version to relocate ld.so only if we are still debugging. */ @@ -381,6 +381,7 @@ static inline void elf_machine_rel_relative (Elf32_Addr l_addr, const Elf32_Rel *reloc, Elf32_Addr *const reloc_addr) { + assert (ELF32_R_TYPE (reloc->r_info) == R_386_RELATIVE); *reloc_addr += l_addr; } |