You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Both GNU and LLVM linkers de facto accept `-zPARAM`, and Go sometimes
does it. Inconsistently: there are more uses of `-z PARAM` than
`-zPARAM`:
$ git grep -h -- '-Wl,-z' master | cut -b-76
re(`-Wl,-z,(no)?execstack`),
re(`-Wl,-z,relro`),
argv = append(argv, "-Wl,-z,relro")
argv = append(argv, "-Wl,-z,relro")
argv = append(argv, "-Wl,-z,nodelete")
argv = append(argv, "-Wl,-z,relro")
argv = append(argv, "-Wl,-z,relro")
argv = append(argv, "-Wl,-znow")
argv = append(argv, "-Wl,-znocopyreloc")
However, not adding a space between `-z` and the param is not
documented:
llvm-13:
$ man ld.lld-13 | grep -E -A1 -w -- "^ +-z"
-z option
Linker option extensions.
gnu ld:
$ man ld | grep -E -A1 -w -- "^ +-z"
-z keyword
The recognized keywords are:
--
-z defs
Report unresolved symbol references from regular object files. This is done even if the linker is creating a non-symbolic
--
-z muldefs
Normally when a symbol is defined multiple times, the linker will report a fatal error. These options allow multiple definitions
--
-z
--imagic
... and thus should be avoided.
`zig cc`, when used as the C compiler (`CC="zig cc" go build ...`), will
bark, because `zig cc` accepts only `-z PARAM`.
Closesziglang/zig#11669
0 commit comments