On Mon, Mar 26, 2007 at 02:39:39PM -0700, John Plocher wrote: > Nicolas Williams wrote: > >Though libraries other than libc or interposers can > >generally be designed so that they are loaded as local groups and > >multiple versions can exist the same process. > > Can you say more about this?
Yes. Though you really should ask Rod Evans and the linker team rather than take my word for this. Using ld's -B local and -B group options, or using dlopen(3C) with the RTLD_LOCAL and RTLD_GROUP flags it should be possible to have multiple versions of a library loaded inside a single process, provided that the library doesn't have global process state beyond global variables (e.g., tmp files named after PIDs), and provided that all callers of the library declare it as a local group dependency or load it as a local group. dlopen(3C) doesn't have a version argument though, so the soname has to have the version in it. In practice it's not realistic to expect that all libraries are designed so this works and all callers call them in this way. But perhaps it's not unrealistic going forward? Nico --
