From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0BA3F3855024; Thu, 12 Aug 2021 00:39:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0BA3F3855024 From: "amodra at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug libgcc/99759] morestack.S should support .init_array.0 besides .ctors.65535 Date: Thu, 12 Aug 2021 00:39:23 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libgcc X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: amodra at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc bug_status Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Aug 2021 00:39:24 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99759 Alan Modra changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |amodra at gmail dot com Status|WAITING |NEW --- Comment #2 from Alan Modra --- > this means the ctors.65535 will come last. Nope, it will come first. And since DT_INIT_ARRAY pointers are executed in= the order they appear in the array, it will be one of the first to run.=20 .init_array and .ctors sorting is complicated. ld.bfd will sort .init_arra= y.0 (highest priority .init_array section) and .ctors.65535 (highest priority .ctors section) together. I assume this comment: > The input section description is quite close but does not sort .init_arra= y.* and .ctors.* with the same priority together. is referring to lld. > I don't see any issue here really in the end because GCC will produce ini= t_array most of the time. So the issue really is that lld doesn't support mixing of .ctors.* and .init_array.*. It might be nice for libgcc to use .init_array.0 here instead of .ctors.655= 36 whenever gcc will use .init_array in compiled code.=