Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd/link: reserve space for dynamic section for GOOS=nacl #22129
The Native Client sandbox has support for dynamic code generation and patching at runtime. This is done safely using the regular NaCl checks so it preserves the sandbox properties.
Address space for dynamic code is reserved with the NaCl
Currently the Go linker places the
One reason to enable this functionality would be to allow creating performant interpreters that use JIT technology.
Another reason would be the fact that NaCl might stop supporting non-dynamic-text-enabled executables in the future. The file
For people who do not wish to have access to dynamic code generation NaCl provides the
It doesn't bloat the executable because this just sets a different virtual load address for the
A downside would be that in the current NaCl implementation a process can't use that memory for anything else, and a process has only 32 (31?) bits of address space. We would probably need to size this gap to be the same as the one set by the C toolchain instead of making it too big.