Skip to content
Snippets Groups Projects
  • Vivek Das Mohapatra's avatar
    cf2738cb
    Fix initial elf class / architecture constraints selection · cf2738cb
    Vivek Das Mohapatra authored
    We used to set the elf class (32 vs 64) and machine (eg EM_X86_64)
    from the first DSO we found in the path, but that was only ever
    coincidentally corect - if we had found a foreign arch (eg i386 or
    x32 from an x86_64 binary) then our whole link chain would have
    been pulled from the wrong architacture.
    
    Instead we should pick a DSO which has _already been successfully
    loaded_ and use that to pick only matching DSOs.
    cf2738cb
    History
    Fix initial elf class / architecture constraints selection
    Vivek Das Mohapatra authored
    We used to set the elf class (32 vs 64) and machine (eg EM_X86_64)
    from the first DSO we found in the path, but that was only ever
    coincidentally corect - if we had found a foreign arch (eg i386 or
    x32 from an x86_64 binary) then our whole link chain would have
    been pulled from the wrong architacture.
    
    Instead we should pick a DSO which has _already been successfully
    loaded_ and use that to pick only matching DSOs.