4 ms·
Glibc provides ld.so which can: --argv0 STRING set argv[0] to STRING before running Maybe that could be useful?
by rascul 3y ago
Glibc provides ld.so which can:
--argv0 STRING set argv[0] to STRING before running
Maybe that could be useful?
- matheusmoreira 3y agoI did not know about that possibility! It requires glibc and its dynamic linker though, doesn't seem to be as widely available as the GNU coreutils. I developed lone inside Termux: it does not have ld.so but does have env. There's a GNU binutils ld but it did not recognize the --argv0 option when I tried it.
- account42 3y agold.so is the dynamic linker. It is always used when invoking a dynamically linked program but you can invoke it manually which allows you to specify optionsfor the linker. But the name and path you need to invoke depends on the architecture and possibly distro, e.g. for amd64 these days its /lib64/ld-linux-x86-64.so.2 --argv0 argv0isalie yourprogramm ld is the (not dynamic) linker. It doesn't invoke your program at all.