Xref: utzoo comp.unix.questions:26680 comp.unix.internals:930 Path: utzoo!utgpu!watserv1!watmath!att!att!linac!pacific.mps.ohio-state.edu!zaphod.mps.ohio-state.edu!samsung!umich!vela!srodawa From: srodawa@vela.acs.oakland.edu (Ron Srodawa) Newsgroups: comp.unix.questions,comp.unix.internals Subject: Re: Changing symbols to "static" Keywords: coff ld Message-ID: <3653@vela.acs.oakland.edu> Date: 2 Nov 90 20:29:31 GMT References: <781@nixbur.UUCP> <3693@skye.ed.ac.uk> Reply-To: srodawa@vela.acs.oakland.edu (Ron Srodawa) Organization: Oakland University, Rochester MI Lines: 21 In article <3693@skye.ed.ac.uk> richard@aiai.UUCP (Richard Tobin) writes: >In article <781@nixbur.UUCP> jobrien@nixbur.UUCP (John O'Brien) writes: >>Is there some way to change a symbol's class to "static" in a ".o" file? > >Almost certainly. Examine the format of symbol table entries, and see what 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. -- | Ronald J. Srodawa | Internet: srodawa@unix.secs.oakland.edu | | School of Engineering and CS | UUCP: srodawa@egrunix.UUCP | | Oakland University | Voice: (313) 370-2247 | | Rochester, Michigan 48309-4401 | |