Changing symbols to "static"

Doug Gwyn gwyn at smoke.brl.mil
Thu Nov 1 11:30:29 AEST 1990


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?

Technically, there probably is, but it wouldn't solve whatever problem
you think it would.

>but would it then be possible to change the class of "a", "b", "c" 
>and "d" to static so that they would not be exported to the linker?

You're missing an important point:  spot() REQUIRES that definitions
be provided for a() and b().  Changing these to private rather than
global symbols wouldn't magically define suitable functions!  In some
(non standard conforming) implementations, c and d might already be
compiled into references to "common" storage, so they would get
storage defined for them even if there were no explicit definition in
the set of modules being linked.

My recommendation is to design the kind of external interfaces you
really want, rather than trying to override the design via the linker.



More information about the Comp.unix.questions mailing list