Git Product home page Git Product logo

Comments (4)

glines avatar glines commented on August 22, 2024 2

I got a tip from IRC that the Teensyduino installer happens to be a UPX archive. I was able to extract the achive with upx -d ./TeensyduinoInstall.linux64 and continue from there with the usual patchelf procedure.

Clearly the statically linked binary is extracting its contents and then calling the dynamic linker. I doubt patchelf could ever detect this situation, but it would be nice if it gave a better error message.

from patchelf.

darealshinji avatar darealshinji commented on August 22, 2024

I think using patchelf on static binaries doesn't make much sense. There's no dynamic section that could be modified ;-)

edit:
That binary is a graphical installer. Just follow its instructions and install the files into /opt or $HOME.

from patchelf.

pjones avatar pjones commented on August 22, 2024

Ah, I forgot to mention that I'm primarily interested in using the --set-interpreter feature of patchelf. That and --print-interpreter produce the same error message. From strace I gathered that this static binary has the wrong interpreter:

open("/lib64/ld-linux-x86-64.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)

I guess that means that the title of this issue might be incorrect.

from patchelf.

glines avatar glines commented on August 22, 2024

I'm having a similar problem with a completely different program: the 64 bit Linux installer for Teensyduino.

The output from file and readelf is pretty much exactly the same as above. The strace is here:

28157 execve("./TeensyduinoInstall.linux64", ["./TeensyduinoInstall.linux64"], [/* 86 vars */]) = 0
28157 mmap(0xfba5000, 257558990, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, 0, 0) = 0xfba5000
28157 readlink("/proc/self/exe", "/tmp/TeensyduinoInstall.linux64", 4096) = 31
28157 mmap(0x400000, 259674112, PROT_NONE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x400000
28157 mmap(0x400000, 763202, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x400000
28157 mprotect(0x400000, 763202, PROT_READ|PROT_EXEC) = 0
28157 mmap(0x6ba000, 256729620, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0xba000) = 0x6ba000
28157 mprotect(0x6ba000, 256729620, PROT_READ|PROT_WRITE) = 0
28157 mmap(0xfb91000, 79064, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xfb91000
28157 open("/lib64/ld-linux-x86-64.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
28157 exit(127)                         = ?
28157 +++ exited with 127 +++

Clearly it is trying to open the dynamic linker, but neither patchelf nor anything else recognizes it as a dynamically linked executable. I also tried manually running the dynamic linker on the ./Teensyduino.linux64 file but it encountered a segfault.

I suspect that what it is doing is extracting itself and subsequently attempting to start the dynamic linker. It looks like XCTU uses InstallBuilder. I'm not sure what Teensyduino uses, but it's probably something similar.

I'm going to try to trick it into working by using FhsUserEnv to trick it into finding the dynamic linker. I'll report back whether that works or not.

from patchelf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.