• Simon McVittie's avatar
    utils: Add functions to compare symbols and versions with libelf · f853179c
    Simon McVittie authored
    
    
    When two libraries have the same numeric tail we were not able to reliably
    determine which one was the newer. In particular, many distributions
    install libgcc_s.so.1 as a regular file, rather than a symlink to a
    versioned name, so library_cmp_by_name() can't work.
    
    These functions let us also check the library's version-definitions and
    the individual symbols, to make a more nuanced decision.
    
    Implementation originally by Ludovico de Nittis, adapted by Simon
    McVittie to fit the same signature as library_cmp_by_name() so that
    we can call the comparison functions via function pointers, to set up
    different comparison weights for each library if necessary. This version
    also includes Simon's changes to ignore uninteresting symbols for the
    purposes of library comparison, with a list of uninteresting symbols
    that are part of various architectures' ABIs, taken from dpkg-gensymbols.
    Co-authored-by: Ludovico de Nittis's avatarLudovico de Nittis <ludovico.denittis@collabora.com>
    Signed-off-by: Simon McVittie's avatarSimon McVittie <smcv@collabora.com>
    f853179c
library-cmp.h 1.52 KB