From owner-freebsd-hackers@FreeBSD.ORG Tue Oct 5 14:13:40 2010 Return-Path: Delivered-To: hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A507A106566B for ; Tue, 5 Oct 2010 14:13:40 +0000 (UTC) (envelope-from erikt@midgard.homeip.net) Received: from ch-smtp01.sth.basefarm.net (ch-smtp01.sth.basefarm.net [80.76.149.212]) by mx1.freebsd.org (Postfix) with ESMTP id 26DF18FC12 for ; Tue, 5 Oct 2010 14:13:39 +0000 (UTC) Received: from c83-255-61-120.bredband.comhem.se ([83.255.61.120]:50674 helo=falcon.midgard.homeip.net) by ch-smtp01.sth.basefarm.net with esmtp (Exim 4.71) (envelope-from ) id 1P382t-00031F-4r for hackers@FreeBSD.org; Tue, 05 Oct 2010 15:59:09 +0200 Received: (qmail 4374 invoked from network); 5 Oct 2010 15:59:06 +0200 Received: from owl.midgard.homeip.net (10.1.5.7) by falcon.midgard.homeip.net with ESMTP; 5 Oct 2010 15:59:06 +0200 Received: (qmail 3514 invoked by uid 1001); 5 Oct 2010 15:59:06 +0200 Date: Tue, 5 Oct 2010 15:59:06 +0200 From: Erik Trulsson To: Erik Cederstrand Message-ID: <20101005135906.GA3430@owl.midgard.homeip.net> References: <52C32EA5-A380-4237-A27C-9E2DF2D4E022@cederstrand.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <52C32EA5-A380-4237-A27C-9E2DF2D4E022@cederstrand.dk> User-Agent: Mutt/1.5.20 (2009-06-14) X-Originating-IP: 83.255.61.120 X-Scan-Result: No virus found in message 1P382t-00031F-4r. X-Scan-Signature: ch-smtp01.sth.basefarm.net 1P382t-00031F-4r ff869574345385dc8b0043e818980f7b Cc: FreeBSD Hackers Subject: Re: Timestamps in static libraries X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Oct 2010 14:13:40 -0000 On Tue, Oct 05, 2010 at 03:28:36PM +0200, Erik Cederstrand wrote: > Hello hackers, > > I got reminded of a problem I had a couple of years back compressing > FreeBSD jails. I was using bsdiff for the compression and found out > that md5 sums of static libraries (.a files) in /usr/lib and > /usr/local/lib didn't match between jails, even though the source > code used to create the jails hadn't changed. One of my goals is to > detect which files in a distribution change between two commits. > > It turns out that timestamps are stored in the library: Yes, they are. That is because the file format used for static libraries include a timestamp for each object file stored in the archive. You can use 'ar -tv /PATH/TO/LIBRARY/libfoo.a' to get a list of the objects stored in the archive and the corresponding timestamps. See the ar(5) manpage for a description of the file format, and the ar(1) manpage for information on how to manage such files. -- Erik Trulsson ertr1013@student.uu.se