Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 Sep 2007 03:18:03 +0300
From:      Giorgos Keramidas <keramida@freebsd.org>
To:        Tim Kientzle <kientzle@freebsd.org>
Cc:        Yar Tikhiy <yar@comp.chem.msu.su>, hackers@freebsd.org
Subject:   Re: Useful tools missing from /rescue
Message-ID:  <20070903001803.GA8098@kobe.laptop>
In-Reply-To: <46DAFE5C.6070806@freebsd.org>
References:  <20070901073440.GL85633@comp.chem.msu.su> <46DAFE5C.6070806@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2007-09-02 11:18, Tim Kientzle <kientzle@freebsd.org> wrote:
> Yar Tikhiy wrote:
>> In addition, there are chflags and chmod in /rescue, but there's no
>> chown in it, so the toolset is a bit incomplete.
>
> Oh, my.  chown was definitely an oversight.  That
> should have been in there.

Probably because chown is a relatively big binary.  If build as a static
binary here, it ends up being:

$ pwd
/home/keramida/bsd/src/usr.sbin/chown
$ make DEBUG_FLAGS='' NO_SHARED=yes all
[...]
$ ls -ld chown
-rwxrwxr-x    1 keramida  users  - 2297013 Sep  3 03:06 chown
$ strip -s chown
$ ls -ld chown
-rwxrwxr-x    1 keramida  users  - 550624 Sep  3 03:06 chown
$

This will get smaller when crunched, but it's still almost 4x the size
of chmod:

$ pwd
/home/keramida/bsd/src/bin/chmod
$ make DEBUG_FLAGS='' NO_SHARED=yes all
[...]
$ ls -ld chmod
-rwxrwxr-x  1 keramida  users  - 662678 Sep  3 03:08 chmod
$ strip -s chmod
$ ls -ld chmod
-rwxrwxr-x  1 keramida  users  - 165884 Sep  3 03:08 chmod
$

Running nm(1) on the binaries, I see that they have the same symbols
though:

$ nm -S chmod | awk '{print $2,$3,$4}' | sort > /tmp/symbols.chmod
$ nm -S chown | awk '{print $2,$3,$4}' | sort > /tmp/symbols.chown
$ diff -u /tmp/symbols.chmod /tmp/symbols.chown
$

Does this mean that adding chown to the already crunched binary will not
cause a lot of bloat because of symbols/functions private to chown?

- Giorgos




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070903001803.GA8098>