It appears that reading /proc/self/exe actually can return the path of the shared library from which the reading is made.