From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14695 invoked by alias); 15 Apr 2003 15:02:39 -0000 Mailing-List: contact libc-hacker-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sources.redhat.com Received: (qmail 14678 invoked from network); 15 Apr 2003 15:02:39 -0000 Received: from unknown (HELO localhost.localdomain) (195.113.19.66) by sources.redhat.com with SMTP; 15 Apr 2003 15:02:39 -0000 Received: from sunsite.ms.mff.cuni.cz (sunsite.mff.cuni.cz [127.0.0.1]) by localhost.localdomain (8.12.8/8.12.8) with ESMTP id h3FF2aqO007194; Tue, 15 Apr 2003 17:02:36 +0200 Received: (from jakub@localhost) by sunsite.ms.mff.cuni.cz (8.12.8/8.12.8/Submit) id h3FF2ZjZ007192; Tue, 15 Apr 2003 17:02:35 +0200 Date: Tue, 15 Apr 2003 15:02:00 -0000 From: Jakub Jelinek To: Ulrich Drepper , Roland McGrath Cc: Glibc hackers Subject: [PATCH] Fix prelinking on ppc32 Message-ID: <20030415150235.GR16629@sunsite.ms.mff.cuni.cz> Reply-To: Jakub Jelinek Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i X-SW-Source: 2003-04/txt/msg00045.txt.bz2 Hi! When calling elf_machine_rela from dl-conflict.c, sym is NULL, so we certainly cannot do checks on what it points to. BTW: Shouldn't most of the TLS handling go into dl-machine.c on PPC32? I mean, unless there are -fno-pic shared libraries, linker certainly shouldn't keep any TLS relocs but R_PPC_DTPMOD32, R_PPC_DTPREL32 and R_PPC_TPREL32 around and thus the rest doesn't hurt if it is slower. 2003-04-15 Jakub Jelinek * sysdeps/powerpc/powerpc32/dl-machine.h (elf_machine_rela): Avoid checking R_PPC_RELATIVE, R_PPC_NONE and whether relocation is against local symbol in conflict processing. --- libc/sysdeps/powerpc/powerpc32/dl-machine.h.jj 2003-04-01 04:20:54.000000000 -0500 +++ libc/sysdeps/powerpc/powerpc32/dl-machine.h 2003-04-15 09:08:04.000000000 -0400 @@ -365,6 +365,7 @@ elf_machine_rela (struct link_map *map, struct link_map *sym_map; #endif +#ifndef RESOLVE_CONFLICT_FIND_MAP if (r_type == R_PPC_RELATIVE) { *reloc_addr = map->l_addr + reloc->r_addend; @@ -381,18 +382,21 @@ elf_machine_rela (struct link_map *map, value = map->l_addr; else { -#if defined USE_TLS && !defined RTLD_BOOTSTRAP +# if defined USE_TLS && !defined RTLD_BOOTSTRAP sym_map = RESOLVE_MAP (&sym, version, r_type); value = sym == NULL ? 0 : sym_map->l_addr + sym->st_value; -#else +# else value = RESOLVE (&sym, version, r_type); -# ifndef RTLD_BOOTSTRAP +# ifndef RTLD_BOOTSTRAP if (sym != NULL) -# endif +# endif value += sym->st_value; -#endif +# endif } value += reloc->r_addend; +#else + value = reloc->r_addend; +#endif /* A small amount of code is duplicated here for speed. In libc, more than 90% of the relocs are R_PPC_RELATIVE; in the X11 shared Jakub