tech-embed archive

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

reinitialization of global varriables in .sbss section across calls on MIPS



Hi,

i am facing one problem On MIPS-netbsd regarding reinitialization of sbss
section

If in one shared library you have some global varriables and if they are
part of .sbss section
Then when any function is called in that shared library from main program
and if it update those varriables then this updated should be refelected to
the subsequent calls to any function in that shared library

But I am facing one problem if i declared some global varriables and in
first call to that function I assign those varriables some value ,but when i
come back from that shared library to main and then later if i call some
another functions from that library then the pointers are getting
reinitialized to the initial values.

By debugging the problem i found that all these varriables are part of .sbss
sections

So is this the problem with mips that whatever varriables are part of .sbss
sections, are not persisting across calls to the shared library???


Pseudo Code:
============

foo.c
=========

static int tmp=10;
int xxx() {
.....
tmp = 15;
print(tmp);
...
}

int yyy()
{

print(tmp);

}

=============
tst1.c
int main() {

call xxx();

sleep(10);

call yyy();

}
==================

output:
15
10
 
 
NOTE:please CC to me as i am not the member of this mailing list
 


Home | Main Index | Thread Index | Old Index