Globals visible in shared object libraries

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

 



I have been digging at this for days, Now I'm turning to the experts.

Given:
executable module A has a global variable (long)  called 'value'
It loads module B.so  using dlopen() and loads a function pointer
(called 'test') .

Module B.so also has a global variable (some other type) called 'value'

When I call test() in B.so and that function changes the contents of
'value', it 
changes to one in the A executable.  Not the one in in B.so.  (or I
assume they
have been 'linked' into the same memory location)

How can I DISABLE the dynamic linker from doing what appears to be
binding
the variable 'value'  in the two modules together?  It's this a HUGH
hole where
any shared library can get access to (and corrupt) variables in the main
executable?

Everything think I've seen written seems to be regarding doing the
opposite.

Any help is appreciated.

-Scott Weber
(sorry if this is not exclusively plain text - Outlook... :-(  )


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux