From owner-freebsd-hackers@FreeBSD.ORG Thu Mar 25 02:42:15 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20573106564A; Thu, 25 Mar 2010 02:42:15 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from agogare.doit.wisc.edu (agogare.doit.wisc.edu [144.92.197.211]) by mx1.freebsd.org (Postfix) with ESMTP id E82F88FC14; Thu, 25 Mar 2010 02:42:14 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth2.wiscmail.wisc.edu by smtpauth2.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) id <0KZT00C02GUE3700@smtpauth2.wiscmail.wisc.edu>; Wed, 24 Mar 2010 21:42:14 -0500 (CDT) Received: from comporellon.tachypleus.net ([unknown] [76.210.69.218]) by smtpauth2.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0KZT00MC9GUCW640@smtpauth2.wiscmail.wisc.edu>; Wed, 24 Mar 2010 21:42:13 -0500 (CDT) Date: Wed, 24 Mar 2010 21:42:12 -0500 From: Nathan Whitehorn In-reply-to: <201003241642.00246.jhb@freebsd.org> To: John Baldwin Message-id: <4BAACD84.5040100@freebsd.org> X-Spam-Report: AuthenticatedSender=yes, SenderIP=76.210.69.218 X-Spam-PmxInfo: Server=avs-11, Version=5.5.5.374460, Antispam-Engine: 2.7.1.369594, Antispam-Data: 2010.3.25.23623, SenderIP=76.210.69.218 References: <4BAA6813.7060604@freebsd.org> <201003241642.00246.jhb@freebsd.org> User-Agent: Thunderbird 2.0.0.24 (X11/20100320) Cc: freebsd-hackers@freebsd.org Subject: Re: Review/testing request: changing the detection of data_addr/text_addr X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2010 02:42:15 -0000 John Baldwin wrote: > On Wednesday 24 March 2010 3:29:23 pm Nathan Whitehorn wrote: > >> We currently detect the offical "text" and "data" addresses for ELF >> files in kern/imgact_elf.c by the heuristic of calling whichever section >> contains the executable's entry point the text section and everything >> else data. In general, both this concept and the very few things that >> use them are obsolete and rare. The data addresses are, however, used in >> obreak() to find the current break. On powerpc64, this logic fails, >> because the entry point points to a function descriptor in the data >> section, causing sbrk() to fail, which in turn breaks profiling. >> >> The patch at http://people.freebsd.org/~nwhitehorn/textseg.diff changes >> this algorithm to make the official text area be the largest executable >> segment, and all others data. The patch has been tested on sparc64, >> amd64, powerpc, and (of course) powerpc64, with no evident bad effects. >> > > My only comment is that I would keep the existing language about obreak() as > it describes multiple data segments, etc. Instead, I would just use the first > sentence of your new comment to replace the first paragraph in the old > comment. > That's a good point. I've updated the patch with the new comment. Thanks for taking a look! If no one objects, I'll commit both of these patches tomorrow. -Nathan