Ticket #12287: 0001-runtime_loader-Do-not-assume-executable-has-dynamic-.patch

File 0001-runtime_loader-Do-not-assume-executable-has-dynamic-.patch, 939 bytes (added by simonsouth, 8 years ago)

Don't assume executable has dynamic segment

  • src/system/runtime_loader/elf_symbol_lookup.h

    From dde97a1789345b5fe744b49af84baf41e0085bbf Mon Sep 17 00:00:00 2001
    From: Simon South <ssouth@simonsouth.com>
    Date: Sun, 25 Oct 2015 06:27:26 -0400
    Subject: [PATCH] runtime_loader: Do not assume executable has dynamic segment
    
    This prevents a crash when loading a statically linked executable.
    
    Fixes #12287.
    ---
     src/system/runtime_loader/elf_symbol_lookup.h | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/src/system/runtime_loader/elf_symbol_lookup.h b/src/system/runtime_loader/elf_symbol_lookup.h
    index 433c9ab..247c945 100644
    a b struct SymbolLookupInfo {  
    5858struct SymbolLookupCache {
    5959    SymbolLookupCache(image_t* image)
    6060        :
    61         fTableSize(image->symhash[1]),
     61        fTableSize(image->symhash != NULL ? image->symhash[1] : 0),
    6262        fValues(NULL),
    6363        fDSOs(NULL),
    6464        fValuesResolved(NULL)