From owner-freebsd-hackers@FreeBSD.ORG Thu Dec 6 02:39:59 2012 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 96296D88 for ; Thu, 6 Dec 2012 02:39:59 +0000 (UTC) (envelope-from pete.chou@gmail.com) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 077D78FC0C for ; Thu, 6 Dec 2012 02:39:58 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id j13so6149242lah.13 for ; Wed, 05 Dec 2012 18:39:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=GE1Yfm5bl5y+GKXVijFItiEiY+3DCx8P+xsaw0VwR7o=; b=utIGt4m4h7isgpi64Us/RGEZG6TeY+XpXYtA9FkTI72CFlrhcHdoMoJTsqpgjso2QS fZnssjuOwIbCi2x0cvanBudNwzpuF2L0Ys4Ni/Zm1C9fAoOo9bMQahvRvKmU0mAeeaSE MY4ta8I7UTzCpk2zrecszFntr+vwy90cWS+w/dzi3kIfksbCTrLAZKp/QD7ziIHoDS4V dvVrbxnY1d9Bi9UkkhjmcCMDWZAhSWmyfSFzXST77798xCa31zr9cHilhQB1wC9Gn1/2 f3e/LeXLsjt7u7Q70+6PJjjfF20bBWk/m6ZTHPukO6/C/+1KMUdBK9IKWerRNmo3/m5V yozA== Received: by 10.112.44.161 with SMTP id f1mr241708lbm.29.1354761597503; Wed, 05 Dec 2012 18:39:57 -0800 (PST) MIME-Version: 1.0 Sender: pete.chou@gmail.com Received: by 10.114.69.131 with HTTP; Wed, 5 Dec 2012 18:39:27 -0800 (PST) In-Reply-To: <20121204191140.GA56790@pix.net> References: <779286D2-F710-45FF-8C38-59513B5C1B7D@cederstrand.dk> <20121204191140.GA56790@pix.net> From: pete Date: Thu, 6 Dec 2012 10:39:27 +0800 X-Google-Sender-Auth: CXaIDgx_S-gvsWWyLmjNdbp52Yg Message-ID: Subject: Re: [CFT/RFC] Make crunched compatible with external linkers To: Kurt Lidl X-Mailman-Approved-At: Thu, 06 Dec 2012 03:18:21 +0000 Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: FreeBSD Hackers , Erik Cederstrand X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Dec 2012 02:39:59 -0000 On Wed, Dec 5, 2012 at 3:11 AM, Kurt Lidl wrote: > On Tue, Dec 04, 2012 at 11:06:56AM +0100, Erik Cederstrand wrote: > > Hello hackers, > > > > The following PR patches crunchide(1) to accept object files produced by > the gold and mclinker linkers: > http://www.freebsd.org/cgi/query-pr.cgi?pr=bin%2F174011 > > > > On behalf of the submitter, I'd like to request a review of the patch, > and testing of crunchide/crunchgen especially on SPARC and ARM. > > I applied this patch to a 9/stable source tree, and was able to > "buildworld" with it in place, on my sparc64 machine. > > I know that's not a great test case, but the patched binary > is good enough to generate the objects that are needed for the > 'rescue' binary. And that binary runs at least a trivial test > of '/usr/obj/usr/src/rescue/rescue/rescue ifconfig -a' and > produces correct output. > > -Kurt > Really thanks for your help! This patch is for crunchide to handle ELF object file in a more general way, but not be limited to the custom section layout (i.e., section headers, .symtab, and then .strtab are @EOF). And if we are still using ld(1), I think the patched crunchide should produce exactly the same output as before. Then the rescue binary would also be the same. I checked and verified the intermediate object files and rescue binary (via binary diff) on X86 FreeBSD 9.0. If you can also kindly help check this on different archs and feedback, I think the result will be very helpful. Thanks, Pete