From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19515 invoked by alias); 18 May 2004 00:40:04 -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 19498 invoked from network); 18 May 2004 00:40:03 -0000 Received: from unknown (HELO lisa.goe.net) (134.76.166.209) by sourceware.org with SMTP; 18 May 2004 00:40:03 -0000 Received: from mutter.goe.net (mutter-lisa0.a11.private [192.168.31.26]) by lisa.goe.net (8.12.10/8.12.10) with ESMTP id i4I0e0c4005181 for ; Tue, 18 May 2004 02:40:01 +0200 Received: from whitebox.a11.private ([192.168.31.90] helo=whitebox.home) by mutter.goe.net with esmtp (Exim 4.22) id 1BPseG-0002Dc-I6 for libc-hacker@sources.redhat.com; Tue, 18 May 2004 02:40:00 +0200 Received: by whitebox.home (Postfix, from userid 500) id 61E7880B69; Tue, 18 May 2004 02:39:58 +0200 (CEST) To: libc-hacker@sources.redhat.com Subject: Fix mapping of DSOs with holes From: Andreas Schwab X-Yow: FISH-NET-FISH-NET-FISH-NET-FISH-NET-FISH!! Date: Tue, 18 May 2004 19:33:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-SW-Source: 2004-05/txt/msg00034.txt.bz2 This reverts parts of the changes of 2004-03-26 in dl-load.c. The mprotect call would otherwise try to change the mapping at address 0 because l_text_end hasn't been set yet. And even if it would have been it is the wrong address anyway because we want the end address of the first segment, not the highest address of any executable segment (which on ppc includes the data segment because the PLT is located in the bss segment). Andreas. 2004-05-18 Andreas Schwab * elf/dl-load.c (_dl_map_object_from_fd): Use the end address of the first segment for mprotect, not l_text_end. --- elf/dl-load.c 08 May 2004 20:27:56 +0200 1.241 +++ elf/dl-load.c 18 May 2004 01:48:53 +0200=09 @@ -1110,7 +1110,7 @@ cannot allocate TLS data structures for=20 unallocated. Then jump into the normal segment-mapping loop to handle the portion of the segment past the end of the file mapping. */ - __mprotect ((caddr_t) l->l_text_end, + __mprotect ((caddr_t) (l->l_addr + c->mapend), loadcmds[nloadcmds - 1].allocend - c->mapend, PROT_NONE); =20 --=20 Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux AG, Maxfeldstra=C3=9Fe 5, 90409 N=C3=BCrnberg, Germany Key fingerprint =3D 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."