This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Shared variables (between ELF executables)
sam_14332 writes:
>
> Thanks for the reply!
>
> Yes, that's exactly what I'm doing. The problem is just that the value of
> the variable will just be copied - I want the dynamil linker to link against
> the exact same memory-location so that when one file updates the variable
> will this be reflected in all other files.
>
> Currently does ld produce R_386_COPY relocation entries in the executable
> files - which is not what I want. I'v tried to run ld with -z nocopyreloc,
> but this just makes each file to have an own instance of the variable (even
> without copying the value).
This should just work. You'll need to provide us with a testcase so
we can see what you're doing.
Andrew.