[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

mklibs doesn't manage to include symbol atexit

[ Please put me in cc in your answer so that I have a copy at work too,
thanks ]


i'm using mklibs at work here and I have a problem with it. One of the
binaries that I use (lilo-mtd) requires the symbol "atexit" and mklibs
doesn't manage to include it in the libc6 generated from the -pic

$ objdump -T tmp/empty/tree/sbin/lilo-mtd | grep atexit
08048edc      DF *UND*	0000003e atexit

This symbol is provided by the standard libc6 :
$ objdump -T /lib/libc.so.6 | grep atexit
0010cc54 l    d  __libc_atexit	00000000              
00028e30 g    DF .text	00000034 (GLIBC_2.0)  atexit
00028c74 g    DF .text	00000045  GLIBC_2.1.3 __cxa_atexit

But mklibs doesn't manage to create the reduced library of libc6 with
the PIC version... it gets into an endless loop, and it repeats this
message :
Still need: atexit
417 symbols, 1 unresolved
[ and follows a new try to create a reduced version ]

The atexit function does exist in the PIC version, it's called
old_atexit.os :
$ ar t /usr/lib/libc_pic.a | grep atexit

So, do you have any idea why it doesn't get included ? And it's not even
mklibs fault because atexit is correctly requested but gcc/ld doesn't
include it in the generated libc :
$ gcc -nostdlib -nostartfiles -shared -Wl,-soname=libc.so.6 -uatexit
/usr/lib/libc_pic.a -o libc.so
$ objdump -T libc.so              

libc.so:     file format elf32-i386

objdump: libc.so: Invalid operation
$ readelf -s -W libc.so 
(if you try the same with another symbol than atexit, it works)

Raphaël Hertzog - EIPM SA

Reply to: