diff mbox series

PR85532, crtend.o built without --enable-initfini-array has bad .eh_frame

Message ID 20180427011914.GM18288@bubble.grove.modra.org
State New
Headers show
Series PR85532, crtend.o built without --enable-initfini-array has bad .eh_frame | expand

Commit Message

Alan Modra April 27, 2018, 1:19 a.m. UTC
This patch is aimed at removing bogus .eh_frame info emitted after the
zero terminator in crtend.o, which will cause a ld warning and slow
exception handling.  The right fix for the PR is probably to change
libgcc/Makefile.in to always supply -fno-asynchronous-unwind-tables
when building crtbegin.o and crtend.o, since the utility of such
unwind info is limited to say the least;  To what handler would you be
unwinding to?

This patch instead carries on in the tradition of pr31868 and pr80037,
and just fixes the problem for powerpc..  alpha, i386, s390, tilepro,
tilegx already disable unwind info for these files.  Bootstrapped and
regression tested powerpc64le-linux.  OK for master and gcc-8?

	PR libgcc/85532
	* config/rs6000/t-crtstuff (CRTSTUFF_T_CFLAGS): Add
	-fno-asynchronous-unwind-tables.

Comments

Segher Boessenkool April 27, 2018, 7:27 a.m. UTC | #1
Hi Alan,

On Fri, Apr 27, 2018 at 10:49:14AM +0930, Alan Modra wrote:
> This patch is aimed at removing bogus .eh_frame info emitted after the
> zero terminator in crtend.o, which will cause a ld warning and slow
> exception handling.  The right fix for the PR is probably to change
> libgcc/Makefile.in to always supply -fno-asynchronous-unwind-tables
> when building crtbegin.o and crtend.o, since the utility of such
> unwind info is limited to say the least;  To what handler would you be
> unwinding to?
> 
> This patch instead carries on in the tradition of pr31868 and pr80037,
> and just fixes the problem for powerpc..  alpha, i386, s390, tilepro,
> tilegx already disable unwind info for these files.  Bootstrapped and
> regression tested powerpc64le-linux.  OK for master and gcc-8?
> 
> 	PR libgcc/85532
> 	* config/rs6000/t-crtstuff (CRTSTUFF_T_CFLAGS): Add
> 	-fno-asynchronous-unwind-tables.

This is okay from the rs6000 perspective.  Please apply to trunk.  For
the 8 branch it is desirable too; RMs, is it okay for there?


Segher


> diff --git a/libgcc/config/rs6000/t-crtstuff b/libgcc/config/rs6000/t-crtstuff
> index 0b2601b..d5ff959 100644
> --- a/libgcc/config/rs6000/t-crtstuff
> +++ b/libgcc/config/rs6000/t-crtstuff
> @@ -3,4 +3,4 @@
>  # Do not build crtend.o with -Os as that can result in references to
>  # out-of-line register save/restore functions, which may be unresolved
>  # as crtend.o is linked after libgcc.a.  See PR45053.
> -CRTSTUFF_T_CFLAGS = -msdata=none -O2
> +CRTSTUFF_T_CFLAGS = -msdata=none -O2 -fno-asynchronous-unwind-tables
>
Jakub Jelinek April 27, 2018, 7:31 a.m. UTC | #2
On Fri, Apr 27, 2018 at 02:27:40AM -0500, Segher Boessenkool wrote:
> Hi Alan,
> 
> On Fri, Apr 27, 2018 at 10:49:14AM +0930, Alan Modra wrote:
> > This patch is aimed at removing bogus .eh_frame info emitted after the
> > zero terminator in crtend.o, which will cause a ld warning and slow
> > exception handling.  The right fix for the PR is probably to change
> > libgcc/Makefile.in to always supply -fno-asynchronous-unwind-tables
> > when building crtbegin.o and crtend.o, since the utility of such
> > unwind info is limited to say the least;  To what handler would you be
> > unwinding to?
> > 
> > This patch instead carries on in the tradition of pr31868 and pr80037,
> > and just fixes the problem for powerpc..  alpha, i386, s390, tilepro,
> > tilegx already disable unwind info for these files.  Bootstrapped and
> > regression tested powerpc64le-linux.  OK for master and gcc-8?
> > 
> > 	PR libgcc/85532
> > 	* config/rs6000/t-crtstuff (CRTSTUFF_T_CFLAGS): Add
> > 	-fno-asynchronous-unwind-tables.
> 
> This is okay from the rs6000 perspective.  Please apply to trunk.  For
> the 8 branch it is desirable too; RMs, is it okay for there?

Ok for 8.1.

Doesn't aarch64 need a similar change?

	Jakub
Alan Modra April 27, 2018, 8:16 a.m. UTC | #3
On Fri, Apr 27, 2018 at 09:31:37AM +0200, Jakub Jelinek wrote:
> On Fri, Apr 27, 2018 at 02:27:40AM -0500, Segher Boessenkool wrote:
> > Hi Alan,
> > 
> > On Fri, Apr 27, 2018 at 10:49:14AM +0930, Alan Modra wrote:
> > > This patch is aimed at removing bogus .eh_frame info emitted after the
> > > zero terminator in crtend.o, which will cause a ld warning and slow
> > > exception handling.  The right fix for the PR is probably to change
> > > libgcc/Makefile.in to always supply -fno-asynchronous-unwind-tables
> > > when building crtbegin.o and crtend.o, since the utility of such
> > > unwind info is limited to say the least;  To what handler would you be
> > > unwinding to?
> > > 
> > > This patch instead carries on in the tradition of pr31868 and pr80037,
> > > and just fixes the problem for powerpc..  alpha, i386, s390, tilepro,
> > > tilegx already disable unwind info for these files.  Bootstrapped and
> > > regression tested powerpc64le-linux.  OK for master and gcc-8?
> > > 
> > > 	PR libgcc/85532
> > > 	* config/rs6000/t-crtstuff (CRTSTUFF_T_CFLAGS): Add
> > > 	-fno-asynchronous-unwind-tables.
> > 
> > This is okay from the rs6000 perspective.  Please apply to trunk.  For
> > the 8 branch it is desirable too; RMs, is it okay for there?
> 
> Ok for 8.1.
> 
> Doesn't aarch64 need a similar change?

No.  aarch64 always uses .init_array/.fini_array, accomplished by
CTOR_LIST_BEGIN and other macros in gcc/config/aarch64/aarch64-elf.h.
diff mbox series

Patch

diff --git a/libgcc/config/rs6000/t-crtstuff b/libgcc/config/rs6000/t-crtstuff
index 0b2601b..d5ff959 100644
--- a/libgcc/config/rs6000/t-crtstuff
+++ b/libgcc/config/rs6000/t-crtstuff
@@ -3,4 +3,4 @@ 
 # Do not build crtend.o with -Os as that can result in references to
 # out-of-line register save/restore functions, which may be unresolved
 # as crtend.o is linked after libgcc.a.  See PR45053.
-CRTSTUFF_T_CFLAGS = -msdata=none -O2
+CRTSTUFF_T_CFLAGS = -msdata=none -O2 -fno-asynchronous-unwind-tables