Fixes hang due to change in order of initialization of libraries

Fixes hang due to change in order of initialization of libraries
that have cyclical dependencies and they call hsa_init() during their
initialization phase.
This implementation looks for a symbol called "HSA_AMD_TOOL_PRIORITY"
across all loaded shared libraries using dynamic section entries of the
loaded lib instead of using dlopen and dlsym for the same purpose.

Change-Id: I4865f2fd18dd186ec311a432ec38fbb5583805d2
Αυτή η υποβολή περιλαμβάνεται σε:
Shweta Khatri
2023-01-19 17:58:41 -05:00
γονέας e30be76f37
υποβολή 8aac885318
3 αρχεία άλλαξαν με 84 προσθήκες και 7 διαγραφές
@@ -86,9 +86,10 @@ void* GetExportAddress(LibHandle lib, std::string export_name);
/// @param: lib(Input), library handle which will be unloaded.
void CloseLib(LibHandle lib);
/// @brief: Lists libraries in the process
/// @brief: Lists loaded tool libraries that contain
/// symbol HSA_AMD_TOOL_PRIORITY
/// @return: List of library handles
std::vector<LibHandle> GetLoadedLibs();
std::vector<LibHandle> GetLoadedToolsLib();
/// @brief: Returns the library's path name.
/// @param: lib(Input), libray handle