From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D4E2F3858409; Fri, 21 Jul 2023 16:21:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D4E2F3858409 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1689956478; bh=aH0rgcC3CeGrMYQKv0ZEImflqx4I1T6CqY6De6J7GCA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=JBfmwf/tFvRKzQG7UJ6dVyiKS36os+1o85lRocATzwVPkzezCK08wb6JerUDq+Zw9 xrhbOhivxDsrvpL64XH8GZqkAVX8avrVoQnq6w8lXgOLukRya+y8oNdpEYEGCDGI0c rnvfzN/SqaebsxA0r4KFccjw9s8iJjFYlttguFx8= From: "aurelien at aurel32 dot net" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/110066] [RISC-V] Segment fault if compiled with -static -pg Date: Fri, 21 Jul 2023 16:21:17 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 13.1.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: aurelien at aurel32 dot net X-Bugzilla-Status: UNCONFIRMED 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 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D110066 Aurelien Jarno changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |aurelien at aurel32 dot net --- Comment #4 from Aurelien Jarno --- This is also reproducible with the tst-gmon-static test from glibc 2.38, wh= en compiled with GCC 13, while the test passes fine with GCC 12. A very basic debugging shows that the problem is triggered by using crtbegi= nT.o from GCC 13. The test passes when compiling everything with GCC 13, but usi= ng crtbeginT.o from GCC 12. The backtrace is the following: Program received signal SIGSEGV, Segmentation fault. 0x00000000000516e2 in classify_object_over_fdes () (gdb) bt #0 0x00000000000516e2 in classify_object_over_fdes () #1 0x0000000000052690 in __register_frame_info () #2 0x0000000000010570 in frame_dummy () #3 0x0000000000010872 in call_init (envp=3D0x3ffffff3e0, argv=3D0x3ffffff3= c8, argc=3D2) at libc-start.c:189 #4 __libc_start_main_impl (main=3D0x10448
, argc=3D2, argv=3D0x3ffff= ff3c8, init=3D, fini=3D, rtld_fini=3D, stack_end=3D) at libc-start.c:355 #5 0x0000000000010488 in _start () at ../sysdeps/riscv/start.S:61=