http://eli.thegreenplace.net/2011/11/03/position-independent...
Usually security-sensitive binaries are compiled with this so that the GOT can be made read-only (although this isn't necessarily required -- PaX described a way to do this by mprotect()ing before and after each update to the GOT).
Ubuntu 16.10+ compile every binary like this, which is fine except it breaks ltrace and co, as I described here: https://stackoverflow.com/a/44295494
As well as for security, sometimes setting LD_BIND_NOW is good for performance, for example see AFL: https://github.com/mirrorer/afl/blob/a08fadf3cb0b0beffc0e4f9... (but normally it's not and you end up do a bunch of wasted loading work).
Solaris has the opposite LD_BIND_LAZY but this doesn't appear to be implemented on linux.
$ LD_DEBUG=statistics nmap -V
32564: total startup time in dynamic loader: 8917260 cycles
32564: final number of relocations: 2449
$ LD_BIND_NOW=1 LD_DEBUG=statistics nmap -V
32565: total startup time in dynamic loader: 12511900 cycles
32565: final number of relocations: 4730
Another difference between lazy and now is that if there is some symbol resolution problem, but the application never actually references that symbol, then the process can still run. This is either an advantage or a disadvantage depending on how you look at it.How does one acquire (and retain) this depth of knowledge. I work on low-level system software (C programming). Having good understanding of build system (make, cmake), dependencies and shared library knowledge is highly desired in my field.
But this is very hard core. Really interested in the path leading up to this.
If you want to learn, it is not hard at all. All it takes is curiosity. Of course, hitting a bug in ld.so or having to debug a kinky issue at the instruction level can feed such curiosity.
Apart from that, being in the right place helps. That could be a mailing list or some other channel where these tools are talked about.
Out of curiosity, what software do you work on? I have a very difficult time finding a C job, let alone one where this type of information would be valued.
I work in networking industry (as software dev). Think Juniper, Cisco, Brocade etc. This industry needs only C devs.
Pretty cool to watch it happen. The call lookup code in the dynamic linker involves a bunch of strcmp calls, which makes sense, but I still found surprising for some reason.
You can set the environment variable LD_BIND_NOW to make it do all these lookups at startup time.