I donβt think you can do exactly what you want. However, what if you force all the characters in the libraries that you include to be weak with the following ld flag:
-weak_library path_to_library This is the same as listing a file name path to a library on the link line except that it forces the library and all ref- erences to it to be marked as weak imports.
Thus, if other libraries are included with stronger characters, they override the characters in look-here-if-you-can't-find-it-anywhwere-else.so . If the libraries specified in LD_LIBRARY_PATH do not have stronger characters defined in LD_LIBRARY_PATH , the weak characters in look-here-if-you-can't-find-it-anywhwere-else.so .
source share