On Nov 15, 2007 10:59 AM, Darren New <[EMAIL PROTECTED]> wrote:
> Carl Lowenstein wrote:
> > If the only use of the function is to keep the string from being
> > optimized away, what keeps the function from also being optimized
> > away?
>
> Separate compilation?
>
I do believe that you have forgotten the initial goal -- to embed ID
strings in separately compiled program pieces with a minimum of extra
effort.
A separately compiled function to exhibit these strings now needs to
be defined in each place where it might be called, and put into the
linkage command string. Even if it is never actually called.
In fact, it seems to me that the aggressive optimizer would remove
definitions of external functions if they are never called.
__attribute__((used)) is a tolerable workaround, just needs to be
entered into my fingertip memory.
carl
--
carl lowenstein marine physical lab u.c. san diego
[EMAIL PROTECTED]
--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg