diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2020-12-16 13:40:42 -0800 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2020-12-16 13:40:51 -0800 |
commit | bcac599f73874fd63a3901f0a9f7d24e50c2ad24 (patch) | |
tree | 8186c2ed9d2266e9fab2d5d17f607d3f58e3e4f8 /ld/libdep_plugin.c | |
parent | 592995fadd37e3a8d831fc3f48994c9d5cc2a974 (diff) | |
download | fsf-binutils-gdb-bcac599f73874fd63a3901f0a9f7d24e50c2ad24.zip fsf-binutils-gdb-bcac599f73874fd63a3901f0a9f7d24e50c2ad24.tar.gz fsf-binutils-gdb-bcac599f73874fd63a3901f0a9f7d24e50c2ad24.tar.bz2 |
ld: Skip libdep plugin if not all plugin hooks are available
Skip plugin if not all required plugin hooks are available.
2020-12-16 Howard Chu <hyc@symas.com>
H.J. Lu <hongjiu.lu@intel.com>
PR ld/27081
* libdep_plugin.c (onload): Skip if not all required plugin hooks
are available.
* testsuite/config/default.exp (dep_plug_opt): New.
* testsuite/ld-elf/elf.exp: Pass $dep_plug_opt to nm.
* testsuite/ld-elf/pr26391.fd: New file.
Diffstat (limited to 'ld/libdep_plugin.c')
-rw-r--r-- | ld/libdep_plugin.c | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/ld/libdep_plugin.c b/ld/libdep_plugin.c index 2a7fdc4..b81364f 100644 --- a/ld/libdep_plugin.c +++ b/ld/libdep_plugin.c @@ -339,27 +339,14 @@ onload (struct ld_plugin_tv *tv) while ((tv++)->tv_tag != LDPT_NULL); /* Register hooks. */ - if (!tv_register_claim_file) + if (tv_register_claim_file + && tv_register_all_symbols_read + && tv_register_cleanup) { - TV_MESSAGE (LDPL_FATAL, "No register_claim_file hook"); - fflush (NULL); - return LDPS_ERR; - } - (*tv_register_claim_file) (onclaim_file); - if (!tv_register_all_symbols_read) - { - TV_MESSAGE (LDPL_FATAL, "No register_all_symbols_read hook"); - fflush (NULL); - return LDPS_ERR; - } - (*tv_register_all_symbols_read) (onall_symbols_read); - if (!tv_register_cleanup) - { - TV_MESSAGE (LDPL_FATAL, "No register_cleanup hook"); - fflush (NULL); - return LDPS_ERR; + (*tv_register_claim_file) (onclaim_file); + (*tv_register_all_symbols_read) (onall_symbols_read); + (*tv_register_cleanup) (oncleanup); } - (*tv_register_cleanup) (oncleanup); fflush (NULL); return LDPS_OK; } |