This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils 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: dlopen, RTLD_GLOBAL and global variables


Scott Moser LTC <ssmoser@us.ibm.com> writes:

>    Any one have any ideas on how I can give applications access to global
> variables transparently through the wrapper library?  Is this a problem with
> dlopen and RTLD_GLOBAL or something I'm not understanding correctly, or just
> missing (flags to ld...).

Without thinking about it too hard, it seems to me that you can just
define the global variables in your library.  Then those variables
will take precedence over the ones in the libgtk shared library, and
all the references in libgtk will wind up referring to the ones you
defined.  Of course, you must make sure that the variables which you
define are large enough.

Or perhaps you could use the LD_PRELOAD mechanism.

Ian


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