Commit 755da082 authored by Simon McVittie's avatar Simon McVittie

capture-libs: Ignore uninteresting symbols when comparing

Some symbols appear in the dynamic symbol table as a quirk of particular
toolchains, rather than because they are literally part of the ABI.
Ignore those for the purposes of deciding whose library is newer.
Signed-off-by: Simon McVittie's avatarSimon McVittie <smcv@collabora.com>
parent 672468f3
Pipeline #8233 passed with stage
in 8 minutes and 19 seconds
......@@ -706,6 +706,43 @@ out:
return result;
}
static const char * const ignore_symbols[] =
{
/* Libraries on at least SteamOS 2 'brewmaster' sometimes have
* symbols that appear to have an empty name. */
"",
/* These symbols can appear in libraries witout actually being part
* of anyone's ABI. List taken from dpkg-gensymbols. */
"__bss_end__",
"__bss_end",
"_bss_end__",
"__bss_start",
"__bss_start__",
"__data_start",
"__do_global_ctors_aux",
"__do_global_dtors_aux",
"__do_jv_register_classes",
"_DYNAMIC",
"_edata",
"_end",
"__end__",
"__exidx_end",
"__exidx_start",
"_fbss",
"_fdata",
"_fini",
"_ftext",
"_GLOBAL_OFFSET_TABLE_",
"__gmon_start__",
"__gnu_local_gp",
"_gp",
"_init",
"_PROCEDURE_LINKAGE_TABLE_",
"_SDA2_BASE_",
"_SDA_BASE_",
};
/*
* get_symbols:
* @elf: The object's elf of which we want to get the symbols
......@@ -895,6 +932,8 @@ get_symbols ( Elf *elf, size_t *symbols_number, int *code, char **message )
GElf_Verdaux *aux = NULL;
GElf_Verdef def_mem;
GElf_Verdef *def = NULL;
bool interesting = true;
sym = gelf_getsymshndx( sym_data, NULL, index, &sym_mem, NULL );
/* If the symbol info is not available, or undefined, we skip it */
......@@ -905,6 +944,21 @@ get_symbols ( Elf *elf, size_t *symbols_number, int *code, char **message )
if( symbol == NULL )
break;
for( size_t i = 0; i < N_ELEMENTS( ignore_symbols ); i++ )
{
if( strcmp( symbol, ignore_symbols[i] ) == 0 )
{
interesting = false;
break;
}
}
if ( !interesting )
{
DEBUG( DEBUG_ELF, "Symbol '%s' is uninteresting", symbol );
continue;
}
/* Search the version of the symbol */
if( found_versym && found_verdef )
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment