This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc 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]

Re: Prelinking and LD_PRELOAD


On Fri, Nov 15, 2002 at 07:37:11PM +0000, Stefan Jones wrote:
> Dear Sirs,
> 
> 	I have started experimenting with prelink. I have the latest release
> versions of gcc, binutils and glibc. ( 3.2 / 2.13.90.0.10 / 2.3.1 )
> I have prelinked my entire system with only one error. Everything worked
> as advertised.
> 
> Here is the problem:
> 
> If you attempt to prelink QT, most files will fail to do so with errors
> like:
> 
> prelink: linguist: Could not parse `linguist: error while loading shared
> libraries: linguist: cannot open shared object file: No such file or
> directory'
> 
> and
> 
> prelink: libqt.so.3: Dependency tracing failed

What does
ldd /usr/lib/qt3/lib/libqt.so.3
(or where do you have libqt installed) say?
This looks like installation problem, maybe missing path entry in ld.so.conf
or something.

> This is fine, you cannot have everything!
> 
> But you can prelink /usr/qt/3/bin/moc, their header file creator.

Probably because it has RPATH.

> But when you run moc with LD_PRELOAD set then you get the following,
> 
> moc: error while loading shared libraries: unexpected reloc type 0x05

Cannot reproduce it, works just fine for me:
LD_DEBUG=statistics moc
07602:
07602:  runtime linker statistics:
07602:    total startup time in dynamic loader: 206704 clock cycles
07602:              time needed for relocation: 1022 clock cycles (.4%)
07602:                   number of relocations: 0
07602:        number of relocations from cache: 14
07602:             time needed to load objects: 129075 clock cycles (62.4%)
^C
LD_PRELOAD=/usr/lib/qt3/lib/libqt.so.3 LD_DEBUG=statistics moc
07603:
07603:  runtime linker statistics:
07603:    total startup time in dynamic loader: 56192381 clock cycles
07603:              time needed for relocation: 54228782 clock cycles (96.5%)
07603:                   number of relocations: 12183
07603:        number of relocations from cache: 28944
07603:             time needed to load objects: 1787579 clock cycles (3.1%)
^C

> Is this a known problem, incompatabiltiy with QT, or plain user error?

Reloc type 0x05 is R_386_COPY. Having COPY relocs in shared libraries is
very weird. Can you write exactly what you were trying to preload and
perhaps LD_DEBUG=all output (bzip2ed if possible)?

	Jakub


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