[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: When linking, why -L's *must* come before -l's??? Why -l's can come
Re: When linking, why -L's *must* come before -l's??? Why -l's can come before function calls?!!
02 May 2003 17:51:12 -0400
Why is gcc compiler smart enough to let you put -l's BEFORE object
files and main() but not smart enough to let you put -L's *after*
-l's on command line when linking??
the -L is analogous to setting PATH in the shell; the following usages
(-l for linker, commands for shell) are effected by it until the next
change. suppose you had a /bin/ls and a $HOME/bin/ls (the latter being
part of your rootkit scanner, e.g.). you could write a script to make
use of both, like:
ls # resolves to /bin/ls
ls # resolves to $HOME/bin/ls
same kind of thinking goes for the -L and -l ordering and "shadow
library sets". at least, this is the story i tell myself...