public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* Fix mapping of DSOs with holes
@ 2004-05-18 19:33 Andreas Schwab
  2004-07-06 23:00 ` Roland McGrath
  0 siblings, 1 reply; 2+ messages in thread
From: Andreas Schwab @ 2004-05-18 19:33 UTC (permalink / raw)
  To: libc-hacker

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."

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Fix mapping of DSOs with holes
  2004-05-18 19:33 Fix mapping of DSOs with holes Andreas Schwab
@ 2004-07-06 23:00 ` Roland McGrath
  0 siblings, 0 replies; 2+ messages in thread
From: Roland McGrath @ 2004-07-06 23:00 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: libc-hacker

> 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.

I've put this in now.


Thanks,
Roland

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-07-06 23:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-18 19:33 Fix mapping of DSOs with holes Andreas Schwab
2004-07-06 23:00 ` Roland McGrath

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).