summaryrefslogtreecommitdiff
path: root/sql/sql_plugin.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2015-03-30 14:16:34 +0200
committerSergei Golubchik <serg@mariadb.org>2015-04-08 10:58:49 +0200
commit9bda4bc52a1c36ec61589e9006edc3f8ac5fec0b (patch)
tree6f071fbc9dba2f70445d8a7a3581e5704ee8ed7a /sql/sql_plugin.cc
parentbeea77869557486aa3ece65b57b7807f72fcbc75 (diff)
downloadmariadb-git-9bda4bc52a1c36ec61589e9006edc3f8ac5fec0b.tar.gz
report a plugin loading offset at dlopen time
not an address of some arbitrarily chosen symbol; not when plugin is successfully loaded (which means - no info when plugin->init failed);
Diffstat (limited to 'sql/sql_plugin.cc')
-rw-r--r--sql/sql_plugin.cc22
1 files changed, 12 insertions, 10 deletions
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc
index 30ab2531a1e..5c4a7b5af97 100644
--- a/sql/sql_plugin.cc
+++ b/sql/sql_plugin.cc
@@ -43,6 +43,10 @@
#define REPORT_TO_LOG 1
#define REPORT_TO_USER 2
+#ifdef HAVE_LINK_H
+#include <link.h>
+#endif
+
extern struct st_maria_plugin *mysql_optional_plugins[];
extern struct st_maria_plugin *mysql_mandatory_plugins[];
@@ -767,6 +771,14 @@ static st_plugin_dl *plugin_dl_add(const LEX_STRING *dl, int report)
}
dlopen_count++;
+#ifdef HAVE_LINK_H
+ if (global_system_variables.log_warnings > 2)
+ {
+ struct link_map *lm = (struct link_map*) plugin_dl.handle;
+ sql_print_information("Loaded '%s' with offset 0x%lx", dl->str, lm->l_addr);
+ }
+#endif
+
/* Checks which plugin interface present and reads info */
if (!(sym= dlsym(plugin_dl.handle, maria_plugin_interface_version_sym)))
{
@@ -1385,16 +1397,6 @@ static int plugin_initialize(MEM_ROOT *tmp_root, struct st_plugin_int *plugin,
goto err;
}
- if (plugin->plugin_dl && global_system_variables.log_warnings >= 9)
- {
- void *sym= dlsym(plugin->plugin_dl->handle,
- plugin->plugin_dl->mariaversion ?
- maria_plugin_declarations_sym : plugin_declarations_sym);
- DBUG_ASSERT(sym);
- sql_print_information("Plugin %s loaded at %p",
- plugin->name.str, sym);
- }
-
if (plugin_type_initialize[plugin->plugin->type])
{
if ((*plugin_type_initialize[plugin->plugin->type])(plugin))