From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11789 invoked by alias); 13 Mar 2006 16:24:27 -0000 Received: (qmail 11779 invoked by uid 48); 13 Mar 2006 16:24:25 -0000 Date: Mon, 13 Mar 2006 16:24:00 -0000 Message-ID: <20060313162425.11778.qmail@sourceware.org> From: "rsa at us dot ibm dot com" To: glibc-bugs@sources.redhat.com In-Reply-To: <20040610193839.214.dlstevens@us.ibm.com> References: <20040610193839.214.dlstevens@us.ibm.com> Reply-To: sourceware-bugzilla@sourceware.org Subject: [Bug libc/214] sbrk() doesn't detect brk() failures. Malloc doesn't handle sbrk() failures X-Bugzilla-Reason: CC Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org X-SW-Source: 2006-03/txt/msg00065.txt.bz2 List-Id: ------- 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.