• R
    emulate lazy relocation as deferrable relocation · 6476b813
    Rich Felker 提交于
    traditional lazy relocation with call-time plt resolver is
    intentionally not implemented, as it is a huge bug surface and demands
    significant amounts of arch-specific code and requires ongoing
    maintenance to ensure compatibility with applications which make use
    of new additions to the arch's register file in passing function
    arguments.
    
    some applications, however, depend on the ability to dlopen modules
    which have unsatisfied symbol references at the time they are loaded,
    either avoiding use of the affected interfaces or manually loading
    another module to provide the missing definition via their own module
    dependency tracking outside the ELF data structures. while such usage
    is non-conforming, failure to support it has been a significant
    obstacle for users/distributions trying to support affected software,
    particularly the X.org server.
    
    instead of resolving lazy relocations at call time, this patch saves
    unresolved GOT/PLT relocations for deferral and retries them after
    each subsequent dlopen until they are resolved. since dlopen is the
    only time at which the effective global symbol table can change, this
    behavior is not observably different from traditional lazy binding,
    and the required code is minimal.
    6476b813
dynlink.c 53.3 KB