Why not remove or normalise the timestamp in the prelink output?

I made a local version of prelink that avoided the use of time(2) in
setting the timestamp, and then compared the result against the system
version or prelink:

# prelink -u /tmp/libxml2.so 
# prelink /tmp/libxml2.so 
# md5sum /tmp/libxml2.so
f2ca3c0a897d1140e02e725a294e7cbb  /tmp/libxml2.so
# prelink -u /tmp/libxml2.so 
# prelink /tmp/libxml2.so 
# md5sum /tmp/libxml2.so
b98f4d68d312711562f801be05f30c95  /tmp/libxml2.so
# /tmp/prelink-0.0.20090925/src/prelink -u /tmp/libxml2.so
# /tmp/prelink-0.0.20090925/src/prelink /tmp/libxml2.so
# md5sum /tmp/libxml2.so
b356653156f963c1c5561f4025a53026  /tmp/libxml2.so
# /tmp/prelink-0.0.20090925/src/prelink -u /tmp/libxml2.so
# /tmp/prelink-0.0.20090925/src/prelink /tmp/libxml2.so
# md5sum /tmp/libxml2.so
b356653156f963c1c5561f4025a53026  /tmp/libxml2.so
# 

The md5sum no longer changes.  Therefore the md5sum changes you observe
are due to the system time when prelink is run.

In place of a zero time_t, the OLPC_EPOCH may be more suitable.

I did not investigate adjusting the output file directly, but it should
be possible.

The change I made to prelink is attached as a patch.

-- 
James Cameron
http://quozl.linux.org.au/
--- prelink.c.orig	2011-05-18 09:34:51.000000000 +1000
+++ prelink.c	2011-05-18 09:34:57.000000000 +1000
@@ -793,7 +793,7 @@
   DSO *dso = info->dso;
 
   if (! verify)
-    info->ent->timestamp = (GElf_Word) time (NULL);
+    info->ent->timestamp = 0;
   dso->info_DT_GNU_PRELINKED = info->ent->timestamp;
   if (prelink_set_checksum (dso))
     return 1;
_______________________________________________
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel

Reply via email to