From owner-freebsd-hackers@FreeBSD.ORG Wed Mar 24 21:13:09 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 2847D1065674; Wed, 24 Mar 2010 21:13:09 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id EFA818FC0A; Wed, 24 Mar 2010 21:13:08 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id A113F46B37; Wed, 24 Mar 2010 17:13:08 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id E67CC8A01F; Wed, 24 Mar 2010 17:13:07 -0400 (EDT) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Wed, 24 Mar 2010 16:42:00 -0400 User-Agent: KMail/1.12.1 (FreeBSD/7.3-CBSD-20100217; KDE/4.3.1; amd64; ; ) References: <4BAA6813.7060604@freebsd.org> In-Reply-To: <4BAA6813.7060604@freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201003241642.00246.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Wed, 24 Mar 2010 17:13:08 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.7 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: Nathan Whitehorn 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: Wed, 24 Mar 2010 21:13:09 -0000 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. -- John Baldwin