Changing symbols to "static"
John O'Brien
jobrien at nixbur.UUCP
Tue Nov 6 10:09:02 AEST 1990
>Uh? Static variables are allocated storage in a different place than
>non-static variables. Non-static local variables are allocated on the
>stack, static variables along with the text. I would expect the easiest
>fix is a recompile. If youy REALLY wanted to try it, you would have to
>increase the length of the module, note where the new space is, then
>change EVERY reference to the variable to the new location. This will
>change the address mode you will use and the new instruction may be shorter
>or longer than the instruction it replaces. I wouldn't even attempt to
>try this. Ron.
Actually I was much more concerned about the functions (which are always in
the "text" section) than the variables. My question was, if I did what I was
proposing to do, would symbols that been changed to static in big.o still be
visible throughout "big.o", and would they be exported to the linker?
I don't know COFF very well, but it seems to me that in the example I gave
it seems to me that the variables "c" and "d" would be in the "bss"
(uninitialized data) section whether or not they were static because they
exist through out the program, and do not have initial values. I just simply
want some control of which symbols are exported to the linker.
John
More information about the Comp.unix.questions
mailing list