[Bug target/98210] [11 Regression] SHF_GNU_RETAIN breaks gold linker generated binaries

2021-02-19 Thread jozefl at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98210

Jozef Lawrynowicz  changed:

   What|Removed |Added

 Resolution|--- |WONTFIX
 Status|REOPENED|RESOLVED

--- Comment #10 from Jozef Lawrynowicz  ---
I think its best to close this as WONTFIX.

GCC will only erroneously enable SHF_GNU_RETAIN support if a Binutils version
between:
> commit 99fabbc9739a87ba3433e66792e93b773896790e
> Author: Jozef Lawrynowicz 
> Date:   Wed Nov 18 11:51:13 2020 +
>
>Support SHF_GNU_RETAIN ELF section flag

and

> commit ff4bc37d77a0ca7286883a477adcb3aa145fc782
> Author: Cary Coutant 
> Date:   Mon Dec 14 15:46:47 2020 -0800
> 
> Keep input SHF_GNU_RETAIN sections and strip output SHF_GNU_RETAIN for 
> GNU/FreBSD ELFOSABIs.

is being used. There's no Binutils release in this range.

[Bug target/98210] [11 Regression] SHF_GNU_RETAIN breaks gold linker generated binaries

2021-02-19 Thread jozefl at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98210

--- Comment #9 from Jozef Lawrynowicz  ---
I believe this PR only relates to the fact that GCC support for SHF_GNU_RETAIN
was available before GOLD supported that section flag.

My proposed patch was to turn off GCC support for SHF_GNU_RETAIN if an
unsupported GOLD is detected.

I think at this point, the GOLD functionality was only broken for such a narrow
period of time in development (not corresponding to a concrete version of
Binutils), there's no point adding a configure test to try and catch that now.

(In reply to Jakub Jelinek from comment #8)
> Isn't this problem gone with
> r11-7284-g6347f4a0904fce17eedf5c071be6f3c118680290 ?
> I mean, attribute used now means what it used to mean before, and retain
> attribute is not used in whatever is emitted into .init_array section at
> least in existing code.  Yes, one might use it in user code, but the answer
> can be don't do it then.

And yes, since none of the libraries using the "used" attribute will implicitly
create SHF_GNU_RETAIN sections any more, even if you used the Binutils version
with broken GOLD, it won't cause any problems.

[Bug target/98210] [11 Regression] SHF_GNU_RETAIN breaks gold linker generated binaries

2021-02-19 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98210

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #8 from Jakub Jelinek  ---
Isn't this problem gone with r11-7284-g6347f4a0904fce17eedf5c071be6f3c118680290
?
I mean, attribute used now means what it used to mean before, and retain
attribute is not used in whatever is emitted into .init_array section at least
in existing code.  Yes, one might use it in user code, but the answer can be
don't do it then.

[Bug target/98210] [11 Regression] SHF_GNU_RETAIN breaks gold linker generated binaries

2021-01-29 Thread segher at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98210

Segher Boessenkool  changed:

   What|Removed |Added

 CC||segher at gcc dot gnu.org

--- Comment #7 from Segher Boessenkool  ---
This also needs a backport to 10?  Can someone please fill in the
known_to_{work,fail} fields?

[Bug target/98210] [11 Regression] SHF_GNU_RETAIN breaks gold linker generated binaries

2021-01-14 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98210

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P1

[Bug target/98210] [11 Regression] SHF_GNU_RETAIN breaks gold linker generated binaries

2020-12-16 Thread jozefl at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98210

--- Comment #6 from Jozef Lawrynowicz  ---
I've posted a patch where the HAVE_GAS_SHF_GNU_RETAIN configure test has been
extended to check for SHF_GNU_RETAIN gold support:
https://gcc.gnu.org/pipermail/gcc-patches/2020-December/562100.html

[Bug target/98210] [11 Regression] SHF_GNU_RETAIN breaks gold linker generated binaries

2020-12-15 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98210

--- Comment #5 from H.J. Lu  ---
Since gold has been fixed now, you can add a check for broken gold and set
HAVE_GAS_SHF_GNU_RETAIN to 0 for broken gold.

[Bug target/98210] [11 Regression] SHF_GNU_RETAIN breaks gold linker generated binaries

2020-12-15 Thread jozefl at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98210

--- Comment #4 from Jozef Lawrynowicz  ---
Since gold is not built by default, should we just disable SHF_GNU_RETAIN
support if gold has been built at all, for Binutils versions without the gold
patch.

There's 2 weeks between the GCC "used" implying SHF_GNU_RETAIN patch and gold
being fixed, so the real fix if you want SHF_GNU_RETAIN support but are using a
Binutils version in this timeframe is to just upgrade. Meanwhile we should just
completely turn off SHF_GNU_RETAIN if GCC can spot that a broken gold is
available.

[Bug target/98210] [11 Regression] SHF_GNU_RETAIN breaks gold linker generated binaries

2020-12-09 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98210

H.J. Lu  changed:

   What|Removed |Added

 CC||jozef.l at somniumtech dot com

--- Comment #3 from H.J. Lu  ---
Jozef, SHF_GNU_RETAIN is yours.

[Bug target/98210] [11 Regression] SHF_GNU_RETAIN breaks gold linker generated binaries

2020-12-09 Thread amodra at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98210

Alan Modra  changed:

   What|Removed |Added

 Resolution|MOVED   |---
 Status|RESOLVED|REOPENED
   Last reconfirmed||2020-12-09
 Ever confirmed|0   |1

--- Comment #2 from Alan Modra  ---
When the gold patch goes in, gcc should have a configure test such that the
combination of gold being the default linker and SHF_GNU_RETAIN support should
not be allowed unless gold has the patch.  And even if gold is not the default
linker it is required for split-stack go support, so go being compiled also
ought to trigger a dependence on gold being recent enough.

[Bug target/98210] [11 Regression] SHF_GNU_RETAIN breaks gold linker generated binaries

2020-12-09 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98210

H.J. Lu  changed:

   What|Removed |Added

 Resolution|--- |MOVED
   See Also||https://sourceware.org/bugz
   ||illa/show_bug.cgi?id=27039
 Status|UNCONFIRMED |RESOLVED

--- Comment #1 from H.J. Lu  ---
Moved.

[Bug target/98210] [11 Regression] SHF_GNU_RETAIN breaks gold linker generated binaries

2020-12-09 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98210

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |11.0
Summary|SHF_GNU_RETAIN breaks gold  |[11 Regression]
   |linker generated binaries   |SHF_GNU_RETAIN breaks gold
   ||linker generated binaries