From owner-freebsd-current@FreeBSD.ORG Tue Mar 4 06:33:56 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7EA07106566B for ; Tue, 4 Mar 2008 06:33:56 +0000 (UTC) (envelope-from joseph.koshy@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.159]) by mx1.freebsd.org (Postfix) with ESMTP id 10ADD8FC1B for ; Tue, 4 Mar 2008 06:33:55 +0000 (UTC) (envelope-from joseph.koshy@gmail.com) Received: by fg-out-1718.google.com with SMTP id 16so523374fgg.35 for ; Mon, 03 Mar 2008 22:33:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=M7o0gkbNa/KsSiWyn+ArKB6mEcN02xIwpt+mOKq/yeM=; b=i19YkIt/nVDXQ83MXUEbfxlb63UCVaTcpOODK1fhnF7x6AyI9DW2yJK7ponkiJd/um5Nf7x5rfRoMCk43mm3Ho34zp06sme872G6CKsZubN63Y9oK3FcH2EcwZiXC8OMjUXHDOgA/3gH5rdh6cKBpDUFj+KfQD6IjF8Sj88yDvc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=geEEspBijQR7JgMCduHdXywKvjAlUSLiFoyHC4xeFUpIA0X5xLdVOZ8cOwv13p91a7PXBST5wbsadecqnT7jEan89v8Ecf3GykihtNfJxacij7vJgf/0QZjxvkZQO5d5hkk8ld0PJF4L7JrujvJ2xqpr5zuMm2olrTZ/0jSdoZQ= Received: by 10.86.59.2 with SMTP id h2mr780486fga.19.1204612434824; Mon, 03 Mar 2008 22:33:54 -0800 (PST) Received: by 10.86.70.10 with HTTP; Mon, 3 Mar 2008 22:33:53 -0800 (PST) Message-ID: <84dead720803032233m6881e888m6ff69c464a4a3d17@mail.gmail.com> Date: Tue, 4 Mar 2008 12:03:53 +0530 From: "Joseph Koshy" To: "Ed Schouten" In-Reply-To: <20080303200219.GF80576@hoeg.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20080303200219.GF80576@hoeg.nl> Cc: FreeBSD Current Subject: Re: Yet another BSD licensed replacement: size(1) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Mar 2008 06:33:56 -0000 Ed, > Today I found out we have a utility in FreeBSD that's 300 KB's in size > and is only used to display some fancy numbers, called size(1). (Yeah, > 300 KB - it is statically linked against libbfd.) > > I thought it would be possible to rewrite size(1) to use libelf. The > result: > > GNU size(1); > > | $ size /usr/bin/size > | text data bss dec hex filename > | 309202 1524 16964 327690 5000a size > > My size(1): > > | $ ./size size > | text data bss dec hex filename > | 5209 340 44 5593 15d9 size > > So far I've implemented all common features supported by the GNU > version, except one: when you use size -A (the `System V format'), it > doesn't calculate the relocated addresses yet. It now prints 0xdeadc0de, > but this has to be fixed. > > I haven't tested the utility on any 64-bit systems yet and I know it > will probably won't work there yet, but I'll look at these issues soon. > > When finished, it should be a drop-in replacement. The Berkeley format > is exactly the same as the original GNU version. The System V format > should be almost the same, except for some whitespace. How does yours compare with Sam Arun Raj's implementation of size(1) in Perforce? IIRC it was fairly complete. See: http://wiki.freebsd.org/ElfToolChain and: //depot/user/samarunraj/elftoolchain/src/usr.bin/size/ Regards, Koshy