This is the mail archive of the libc-hacker@sources.redhat.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fix mapping of DSOs with holes


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  <schwab@suse.de>

	* 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	
@@ -1110,7 +1110,7 @@ cannot allocate TLS data structures for 
 	     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);
 

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, MaxfeldstraÃe 5, 90409 NÃrnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]