I've got a case in linux where gcc and ld build things cleanly, but at runtime I get an undefined symbol (for something in libxerces-c.so.28), reported by one of my own shared libraries, when running my program.
First assumption was cache was broken, xerces recently installed, or something similar, so I ran ldconfig. Didn't fix it. But adding /usr/lib to ld.so.conf and then running ldconfig did fix it.
My understanding is /lib, /usr/lib, and perhaps one or two other spots are always searched by the run-time dynamic linker.
??
(The only thing out of the ordinary is this is a java program using jni to access application shared-libraries. Then again, if it were anything rational I should have seen this error any time in the past N years of this application.)