I want a variable to be shared between several ELF executables in the same process image - e.g. different .so files and the program executable.

And I don't want the value of the variable to be just copied between the executables (this is currently what happens for me) - i want all references to the variable in all executables to be dynamically linked against the same memory-location in the same .so file.

What is the soulution? Some command-line argument to ls? Some change in the linker script? Something with the __attribute__ stuff? I'm using Red Hat 9.

Please HELP (thank you)!