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, 26 Sep 2022 15:56:58 +0000

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

--- Comment #8 from matoro <matoro_bugzilla_glibc at matoro dot tk> ---
(In reply to Nick Clifton from comment #7)
> (In reply to matoro from comment #6)
> Hi Matoro,
> 
>  
> > Then I compared the scripts with the linker invocations that I got out of
> > pgrep and saw that they were different.  The linker is getting invoked
> > differently depending on whether the execstack warning is enabled or not.
> 
> OK - so does that mean that the bug is inside whatever is constructing the
> linker
> command line ?
> 
> You said that Gentoo is adding --enable-warn-execstack. How does it do this
> ?  Could whatever method it is using also be the source of the
> mis-constructed linker command line ?
> 
>  
> > With --enable-warn-execstack:
> 
> I might be missing something here, but I do not actually see
> --enable-warn-execstack on the command line that you listed.
> 
> > -melf64btsmip -pie -o go-sqlite3.test -s
>   
> It looks to me like the -pie option is also added here...
> 
> Cheers
>   Nick

--enable-warn-execstack is the flag you yourself added to default-enable this
feature at binutils build-time in ba951afb99912da01a6e8434126b8fac7aa75107.

To test this, I am toggling this flag on/off and rebuilding binutils.  When
it's toggled on, it always enables the warning, and -pie gets added to link
invocations from ld.  When toggled off, it defers to the target-specific rules,
which you already used to disable the warning on mips, and -pie does NOT get
added to link invocations.

As for what actually invokes the linker, I believe it is the usual gcc ->
collect2 -> ld chain.  I will check and see if these command lines are
different also.

-- 
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]