[Top][All Lists]

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

Re: ltdl dlpreopen behavior

From: Albert Chin
Subject: Re: ltdl dlpreopen behavior
Date: Thu, 4 Aug 2005 20:44:33 -0500
User-agent: Mutt/1.5.6i

On Thu, Aug 04, 2005 at 11:39:41PM +1000, David Collett wrote:
> I hoped that dlpreopening could be used for this purpose and i
> modified to support either -dlopen or -dlpreopen per
> module depending on configure args. The problem is that dlpreopen does
> not cause the objects to be compiled in, rather it still produces a
> so/dll, but compile-time links it to the executable (such that ldd
> displays the dependancy).

According to the documentation:
`-dlpreopen FILE'
     Link FILE into the output program, and add its symbols to
     LT_PRELOADED_SYMBOLS (*note Dlpreopening::).  ...

So, it appears to behave as expected.

> Is there a way to change this behavior such that dlpreopend objects
> get compiled right in?
> BTW. I have found another way of achieving this result: having two
> libtool library targets with different names for the same module
> source, one a convienience library, and the other a module. Makefile
> substitutions to the appropriate ones to the LDADD line as required.
> The only problem is that loading code is now different for builtin vs
> modules. I am solving this with a substitution into my actual C code,
> but thats kind of ugly...
> Any suggestions? I imagine my program would be a fairly common design
> wrt builtin+optional modules (the linux kernel is an obvious example).

The only other program I know of that does what you wish is PHP. But,
I don't know how they do it.

I thought of the convenience library solution as well. I don't know
what else to offer. What do you mean by "loading code is now different
for builtin vs modules"? Why would you have to load code for builtins?
Couldn't you lt_dlsym() to determine if the module was a
builtin/already loaded?

albert chin (address@hidden)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]