[speex-dev] Re: does installed lib support _int()s ?

Segher Boessenkool segher at kernel.crashing.org
Wed May 19 08:12:48 PDT 2004

>>> I wonder if there's a way to "weak-link" against libraries on
>>> Linux/GNU-ld-so?  The idea is that a symbol lookup/relocation isn't
>>> performed until the call is actually MADE, rather than merely
>>> referenced.
>> That's the default behaviour.
> No it's not.  The linker/loader (ld.so) expects all of the referenced
> symbols to exist in SOME library no matter if they're actually called 
> or not
> by the main executable (ELF).  It goes through all of the external 
> symbols
> not present in the executable, and tries to find them in the library 
> search
> paths.  If it can't find ALL of them, the linker-loader fails to run 
> the
> program.

This is so completely wrong.  For starters, ld.so is not the loader
(ld is the loader; ld.so is the dynamic loader.  That's a *huge*

ld.so resolves symbols lazily, by default.

ld requires all external references to be resolved, when creating
an executable (undefined references are fine when creating a
shared library).

ld.so doesn't go looking for a shared library with the symbols it
needs (that would be...  confusing and dangerous.  lots of fun!);
instead, it knows which libraries to use (that info is stored
in the executable, by ld).

> To give one stupid example:

Stupid indeed -- three programming errors in a "hello world"...


--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'speex-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.

More information about the Speex-dev mailing list