summaryrefslogtreecommitdiff
path: root/ld/plugin.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2011-03-04 23:44:01 +0000
committerH.J. Lu <hjl.tools@gmail.com>2011-03-04 23:44:01 +0000
commitecdcc59009b52208e1f74aca233279584d9366d5 (patch)
tree7b56d83048f02a6537cf56abca3cb40dd59586b8 /ld/plugin.c
parent01e06b712c1f9bc0bc15c1f15e012455506831da (diff)
downloadbinutils-redhat-ecdcc59009b52208e1f74aca233279584d9366d5.tar.gz
Report plugin symbols for --verbose=N.
2011-03-04 H.J. Lu <hongjiu.lu@intel.com> * ld.texinfo: Document --verbose[=NUMBER]. * lexsup.c (ld_options): Update --verbose. (parse_args): Set report_plugin_symbols. * plugin.c (report_plugin_symbols): New. (get_symbols): Report plugin symbols if report_plugin_symbols is TRUE. * plugin.h (report_plugin_symbols): New.
Diffstat (limited to 'ld/plugin.c')
-rw-r--r--ld/plugin.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/ld/plugin.c b/ld/plugin.c
index 7ac2cb85ee..a68aea3cf7 100644
--- a/ld/plugin.c
+++ b/ld/plugin.c
@@ -36,6 +36,9 @@
#include <Windows.h>
#endif
+/* Report plugin symbols. */
+bfd_boolean report_plugin_symbols;
+
/* The suffix to append to the name of the real (claimed) object file
when generating a dummy BFD to hold the IR symbols sent from the
plugin. */
@@ -463,7 +466,7 @@ get_symbols (const void *handle, int nsyms, struct ld_plugin_symbol *syms)
if (!blhe)
{
syms[n].resolution = LDPR_UNKNOWN;
- continue;
+ goto report_symbol;
}
/* Determine resolution from blhe type and symbol's original type. */
@@ -471,7 +474,7 @@ get_symbols (const void *handle, int nsyms, struct ld_plugin_symbol *syms)
|| blhe->type == bfd_link_hash_undefweak)
{
syms[n].resolution = LDPR_UNDEF;
- continue;
+ goto report_symbol;
}
if (blhe->type != bfd_link_hash_defined
&& blhe->type != bfd_link_hash_defweak
@@ -516,7 +519,7 @@ get_symbols (const void *handle, int nsyms, struct ld_plugin_symbol *syms)
syms[n].resolution = LDPR_RESOLVED_DYN;
else
syms[n].resolution = LDPR_RESOLVED_EXEC;
- continue;
+ goto report_symbol;
}
/* Was originally def, or weakdef. Does it prevail? If the
@@ -529,13 +532,18 @@ get_symbols (const void *handle, int nsyms, struct ld_plugin_symbol *syms)
syms[n].resolution = (ironly
? LDPR_PREVAILING_DEF_IRONLY
: LDPR_PREVAILING_DEF);
- continue;
+ goto report_symbol;
}
/* Was originally def, weakdef, or common, but has been pre-empted. */
- syms[n].resolution = is_ir_dummy_bfd (owner_sec->owner)
- ? LDPR_PREEMPTED_IR
- : LDPR_PREEMPTED_REG;
+ syms[n].resolution = (is_ir_dummy_bfd (owner_sec->owner)
+ ? LDPR_PREEMPTED_IR
+ : LDPR_PREEMPTED_REG);
+
+report_symbol:
+ if (report_plugin_symbols)
+ einfo ("%P: %B: symbol `%s' definition: %d, resolution: %d\n",
+ abfd, syms[n].name, syms[n].def, syms[n].resolution);
}
return LDPS_OK;
}