From: Andreas Schwab <schwab@suse.de>
To: libc-hacker@sources.redhat.com
Subject: Fix mapping of DSOs with holes
Date: Tue, 18 May 2004 19:33:00 -0000 [thread overview]
Message-ID: <m3y8nqeffl.fsf@whitebox.m5r.de> (raw)
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."
next reply other threads:[~2004-05-18 0:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-18 19:33 Andreas Schwab [this message]
2004-07-06 23:00 ` Roland McGrath
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m3y8nqeffl.fsf@whitebox.m5r.de \
--to=schwab@suse.de \
--cc=libc-hacker@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).