More flexible search for shared libraries