Yet another BSD licensed replacement: size(1)

From: Ed Schouten <ed_at_80386.nl>
Date: Mon, 3 Mar 2008 21:02:19 +0100
Hello,

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.

I've attached the code to this message.

-- 
 Ed Schouten <ed_at_fxq.nl>
 WWW: http://g-rave.nl/

Received on Mon Mar 03 2008 - 19:02:20 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:28 UTC