public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rsa at us dot ibm dot com" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sources.redhat.com
Subject: [Bug libc/214] sbrk() doesn't detect brk() failures. Malloc doesn't handle sbrk() failures
Date: Mon, 13 Mar 2006 16:24:00 -0000	[thread overview]
Message-ID: <20060313162425.11778.qmail@sourceware.org> (raw)
In-Reply-To: <20040610193839.214.dlstevens@us.ibm.com>


------- Additional Comments From rsa at us dot ibm dot com  2006-03-13 16:24 -------
Thanks to Alan Modra for the following explanation of how ld locates the data in
memory:

ld tries to optimize memory and disk usage for the executable.

Consider a small executable laid out like the following:

______________________
| text    |   data   |
~~~~~~~~~~~~~~~~~~~~~~
^               ^               ^
|- page boundaries

This will require two disk pages, and three memory pages,
one for text and two for data (demand paging requires that
vma and file offset are equal modulo page size, protection
requirements mean text and data must be on separate pages).


The same executable laid out like this:
____________________________
| text    | gap |   data   |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
^               ^               ^
|- page boundaries

still requires two disk pages, but now only two memory pages.
Sometimes adjusting the data start as above doesn't gain us
anything in memory and increases disk image, so ld doesn't
adjust.

See ld info DATA_SEGMENT_ALIGN.

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=214

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


  parent reply	other threads:[~2006-03-13 16:24 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-10 19:38 [Bug libc/214] New: " dlstevens at us dot ibm dot com
2004-06-18 17:35 ` [Bug libc/214] " dlstevens at us dot ibm dot com
2004-09-26 21:29 ` drepper at redhat dot com
2006-03-03 22:01 ` rsa at us dot ibm dot com
2006-03-06 21:37 ` rsa at us dot ibm dot com
2006-03-08 19:21 ` rsa at us dot ibm dot com
2006-03-10 20:33 ` rsa at us dot ibm dot com
2006-03-10 22:18 ` rsa at us dot ibm dot com
2006-03-13 16:24 ` rsa at us dot ibm dot com [this message]
2006-03-14 18:34 ` rsa at us dot ibm dot com
2006-03-14 19:59 ` dlstevens at us dot ibm dot com
2006-03-15 20:18 ` rsa at us dot ibm dot com
2006-03-15 21:21 ` dlstevens at us dot ibm dot com
2006-03-16  0:29 ` rsa at us dot ibm dot com
2006-03-20 19:59 ` rsa at us dot ibm dot com
2006-03-20 20:27 ` dlstevens at us dot ibm dot com
2006-03-21 23:56 ` dlstevens at us dot ibm dot com
2006-04-01 20:21 ` drepper at redhat dot com

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=20060313162425.11778.qmail@sourceware.org \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@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).