-no-undefined option
Lin George
george4academic@yahoo.com
Thu Dec 14 15:12:00 GMT 2006
Thanks Ian! In most cases, I do not notice people to add this option when building a shared library. I think it is high risk (when running), since if this option is not added, linker will never try to resolve whether the referred functions are implemented actually (exported) by other modules. Do you agree? Any comments?
BTW: now I am wondering if this option is not added to linker when building a shared library, will linker do any sanity checking? I think in this situation, whether referred function is exported by other module is not checked. But what sanity points are checked in this situation? Thanks again.
regards,
George
----- Original Message ----
From: Ian Lance Taylor <iant@google.com>
To: Lin George <george4academic@yahoo.com>
Cc: gcc-help@gcc.gnu.org
Sent: Thursday, December 14, 2006 11:02:53 PM
Subject: Re: -no-undefined option
Lin George <george4academic@yahoo.com> writes:
> Thank you for your comments. I think if "--no-undefined" error does
> not exist, when building the shared library, the external
> dependencies should not be solved (means, linker will not find
> exported symbol is actually implemented), right?
If I understand you correctly, then that is right.
> When we add the option, when building a shared library, linker will
> find all imported external symbols are implemented (i.e. defined) by
> other modules.
Yes, it will give an error if any symbol is not defined somewhere.
Ian
____________________________________________________________________________________
Yahoo! Music Unlimited
Access over 1 million songs.
http://music.yahoo.com/unlimited
More information about the Gcc-help
mailing list