https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85532

            Bug ID: 85532
           Summary: crtend.o built without --enable-initfini-array has bad
                    .eh_frame
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libgcc
          Assignee: unassigned at gcc dot gnu.org
          Reporter: amodra at gmail dot com
  Target Milestone: ---

Seen on a cross from x86_64-linux to powerpc64le-linux.  If gcc is configured
without --enable-initfini-array, the tests for linker initfini support are not
run because those tests are native only. HAVE_INITFINI_ARRAY_SUPPORT is thus
zero in auto-host.h, and crtend.o has bogus .eh_frame data past the zero
terminator.  GNU ld complains about this:
  error in gcc/crtend.o(.eh_frame); no .eh_frame_hdr table will be created

The problem has been worked around on various targets by adding
-fno-asynchronous-unwind-tables to CRTSTUFF_T_CFLAGS.  See also pr31868 and
pr80037.
Building crtend.o (and crtendS.o) with -fno-asynchronous-unwind-tables is
necessary for a native --disable-initfini-array build too.

--- Comment #1 from Alan Modra <amodra at gcc dot gnu.org> ---
Author: amodra
Date: Fri Apr 27 09:06:39 2018
New Revision: 259702

URL: https://gcc.gnu.org/viewcvs?rev=259702&root=gcc&view=rev
Log:
PR85532, crtend.o built without --enable-initfini-array has bad .eh_frame

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


Modified:
    trunk/libgcc/ChangeLog
    trunk/libgcc/config/rs6000/t-crtstuff

Reply via email to