forked from Imagelibrary/binutils-gdb
include/ChangeLog
gcc PR lto/47247 * plugin-api.h (enum ld_plugin_symbol_resolution): Add LDPR_PREVAILING_DEF_IRONLY_EXP. (enum ld_plugin_tag): Add LDPT_GET_SYMBOLS_V2. gold/ChangeLog gcc PR lto/47247 * plugin.cc (get_symbols_v2): New function. (Plugin::load): Add LDPT_GET_SYMBOLS_V2. (is_referenced_from_outside): New function. (Pluginobj::get_symbol_resolution_info): Add version parameter, return LDPR_PREVAILING_DEF_IRONLY_EXP when using new version. (get_symbols): Pass version parameter. (get_symbols_v2): New function. * plugin.h (Pluginobj::get_symbol_resolution_info): Add version parameter. * testsuite/plugin_test.c (get_symbols_v2): New static variable. (onload): Add LDPT_GET_SYMBOLS_V2. (all_symbols_read_hook): Use get_symbols_v2; check for LDPR_PREVAILING_DEF_IRONLY_EXP. * testsuite/plugin_test_3.sh: Update expected results.
This commit is contained in:
@@ -56,6 +56,7 @@ static ld_plugin_register_all_symbols_read register_all_symbols_read_hook = NULL
|
||||
static ld_plugin_register_cleanup register_cleanup_hook = NULL;
|
||||
static ld_plugin_add_symbols add_symbols = NULL;
|
||||
static ld_plugin_get_symbols get_symbols = NULL;
|
||||
static ld_plugin_get_symbols get_symbols_v2 = NULL;
|
||||
static ld_plugin_add_input_file add_input_file = NULL;
|
||||
static ld_plugin_message message = NULL;
|
||||
static ld_plugin_get_input_file get_input_file = NULL;
|
||||
@@ -120,6 +121,9 @@ onload(struct ld_plugin_tv *tv)
|
||||
case LDPT_GET_SYMBOLS:
|
||||
get_symbols = entry->tv_u.tv_get_symbols;
|
||||
break;
|
||||
case LDPT_GET_SYMBOLS_V2:
|
||||
get_symbols_v2 = entry->tv_u.tv_get_symbols;
|
||||
break;
|
||||
case LDPT_ADD_INPUT_FILE:
|
||||
add_input_file = entry->tv_u.tv_add_input_file;
|
||||
break;
|
||||
@@ -394,9 +398,9 @@ all_symbols_read_hook(void)
|
||||
|
||||
(*message)(LDPL_INFO, "all symbols read hook called");
|
||||
|
||||
if (get_symbols == NULL)
|
||||
if (get_symbols_v2 == NULL)
|
||||
{
|
||||
fprintf(stderr, "tv_get_symbols interface missing\n");
|
||||
fprintf(stderr, "tv_get_symbols (v2) interface missing\n");
|
||||
return LDPS_ERR;
|
||||
}
|
||||
|
||||
@@ -404,7 +408,7 @@ all_symbols_read_hook(void)
|
||||
claimed_file != NULL;
|
||||
claimed_file = claimed_file->next)
|
||||
{
|
||||
(*get_symbols)(claimed_file->handle, claimed_file->nsyms,
|
||||
(*get_symbols_v2)(claimed_file->handle, claimed_file->nsyms,
|
||||
claimed_file->syms);
|
||||
|
||||
for (i = 0; i < claimed_file->nsyms; ++i)
|
||||
@@ -423,6 +427,9 @@ all_symbols_read_hook(void)
|
||||
case LDPR_PREVAILING_DEF_IRONLY:
|
||||
res = "PREVAILING_DEF_IRONLY";
|
||||
break;
|
||||
case LDPR_PREVAILING_DEF_IRONLY_EXP:
|
||||
res = "PREVAILING_DEF_IRONLY_EXP";
|
||||
break;
|
||||
case LDPR_PREEMPTED_REG:
|
||||
res = "PREEMPTED_REG";
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user