If you look at the generated code, you'll see that the compiler optimized away the initialization of argv
and envp
, on the assumption that your asm block is not accessing them (since you only declare that you need the pointers themselves).
Solution: add a "memory"
clobber to tell the compiler that you may read or write any memory.