Xref: utzoo comp.unix.questions:26698 comp.unix.internals:940 Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!samsung!uunet!brunix!cgy From: cgy@cs.brown.edu (Curtis Yarvin) Newsgroups: comp.unix.questions,comp.unix.internals Subject: Re: Changing symbols to "static" Summary: Chaos & Confusion Abound Keywords: coff ld Message-ID: <55343@brunix.UUCP> Date: 4 Nov 90 18:06:08 GMT References: <781@nixbur.UUCP> <3693@skye.ed.ac.uk> <3653@vela.acs.oakland.edu> Sender: news@brunix.UUCP Reply-To: cgy@cs.brown.edu (Curtis Yarvin) Organization: Meat Possum Athletic Club, Department of Computer Science Lines: 26 In article <3653@vela.acs.oakland.edu> srodawa@vela.acs.oakland.edu (Ron Srodawa) writes: >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 It would appear we have a terrible misunderstanding here; so, before we get an accidental flame war, let's break this thing up. There are two things you can do with the "static" keyword in C. You can tell the compiler to keep a _local_ variable in the data segment instead of the stack. Or you can prevent routines in other files from accessing a _global_ variable in a file. The first cannot be altered without a good disassembler. The second can. Which the original poster was referring to is anyone's guess; maybe he can post again & tell us. -Curtis "I tried living in the real world Instead of a shell But I was bored before I even began." - The Smiths