Xref: utzoo comp.unix.questions:26719 comp.unix.internals:951 Path: utzoo!attcan!uunet!zaphod.mps.ohio-state.edu!usc!apple!agate!linus!nixbur!jobrien From: jobrien@nixbur.UUCP (John O'Brien) Newsgroups: comp.unix.questions,comp.unix.internals Subject: Re: Changing symbols to "static" Keywords: coff ld Message-ID: <784@nixbur.UUCP> Date: 5 Nov 90 23:09:02 GMT References: <781@nixbur.UUCP> <3693@skye.ed.ac.uk> <3653@vela.acs.oakland.edu> Reply-To: jobrien@nixbur.UUCP (John O'Brien) Organization: /usr/lib/news/organization Lines: 22 >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