This is the mail archive of the
mailing list for the GCC project.
lazy load shared objects using gcc
- From: P dot R dot Reidel at t-online dot de (Roberta Reidel)
- To: gcc at gcc dot gnu dot org
- Date: Sat, 10 Aug 2002 10:39:06 +0200
- Subject: lazy load shared objects using gcc
i always assumed 'lazy load' to be the default configuration of the
g++/gcc 'frontend'. But i tested this using gcc version 2.96 on
RedHat 7.1/7.2, and it seems to be 'load now' the default configuration.
Reading the man/info pages of gcc and ld, i guess the ld to support 'lazy
load' ( the -R <file> option ). But the gcc doesn't know any option, except
' -z now ' --- to *turn off* lazy loading. This confirms my assumption of
'lazy load' beeing the default.
But it doesn't: The error message of missing shared libraries always appears
on start time. To decide between two hardware subsets (eg. pcmcia cards)
i simply want to decide to engage the card of type one or two.
a simple ' gcc MainApplication.cpp CardTypeOne.so CardTypeTwo.so ' should
call the compiler, Assembler and linker -- preparing lazy load. But it does
a 'load now'. (And this doubles the time to start the Application.)
Please tell me where do i'm going wrong ? Where is my mistake in
configuration ? Is there really no other way as to go through the ugly
way of 'dlopen()' + dlsym() ... ??
I always mentioned the ELF format to be the solution to these problems.