https://sourceware.org/bugzilla/show_bug.cgi?id=29592

--- Comment #5 from Nick Clifton <nickc at redhat dot com> ---
(In reply to matoro from comment #3)
> The warning itself is correct.  In golang, CGO_ENABLED=1 (the default)
> creates a dynamic exe, while CGO_ENABLED=0 produces a static one.
> 
> However the -fPIC part is not accurate.  Golang has its own assembly
> emitter, it doesn't use gcc or any compiler for codegen.  It only uses ld
> for linking.

So possibly the golang assembler is generating the wrong relocations when
CGO_ENABLED is set to 0.  (ie it should be producing relocations suitable for
generating static executables, but instead it is generating relocations
suitable for dynamic executables).


(In reply to matoro from comment #4)
> OK, just tested, removing --enable-warn-execstack does resolve the problem. 
> But that also confirms that toggling that flag is not purely informational,
> it has an effect on the linker behavior and causes previously-working
> scenarios to stop working.

Right - we definitely need to investigate this.  Is there any chance that you
can create a small test case that reproduces the problem ?  Ideally one that
just involves the linker and does not need a Go toolchain.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Reply via email to