Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--set-interpreter gives "cannot find section" for go binary #138

Closed
andrewrk opened this issue Nov 1, 2017 · 6 comments
Closed

--set-interpreter gives "cannot find section" for go binary #138

andrewrk opened this issue Nov 1, 2017 · 6 comments

Comments

@andrewrk
Copy link
Member

andrewrk commented Nov 1, 2017

$ curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
$ patchelf --print-interpreter minikube 
/lib64/ld-linux-x86-64.so.2
$ patchelf --set-interpreter $(cc -print-file-name=ld-linux-x86-64.so.2)  minikube 
cannot find section
@andrewrk
Copy link
Member Author

andrewrk commented Nov 1, 2017

Possible duplicate of #66

@steveej
Copy link

steveej commented Dec 29, 2017

I'm hitting the same issue trying to patch browserpass v2.0.9.

MWE:

with import <nixpkgs> {};

stdenv.mkDerivation rec {
    name = "browserpass";
    version = "2.0.9";

    src = fetchzip {
      url = "https://github.com/dannyvankooten/browserpass/releases/download/${version}/${name}-linux64.zip";
      sha256 = "1nygcfjhyrcvbdmz4hjphcnmr4lm9y24lpdkdcjix6vbsjs0hipw";
      stripRoot = false;
    };

    buildPhase = '':'';

    libPath = lib.makeLibraryPath [ ];
    installPhase = ''
      set -x
      patchelf --set-interpreter ${stdenv.glibc}/lib/ld-linux-x86-64.so.2 browserpass-linux64
    '';
}

Fails with

(...)
installing
++ patchelf --set-interpreter /nix/store/g1g31ah55xdia1jdqabv1imf6mcw0nb1-glibc-2.25-49/lib/ld-linux-x86-64.so.2 browserpass-linux64
cannot find section 
(...)

@domenkozar
Copy link
Member

Have you tried patchelf master? or #127 applied?

@flokli
Copy link

flokli commented Apr 6, 2018

@domenkozar I tried patching another go binary with both patchElfUnstable and 127.patch on top and bartosh/master.
In both cases, patchelf's complaint message now looks slightly different:

patchelf: cannot find section ''

But it of course still doesn't work.

@amckague
Copy link

Building from #149 I was able to patch the go binary being downloaded as part of bazelbuild/rules_go#1376 where previously patchelf would return cannot find section ''

@domenkozar
Copy link
Member

I can't reproduce this anymore on master:

$ /nix/store/6jnjwadngladl373p0mh9z0m7cp98m6q-patchelf-0.10.1234.abcdef/bin/patchelf --set-interpreter $(cc -print-file-name=ld-linux-x86-64.so.2) minikube

$ /nix/store/6jnjwadngladl373p0mh9z0m7cp98m6q-patchelf-0.10.1234.abcdef/bin/patchelf --print-interpreter minikube 
/nix/store/6m2k8kx8h216jlx9dg3lp4m90bz05yck-glibc-2.30/lib/ld-linux-x86-64.so.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants