This is the mail archive of the elfutils-devel@sourceware.org mailing list for the elfutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]