bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/29592] [2.39 Regression][bisected] Exec stack warning causes go


From: matoro_bugzilla_glibc at matoro dot tk
Subject: [Bug ld/29592] [2.39 Regression][bisected] Exec stack warning causes go programs with cgo to fail to link on mips
Date: Mon, 17 Oct 2022 01:08:47 +0000

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

--- Comment #11 from matoro <matoro_bugzilla_glibc at matoro dot tk> ---
(In reply to Nick Clifton from comment #9)
> (In reply to matoro from comment #8)
> 
> Sorry - what I meant was that the problem is not with the code that
> implements the execstack warning, but rather the fact that when
> CGO_ENABLED=1 is used, the GO compiler is changing its behaviour and trying
> to link a dynamic executable rather than a static one.  
> 
> As part of this change different startup files are selected, and in
> particular /usr/lib64/Scrt1.o is being linked in, rather than
> /usr/lib64/crt1.o.  This is a problem because /usr/lib64/Scrt1.o is marked
> as requiring an executable stack and so the warning is triggered.  But -
> this warning has not caused all the other linking problems.  It is the fact
> that the linker is now being asked to create a dynamic executable from
> object files that were built for static linkage that causes the problems.
> 
> So the real question is *why* does CGO_ENABLED=1 change the type of
> executable that is being created ?

Sorry I missed this question.  CGO_ENABLED will toggle between dynamic and
static executables.  By default, with CGO_ENABLED=1, go will generate dynamic
binaries.  Setting CGO_ENABLED=0 will create static binaries.

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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]