Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Feb 2012 11:41:52 -0800
From:      Devin Teske <devin.teske@fisglobal.com>
To:        "'Ansar Mohammed'" <ansarm@gmail.com>, <freebsd-hackers@freebsd.org>
Subject:   RE: nologin size
Message-ID:  <0a7601ccec19$de715a90$9b540fb0$@fisglobal.com>
In-Reply-To: <CAOO1MfsEa2E-4afrcNrOCvA0SjXt%2BgOFeLMSnbeR-9=Gpv8ZVw@mail.gmail.com>
References:  <CAOO1MfsEa2E-4afrcNrOCvA0SjXt%2BgOFeLMSnbeR-9=Gpv8ZVw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help


> -----Original Message-----
> From: owner-freebsd-hackers@freebsd.org [mailto:owner-freebsd-
> hackers@freebsd.org] On Behalf Of Ansar Mohammed
> Sent: Wednesday, February 15, 2012 11:29 AM
> To: freebsd-hackers@freebsd.org
> Subject: nologin size
> 
> Hello all,
> I am trying to build a minimal size FreeBSD 9 installation and I
> noticed that the size of nologin is almost 200k.
> I built FreeBSD from source so I checked the distribution, and it's also 200k.
> So I went back to the source and just compiled nologin.c and it came up to 5k.
> 
> Can anyone explain why this executable is so large?

Dynamic versus static executable.

200K version:

% ldd /usr/sbin/nologin
ldd: /usr/sbin/nologin: not a dynamic ELF executable

5K version (produced manually by compiling/linking oneself -- shown below):

% cd /usr/src/usr.sbin/nologin
% sudo cc -c nologin.c -o nologin.o
% sudo cc -g nologin.o -o nologin
% ldd nologin
nologin:
	libc.so.7 => /lib/libc.so.7 (0x28090000)

-- 
Devin


_____________
The information contained in this message is proprietary and/or confidential. If you are not the intended recipient, please: (i) delete the message and all copies; (ii) do not disclose, distribute or use the message in any manner; and (iii) notify the sender immediately. In addition, please be aware that any message addressed to our domain is subject to archiving and review by persons other than the intended recipient. Thank you.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?0a7601ccec19$de715a90$9b540fb0$>