From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 533973858412; Fri, 15 Oct 2021 00:45:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 533973858412 From: "alex_y_xu at yahoo dot ca" To: glibc-bugs@sourceware.org Subject: [Bug dynamic-link/28453] New: ld.so segfaults when relocating x86 libstdc++.so compiled with -fno-plt Date: Fri, 15 Oct 2021 00:45:47 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: dynamic-link X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: alex_y_xu at yahoo dot ca X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: glibc-bugs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-bugs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Oct 2021 00:45:48 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D28453 Bug ID: 28453 Summary: ld.so segfaults when relocating x86 libstdc++.so compiled with -fno-plt Product: glibc Version: unspecified Status: UNCONFIRMED Severity: normal Priority: P2 Component: dynamic-link Assignee: unassigned at sourceware dot org Reporter: alex_y_xu at yahoo dot ca Target Milestone: --- Created attachment 13721 --> https://sourceware.org/bugzilla/attachment.cgi?id=3D13721&action=3Ded= it x86 libstdc++.so.6.0.29 -fno-plt after compiling gcc with -fno-plt, all c++ programs on x86 crash while starting. I found that this is caused by SIGSEGV due to null dereference ar= ound https://sourceware.org/git/?p=3Dglibc.git;a=3Dblob;f=3Dsysdeps/i386/dl-mach= ine.h;hb=3D9d3c9a046a2d7cfc9cad18675612e5916c65d7d7#l78. I can't recall 100% but I believe l->l_info[DT_PLTGOT] is NULL. this can be reproduced by invoking ld-linux.so.2 on the attached file. invo= king it with LD_DEBUG=3Dall results in printing "relocation processing: ./libstdc++.so.6.0.29 (lazy)", then segfaulting when accessing 0x4, whereas= the expected behavior would be printing "calling init: [library]" then segfault= ing. programs run successfully if LD_BIND_NOW=3D1 is set. normally, this issue s= hould not occur, since -fno-plt is usually paired with -Wl,-z,now. however, gcc ignores LDFLAGS for this library, causing ld to default to lazy. --=20 You are receiving this mail because: You are on the CC list for the bug.=