From owner-freebsd-toolchain@freebsd.org Sat Jan 5 05:12:15 2019 Return-Path: Delivered-To: freebsd-toolchain@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9137148AD84 for ; Sat, 5 Jan 2019 05:12:15 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 40683680CF for ; Sat, 5 Jan 2019 05:12:15 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id 04850148AD83; Sat, 5 Jan 2019 05:12:15 +0000 (UTC) Delivered-To: toolchain@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3A82148AD82 for ; Sat, 5 Jan 2019 05:12:14 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.ysv.freebsd.org (mxrelay.ysv.freebsd.org [IPv6:2001:1900:2254:206a::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.ysv.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6E4AA680CB for ; Sat, 5 Jan 2019 05:12:14 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.ysv.freebsd.org (Postfix) with ESMTPS id 9B194169F4 for ; Sat, 5 Jan 2019 05:12:13 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id x055CDGb023874 for ; Sat, 5 Jan 2019 05:12:13 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id x055CD0J023873 for toolchain@FreeBSD.org; Sat, 5 Jan 2019 05:12:13 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: toolchain@FreeBSD.org Subject: [Bug 220103] devel/glib20: ld-elf.so.1: /usr/local/lib/libglib-2.0.so.0: Undefined symbol "environ" (WITH_LLD_IS_LD) Date: Sat, 05 Jan 2019 05:12:11 +0000 X-Bugzilla-Reason: AssignedTo CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: needs-qa X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: mmel@FreeBSD.org X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: Normal X-Bugzilla-Assigned-To: toolchain@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Jan 2019 05:12:16 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D220103 --- Comment #24 from Michal Meloun --- (In reply to Dimitry Andric from comment #23) I was too brief, sorry.=20 'environ' symbol is exported from /lib/crt1.o with *global* binding: # readelf -s /usr/lib/crt1.o | grep environ 46: 0000000000000008 8 OBJECT GLOBAL DEFAULT COM environ And it's referenced (not only) from /lib/libc: # readelf -s /lib/libc.so.7 | grep environ 3: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND environ For final mplayer link, following command is issued: 'ld =E2=80=A6 --version-script binary.ver /usr/lib/crt1.o =E2=80=93lc =E2= =80=A6' where linker script binary.ver is: MPLAYER_1 { # to support glibcs abhorrent backwards-compatibility hack global: _IO_stdin_used; local: *; }; This script changes binding of all (but _IO_stdin_used) symbols exported by mplayer from *global* to *local*, including =E2=80=98environ=E2=80=99 symbo= l from linked in crt1.o. Due to this, 'environ' becomes invisible to other DSO (libc..). So resulting binary is invalid, it cannot be run-time loaded and linker should report this issue. Everything above is also valid for '__progname' symbol. Actual ld.bfd (2.30, from binutils) correctly report this problem and rejec= t to build invalid binary: /usr/bin/ld: mplayer: local symbol '__progname' in /usr/lib/crt1.o is referenced by DSO But ld.lld(7.0.1) doesn't and silently produces invalid binary. The lack of error report and unloadable binary is, imho, evident ld.lld bug. I can prepare trivial testcase for this, if you want it. --=20 You are receiving this mail because: You are the assignee for the bug. You are on the CC list for the bug.=