views:

209

answers:

1

Earlier today I asked a question about environ, and one of the more interesting replies suggested that I could gather information using LD_DEBUG.

Now I've known about some linker/loader environment variables (such as *LD_PRELOAD*) for awhile, but this one was new to me. Googling, I found a Linux-specific man page discussing environment variables used by the linker/loader, including LD_DEBUG. So theoretically, I'm set. But in practice, I'm sure I'm missing a whole bundle of tricks relating to this fundamental tool in the toolchain.

Put simply, what else am I missing?

+3  A: 

My favorite is using LD_PRELOAD to work around bugs or misfeatures in GNU libc; for a while connect was doing strange things with IPv6 and I just wrote my own version that always, always used IPv4.

Linux users can try

man ld.so

Also, the ldd command, which tells how dynamic libraries are resolved, deserves to be more widely known.

Norman Ramsey
And on Solaris the manpage to read is called ld.so.1
matli
@matli - there's some thickness on my part. I have used man ld, but it never occurred to me to use 'man ld.so'. Only Googling on LD_DEBUG once I'd heard of it got me into the neighborhood.@Norman, Re: ldd, yep, I use it all the time.
Don Wakefield