Re: Accessing static variable from outside

tejas khatiwala
2007-06-16T16:36:43Z

[-- Attachment #1: Type: text/plain, Size: 873 bytes --]

AFAIK one way to be able to access a static variable is using dynamic
linking lodader. u can read man pages of dlopen() and family. and here is
example of its usage http://www.slimy.com/~jleonard/src/dlopen.html

/tejas

On 6/15/07, Rajat Jain <rajat.noida.india@gmail.com> wrote:
>
> Hi,
>
> I understand that this is off-topic, but still if some one has any ideas
> ...
>
> I have a global variable that is defined static in an object file (say
> 1.o). Now I want to be able to get the value of this variable in
> ANOTHER object file (say 2.o) without changing the source of 1.c.
>
> Any ideas, anyone? I know that as per C, this is not possible. But may
> be some clever hack?
>
> Thanks,
>
> Rajat
>
> --
> To unsubscribe from this list: send an email with
> "unsubscribe kernelnewbies" to ecartis@nl.linux.org
> Please read the FAQ at http://kernelnewbies.org/FAQ
>
>

[-- Attachment #2: Type: text/html, Size: 1344 bytes --]