diff options
author | 2002-11-17 12:15:17 +0000 | |
---|---|---|
committer | 2002-11-17 12:15:17 +0000 | |
commit | b7e4d0cf5343c6262f0fe9270f55d41f32bf648b (patch) | |
tree | e1316098501d74d26386aec5bd17cd31dd86236c /sys-libs | |
parent | added ppc keyword to 0.9.6-r2 (diff) | |
download | historical-b7e4d0cf5343c6262f0fe9270f55d41f32bf648b.tar.gz historical-b7e4d0cf5343c6262f0fe9270f55d41f32bf648b.tar.bz2 historical-b7e4d0cf5343c6262f0fe9270f55d41f32bf648b.zip |
small glibc fix re: prelinking
Diffstat (limited to 'sys-libs')
-rw-r--r-- | sys-libs/glibc/ChangeLog | 7 | ||||
-rw-r--r-- | sys-libs/glibc/files/2.3.1/glibc-2.3.1-prelinkfix.patch | 176 | ||||
-rw-r--r-- | sys-libs/glibc/glibc-2.3.1-r2.ebuild | 7 |
3 files changed, 188 insertions, 2 deletions
diff --git a/sys-libs/glibc/ChangeLog b/sys-libs/glibc/ChangeLog index 4251d83d0a8c..9317cc61d83c 100644 --- a/sys-libs/glibc/ChangeLog +++ b/sys-libs/glibc/ChangeLog @@ -1,9 +1,14 @@ # ChangeLog for sys-libs/glibc # Copyright 2002 Gentoo Technologies, Inc.; Distributed under the GPL -# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/ChangeLog,v 1.29 2002/11/16 18:28:29 azarah Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/ChangeLog,v 1.30 2002/11/17 12:15:17 cretin Exp $ *glibc-2.3.1-r2 (7 Nov 2002) + 17 Nov 2002; Stefan Jones <cretin@gentoo.org> glibc-2.3.1-r2.ebuild : + + Small patch "prelinkfix" which fixes rare error with prelinking and + preloading some executables. Patch taken from glibc CVS. + 16 Nov 2002; Martin Schlemmer <azarah@gentoo.org> glibc-2.3.1-r2.ebuild : Fix type-o that caused manpages not installing (bug #10645). diff --git a/sys-libs/glibc/files/2.3.1/glibc-2.3.1-prelinkfix.patch b/sys-libs/glibc/files/2.3.1/glibc-2.3.1-prelinkfix.patch new file mode 100644 index 000000000000..db829b16730e --- /dev/null +++ b/sys-libs/glibc/files/2.3.1/glibc-2.3.1-prelinkfix.patch @@ -0,0 +1,176 @@ +--- glibc-2.3.1/sysdeps/i386/dl-machine.h 2002-09-18 02:28:40.000000000 +0100 ++++ libc/sysdeps/i386/dl-machine.h 2002-11-15 22:51:19.000000000 +0000 +@@ -201,7 +201,7 @@ + .previous\n\ + "); + # else +-# define ELF_MACHINE_RUNTIME_TRAMPOLINE asm ("\n\ ++# define ELF_MACHINE_RUNTIME_TRAMPOLINE asm ("\n\ + .text\n\ + .globl _dl_runtime_resolve\n\ + .globl _dl_runtime_profile\n\ +@@ -299,7 +299,7 @@ + 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. */ +-#ifdef USE_TLS ++#if defined USE_TLS && (!defined RTLD_BOOTSTRAP || USE___THREAD) + # define elf_machine_type_class(type) \ + ((((type) == R_386_JMP_SLOT || (type) == R_386_TLS_DTPMOD32 \ + || (type) == R_386_TLS_DTPOFF32 || (type) == R_386_TLS_TPOFF32 \ +@@ -389,7 +389,7 @@ + return; + # endif + else +-#endif ++#endif /* !RTLD_BOOTSTRAP and have no -z combreloc */ + { + const Elf32_Sym *const refsym = sym; + #if defined USE_TLS && !defined RTLD_BOOTSTRAP +@@ -402,7 +402,7 @@ + if (sym != NULL) + # endif + value += sym->st_value; +-#endif ++#endif /* use TLS and !RTLD_BOOTSTRAP */ + + switch (r_type) + { +@@ -411,7 +411,7 @@ + *reloc_addr = value; + break; + +-#ifdef USE_TLS ++#if defined USE_TLS && (!defined RTLD_BOOTSTRAP || USE___THREAD) + case R_386_TLS_DTPMOD32: + # ifdef RTLD_BOOTSTRAP + /* During startup the dynamic linker is always the module +@@ -444,7 +444,10 @@ + thread pointer. To get the variable position in the TLS + block we subtract the offset from that of the TLS block. */ + if (sym != NULL) +- *reloc_addr += sym_map->l_tls_offset - sym->st_value; ++ { ++ *reloc_addr += sym_map->l_tls_offset - sym->st_value; ++ CHECK_STATIC_TLS (map, sym_map); ++ } + # endif + break; + case R_386_TLS_TPOFF: +@@ -456,7 +459,10 @@ + It is a negative value which will be added to the + thread pointer. */ + if (sym != NULL) +- *reloc_addr += sym->st_value - sym_map->l_tls_offset; ++ { ++ *reloc_addr += sym->st_value - sym_map->l_tls_offset; ++ CHECK_STATIC_TLS (map, sym_map); ++ } + # endif + break; + #endif /* use TLS */ +@@ -491,7 +497,7 @@ + default: + _dl_reloc_bad_type (map, r_type, 0); + break; +-#endif ++#endif /* !RTLD_BOOTSTRAP */ + } + } + } +@@ -508,6 +514,9 @@ + *reloc_addr = map->l_addr + reloc->r_addend; + else if (r_type != R_386_NONE) + { ++# ifndef RESOLVE_CONFLICT_FIND_MAP ++ const Elf32_Sym *const refsym = sym; ++# endif + # ifdef USE_TLS + struct link_map *sym_map = RESOLVE_MAP (&sym, version, r_type); + Elf32_Addr value = sym == NULL ? 0 : sym_map->l_addr + sym->st_value; +@@ -515,7 +524,7 @@ + Elf32_Addr value = RESOLVE (&sym, version, ELF32_R_TYPE (reloc->r_info)); + if (sym != NULL) + value += sym->st_value; +-#endif ++# endif + + switch (ELF32_R_TYPE (reloc->r_info)) + { +@@ -528,7 +537,7 @@ + *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. */ +@@ -549,6 +558,7 @@ + *reloc_addr + = (sym == NULL ? 0 : sym_map->l_tls_offset - sym->st_value) + + reloc->r_addend; ++ CHECK_STATIC_TLS (map, sym_map); + break; + case R_386_TLS_TPOFF: + /* The offset is negative, forward from the thread pointer. */ +@@ -558,8 +568,32 @@ + *reloc_addr + = (sym == NULL ? 0 : sym->st_value - sym_map->l_tls_offset) + + reloc->r_addend; ++ CHECK_STATIC_TLS (map, sym_map); + break; +-#endif /* use TLS */ ++# endif /* use TLS */ ++# ifndef RESOLVE_CONFLICT_FIND_MAP ++ /* Not needed for dl-conflict.c. */ ++ case R_386_COPY: ++ if (sym == NULL) ++ /* This can happen in trace mode if an object could not be ++ found. */ ++ break; ++ if (__builtin_expect (sym->st_size > refsym->st_size, 0) ++ || (__builtin_expect (sym->st_size < refsym->st_size, 0) ++ && GL(dl_verbose))) ++ { ++ const char *strtab; ++ ++ strtab = (const char *) D_PTR (map, l_info[DT_STRTAB]); ++ _dl_error_printf ("\ ++%s: Symbol `%s' has different size in shared object, consider re-linking\n", ++ rtld_progname ?: "<program name unknown>", ++ strtab + refsym->st_name); ++ } ++ memcpy (reloc_addr, (void *) value, MIN (sym->st_size, ++ refsym->st_size)); ++ break; ++# endif /* !RESOLVE_CONFLICT_FIND_MAP */ + default: + /* We add these checks in the version to relocate ld.so only + if we are still debugging. */ +@@ -568,7 +602,7 @@ + } + } + } +-#endif ++#endif /* !RTLD_BOOTSTRAP */ + + static inline void + elf_machine_rel_relative (Elf32_Addr l_addr, const Elf32_Rel *reloc, +@@ -585,7 +619,7 @@ + { + *reloc_addr = l_addr + reloc->r_addend; + } +-#endif ++#endif /* !RTLD_BOOTSTRAP */ + + static inline void + elf_machine_lazy_rel (struct link_map *map, +@@ -614,6 +648,6 @@ + { + } + +-#endif ++#endif /* !RTLD_BOOTSTRAP */ + + #endif /* RESOLVE */ diff --git a/sys-libs/glibc/glibc-2.3.1-r2.ebuild b/sys-libs/glibc/glibc-2.3.1-r2.ebuild index d5c39c5e829e..58d8d2ec409d 100644 --- a/sys-libs/glibc/glibc-2.3.1-r2.ebuild +++ b/sys-libs/glibc/glibc-2.3.1-r2.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2002 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/glibc-2.3.1-r2.ebuild,v 1.4 2002/11/16 18:28:29 azarah Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/glibc-2.3.1-r2.ebuild,v 1.5 2002/11/17 12:15:17 cretin Exp $ IUSE="nls pic build" @@ -107,6 +107,11 @@ src_unpack() { # # <azarah@gentoo.org> (7 Nov 2002). cd ${S}; epatch ${FILESDIR}/${PV}/${P}-stack_end-compat.patch + + # This one fixes a corner case with prelinking and preloading + # This is a diff from the glibc CVS + # <cretin@gentoo.org> (17 Nov 2002). + cd ${S}; epatch ${FILESDIR}/${PV}/${P}-prelinkfix.patch } src_compile() { |