I was analyzing gcc -v main.c -Wl, --verbose
, when I realized a few of the paths mentioned in the LIBRARY_PATH
variable were laughably redundant (assuming ../
refers to the parent directory).
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../:/lib/:/usr/lib/
For example, look at this::/usr/lib/../lib/
Why would this exist? What's the point of going into lib
, then coming out of it and again going back into? Given that /usr/lib
is also included at the end.