diff -ur libelf-0.8.2.orig/lib/update.c libelf-0.8.2/lib/update.c
--- libelf-0.8.2.orig/lib/update.c	2001-12-25 14:01:59.000000000 +0100
+++ libelf-0.8.2/lib/update.c	2007-07-25 20:18:02.000000000 +0200
@@ -874,11 +874,28 @@
     return err;
 }
 
+#include <stdio.h>
+#include <stdlib.h>
+
+static FILE *dirty_fout = NULL;
+void QUICKDIRTYDEBUG_print2log(Elf *elf, Elf_Cmd cmd) {
+   if (dirty_fout == NULL) dirty_fout = fopen("quickdirty.log","a");
+   fprintf(dirty_fout,"elf: 0x%08X ; cmd_code: %d\n",(unsigned int)elf,(int)cmd);
+   fflush(dirty_fout);
+}
+
+void QUICKDIRTYDEBUG_print2log_len(off_t len) {
+   if (dirty_fout == NULL) dirty_fout = fopen("quickdirty.log","a");
+   fprintf(dirty_fout,"len: %d\n",len);
+   fflush(dirty_fout);
+}
+
 off_t
 elf_update(Elf *elf, Elf_Cmd cmd) {
     unsigned flag;
     off_t len;
 
+    QUICKDIRTYDEBUG_print2log(elf,cmd);
     if (!elf) {
 	return -1;
     }
@@ -906,6 +923,7 @@
     }
     else if (elf->e_class == ELFCLASS32) {
 	len = _elf32_layout(elf, &flag);
+       QUICKDIRTYDEBUG_print2log_len(len); // how long is it???
 	if (len != -1 && cmd == ELF_C_WRITE && (flag & ELF_F_DIRTY)) {
 	    len = _elf_output(elf, elf->e_fd, (size_t)len, _elf32_write);
 	}
