Changing symbols to "static"

Ron Srodawa srodawa at vela.acs.oakland.edu
Sat Nov 3 07:29:31 AEST 1990


In article <3693 at skye.ed.ac.uk> richard at aiai.UUCP (Richard Tobin) writes:
>In article <781 at nixbur.UUCP> jobrien at 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 at unix.secs.oakland.edu |
| School of Engineering and CS    | UUCP:     srodawa at egrunix.UUCP          |
| Oakland University              | Voice:    (313) 370-2247                |
| Rochester, Michigan  48309-4401 |                                         |



More information about the Comp.unix.internals mailing list