Re: Windows and DLLs



Wesley Felter wrote:

> All this talk about location independence and shared libraries makes me
> wonder: Why *can't* Linux binaries run from just any random location in the
> filesystem? BeOS doesn't seem to have any problem with it. This is not a
> complaint; I just don't know how dynamic linking works so I'd be interested
> in knowing the technical details of why it's hard/impossible for binaries to
> be location-independent. Feel free to lecture me off-list if this is
> off-topic.

You could set every directory to have the execute bit on if you really wanted
to.  The reason for having executables in /bin directories and libraries in /lib
is an organizational thing AFAIK.  Windows having binaries all over the place is
pretty retarded in my opinion, and having libraries in one place makes life a
helluva lot easier for the dynamic linker I think.

Basically ld, the dynamic linker, has a configuration file that tells it where
to find libraries.  These directories contain the actual libraries and symlinks
to the newest version.  The actual library is the .so file, i'm not sure what .a
and .la files are.  By adding files to ld.so.conf or LD_LIBRARY_PATH you can put
new directories into your library path, like /usr/local/lib or ~/my_libs.

Make sense?
Adam Keys



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]