cat test | {whatever program}
How can I do that ?
Not at all like that; the Linux exec syscalls (and all its variants) intentionally only allow you to execute independent programs from paths or file descriptors; you need a file. And upon accessing that file, the executable bit needs to be set.
Now, on a "PC-style" Linux environment, there might be tricks like memfd (which, by the way, I haven't been able to make work for this purpose, I think that might actually also be on purpose!), but I'm pretty certain Android won't let you do that.
So, you need to learn how on Linux a process actually gets initialized and launched: you can write a loader that takes data, e.g. from stdin, puts it in a memory buffer, analyzes the loaded data, prepares a memory map, jumps into the ldloader within that buffer, let it load libraries and set up the memory mappings, before jumping to the loaded binary's startup code.
That's essentially what /lib[64]/ld-linux-{platform}.so.2 does: load an elf library and jump to its beginning; it seems the runtime linker thing you chose to use instead (linker64) it will not work with an executable ELF (which is what you have). Question here becomes whether your code itself must reside in an executable? It would seem to me you could simple compile it into a shared object instead and load that into any other process.
Implementing this honestly sounds a bit out of scope, considering the way you asked this question. I think you're really suffering from an X/Y problem: you ask about X, which is hard, complicated, and not at all done like you think it works, but what you really want to solve is something else, Y, which you forgo to ask. For example, the trivial answer here seems to be "copy over your executable to somewhere else"; I'm sure you have a reason that isn't an option, but you don't let us into what you're doing in the bigger picture, so we can't extrapolate about constraints you don't mention.
testresides on is mounted noexec, there are other ways around the problem./lib64/ld-linux-x86-64.so.2 ./test, which will execute the program even if the partition is mounted noexec. If the partition is read-only, how did the compile succeed in creating ./test?ldd /data/test. I don't know what software is in/apex/but you seem to be using the standard gcc toolkit. Did you try the command I suggested?cat testwhich means you can copy (cat test > newfile). But if you explain what the limitations are, I'm sure we can find a way to help you. It just won't be running a binary from stdin.