1530 // Loads .dll/.so and |
1530 // Loads .dll/.so and |
1531 // in case of error it checks if .dll/.so was built for the |
1531 // in case of error it checks if .dll/.so was built for the |
1532 // same architecture as Hotspot is running on |
1532 // same architecture as Hotspot is running on |
1533 |
1533 |
1534 void * os::dll_load(const char *filename, char *ebuf, int ebuflen) { |
1534 void * os::dll_load(const char *filename, char *ebuf, int ebuflen) { |
|
1535 log_info(os)("attempting shared library load of %s", filename); |
|
1536 |
1535 void * result= ::dlopen(filename, RTLD_LAZY); |
1537 void * result= ::dlopen(filename, RTLD_LAZY); |
1536 if (result != NULL) { |
1538 if (result != NULL) { |
1537 // Successful loading |
1539 // Successful loading |
1538 Events::log(NULL, "Loaded shared library %s", filename); |
1540 Events::log(NULL, "Loaded shared library %s", filename); |
|
1541 log_info(os)("shared library load of %s was successful", filename); |
1539 return result; |
1542 return result; |
1540 } |
1543 } |
1541 |
1544 |
1542 Elf32_Ehdr elf_head; |
1545 Elf32_Ehdr elf_head; |
1543 const char* error_report = ::dlerror(); |
1546 const char* error_report = ::dlerror(); |
1548 ::strncpy(ebuf, error_report, ebuflen-1); |
1551 ::strncpy(ebuf, error_report, ebuflen-1); |
1549 ebuf[ebuflen-1]='\0'; |
1552 ebuf[ebuflen-1]='\0'; |
1550 } |
1553 } |
1551 |
1554 |
1552 Events::log(NULL, "Loading shared library %s failed, %s", filename, error_report); |
1555 Events::log(NULL, "Loading shared library %s failed, %s", filename, error_report); |
|
1556 log_info(os)("shared library load of %s failed, %s", filename, error_report); |
1553 |
1557 |
1554 int diag_msg_max_length=ebuflen-strlen(ebuf); |
1558 int diag_msg_max_length=ebuflen-strlen(ebuf); |
1555 char* diag_msg_buf=ebuf+strlen(ebuf); |
1559 char* diag_msg_buf=ebuf+strlen(ebuf); |
1556 |
1560 |
1557 if (diag_msg_max_length==0) { |
1561 if (diag_msg_max_length==0) { |