[HN Gopher] Speeding up ELF relocations for store-based systems
       ___________________________________________________________________
        
       Speeding up ELF relocations for store-based systems
        
       Author : setheron
       Score  : 18 points
       Date   : 2024-05-03 21:48 UTC (2 days ago)
        
 (HTM) web link (fzakaria.com)
 (TXT) w3m dump (fzakaria.com)
        
       | kreetx wrote:
       | This article confuses static linking and deterministic builds.
       | I.e Nix, a "store-based system" (author's term), still very much
       | dynamically links. Static linking means copying actual program
       | code from libraries into the executable itself, such that
       | external .so files don't need to be loaded.
        
         | geddawm wrote:
         | I believe you're referring to:
         | 
         | > Store-based systems, however, are static in nature, with all
         | dependencies being resolved at build time.
         | 
         | I think the author is saying that the shared libraries (.so)
         | are available at build time on store-based systems and never
         | change. Thus, the dynamic linker can speed up symbol resolution
         | by doing the symbol resolution at build time and sticking the
         | result in output binary. This is distinct from static linking
         | which sticks the entire library (.a) into the output binary.
        
           | setheron wrote:
           | You clarified correctly (author)
        
             | kreetx wrote:
             | Thank you both, clearly it was _I_ who was confused!
        
       | lgg wrote:
       | Windows and macOS both use a form of two level name-spacing,
       | which does the same sort of direct binding to a target library
       | for each symbol. Retrofitting that into a binary format is pretty
       | simple, but retrofitting it into an ecosystem that depends on the
       | existing flat namespace look up semantics is not. I think it is
       | pretty clever that the author noticed the static nature of the
       | nix store allows them to statically evaluate the symbol
       | resolutions and get the launch time benefits of two level
       | namespaces.
       | 
       | I do wonder if it might make more sense to rewrite the binaries
       | to use Direct Binding[1]. That is an existing encoding of library
       | targets for symbols in ELF that has been used by Solaris for a
       | number of years.
       | 
       | 1: https://en.wikipedia.org/wiki/Direct_binding
        
       ___________________________________________________________________
       (page generated 2024-05-05 23:02 UTC)