Comments (4)
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.
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.
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.
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)
- Improve testability HOT 6
- SEGFAULT with auditwheel + patchelf HOT 31
- java.lang.UnsatisfiedLinkError: dlopen failed: empty/missing DT_HASH in "libxxx.so" HOT 3
- patchelf-0.17.2 seems to corrupt emacs on `staging-next` HOT 19
- Version mismatch in 0.16.0 HOT 1
- version GLIBC_2.2.5 not defined in file libc.so.6 HOT 2
- 'GLIBC_2.34' not found HOT 1
- ELF load command address/offset not properly aligned HOT 17
- Support idempotent addition of RPATHs and NEEDEDs (i.e. remove duplicates)
- [question] How to patch the path of section headers?
- rename-dynamic-symbols.sh fails during the compilation with "span access out of range" error HOT 2
- patchelf seems to be leaving certain files corrupt HOT 1
- error building version 0.18.0 on Amazon Linux 2 HOT 6
- Using patchelf and llvm-strip in sequence corrupts ELF files HOT 1
- patchelf: cannot find section '.interp'. The input file is most likely statically linked
- Test regression in 0.18.0: repeated-updates.sh, replace-add-needed.sh HOT 5
- patchelf breaks dylibs from recent Firefox Nightly builds HOT 11
- repeated-updates.sh fails on mips64el HOT 1
- What versions support redhat6
- `patchelf --set-interpreter` and `patchelf --set-rpath` depend on the order (at least on i686-linux) HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from patchelf.