Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/patchelf
base: 6dfc3c20a978
Choose a base ref
...
head repository: NixOS/patchelf
compare: 640a35faaa9e
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Jun 3, 2020

  1. Fix shared library corruption when rerunning patchelf

    When running patchelf on some existing patchelf'd binaries to change to longer
    RPATHS, ldd would report the binaries as invalid. The output of objdump -x on
    those libraryies should show the top of the .dynamic section is getting trashed,
    something like:
    
    0x600000001 0x0000000000429000
    0x335000 0x0000000000335000
    0xc740 0x000000000000c740
    0x1000 0x0000000000009098
    SONAME libglib-2.0.so.0
    
    (which should be RPATH and DT_NEEDED entries)
    
    This was tracked down to the code which injects the PT_LOAD section.
    
    The issue is that if the program headers were previously relocated to the end
    of the file which was how patchelf operated previously, the relocation code
    wouldn't work properly on a second run as it now assumes they're located after
    the elf header. This change forces them back to immediately follow the elf
    header which is where the code has made space for them.
    
    Should fix #170
    and #192
    
    Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
    rpurdie committed Jun 3, 2020
    Copy the full SHA
    ad5f1f0 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #202 from rpurdie/master

    Fix shared library corruption when rerunning patchelf
    domenkozar committed Jun 3, 2020
    Copy the full SHA
    640a35f View commit details
    Browse the repository at this point in the history