This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
My-first-libelf-program breaks libraries
- From: Daniel Drake <dsd at laptop dot org>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Fri, 20 May 2011 14:54:26 +0100
- Subject: My-first-libelf-program breaks libraries
Hi,
I'm trying to write a program which modifies the GNU_PRELINKED elf
timestamp. It works, but not on all libraries. Here's my attempt:
http://dev.laptop.org/attachment/ticket/10898/prelink_timestamp_remover.c
It seems to break some libraries, and if I run it over the whole
system then I can't even boot or chroot in.
I narrowed it down to a simple test case which can easily be shown to
break libc, even though my understanding is that this code should do
(almost) nothing:
http://dev.laptop.org/attachment/ticket/10898/libelf_library_eater.c
$ gcc libelf_library_eater.c -lelf -o eater
$ cp /lib/libc-2.13.so .
$ ./libc-2.13.so
GNU C Library stable release version 2.13, by Roland McGrath et al.
$ ldd libc-2.13.so
/lib/ld-linux.so.2 (0x0030d000)
linux-gate.so.1 => (0x00909000)
$ ./eater libc-2.13.so
$ ./libc-2.13.so
Segmentation fault
$ ldd libc-2.13.so
statically linked
What am I missing?
Thanks,
Daniel