diff options
Diffstat (limited to 'bfd/plugin.c')
-rw-r--r-- | bfd/plugin.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/bfd/plugin.c b/bfd/plugin.c index 66d286a..b798d34 100644 --- a/bfd/plugin.c +++ b/bfd/plugin.c @@ -129,6 +129,7 @@ struct plugin_list_entry { /* These must be initialized for each IR object with LTO wrapper. */ ld_plugin_claim_file_handler claim_file; + ld_plugin_claim_file_handler_v2 claim_file_v2; ld_plugin_all_symbols_read_handler all_symbols_read; ld_plugin_all_symbols_read_handler cleanup_handler; bool has_symbol_type; @@ -159,6 +160,16 @@ register_claim_file (ld_plugin_claim_file_handler handler) return LDPS_OK; } + +/* Register a claim-file handler, version 2. */ + +static enum ld_plugin_status +register_claim_file_v2 (ld_plugin_claim_file_handler_v2 handler) +{ + current_plugin->claim_file_v2 = handler; + return LDPS_OK; +} + static enum ld_plugin_status add_symbols (void * handle, int nsyms, @@ -337,7 +348,7 @@ try_load_plugin (const char *pname, bool build_list_p) { void *plugin_handle; - struct ld_plugin_tv tv[5]; + struct ld_plugin_tv tv[6]; int i; ld_plugin_onload onload; enum ld_plugin_status status; @@ -403,6 +414,10 @@ try_load_plugin (const char *pname, tv[i].tv_u.tv_register_claim_file = register_claim_file; ++i; + tv[i].tv_tag = LDPT_REGISTER_CLAIM_FILE_HOOK_V2; + tv[i].tv_u.tv_register_claim_file_v2 = register_claim_file_v2; + + ++i; tv[i].tv_tag = LDPT_ADD_SYMBOLS; tv[i].tv_u.tv_add_symbols = add_symbols; @@ -439,7 +454,7 @@ try_load_plugin (const char *pname, /* There may be plugin libraries in lib/bfd-plugins. */ static int has_plugin_list = -1; -static bfd_cleanup (*ld_plugin_object_p) (bfd *); +static bfd_cleanup (*ld_plugin_object_p) (bfd *, bool); static const char *plugin_name; @@ -463,7 +478,7 @@ bool bfd_link_plugin_object_p (bfd *abfd) { if (ld_plugin_object_p) - return ld_plugin_object_p (abfd) != NULL; + return ld_plugin_object_p (abfd, false) != NULL; return false; } @@ -480,7 +495,7 @@ bfd_plugin_target_p (const bfd_target *target) /* Register OBJECT_P to be used by bfd_plugin_object_p. */ void -register_ld_plugin_object_p (bfd_cleanup (*object_p) (bfd *)) +register_ld_plugin_object_p (bfd_cleanup (*object_p) (bfd *, bool)) { ld_plugin_object_p = object_p; } @@ -572,7 +587,7 @@ static bfd_cleanup bfd_plugin_object_p (bfd *abfd) { if (ld_plugin_object_p) - return ld_plugin_object_p (abfd); + return ld_plugin_object_p (abfd, false); if (abfd->plugin_format == bfd_plugin_unknown && !load_plugin (abfd)) return NULL; |