From owner-svn-src-head@freebsd.org Thu May 21 19:50:19 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C5C962F318B; Thu, 21 May 2020 19:50:19 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49SgFk6ltmz4DXQ; Thu, 21 May 2020 19:50:18 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id 04LJoAmp062897 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 21 May 2020 22:50:13 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 04LJoAmp062897 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id 04LJoAVC062895; Thu, 21 May 2020 22:50:10 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 21 May 2020 22:50:10 +0300 From: Konstantin Belousov To: John Baldwin Cc: Mark Johnston , Antoine Brodin , src-committers , svn-src-all , svn-src-head@freebsd.org Subject: Re: svn commit: r361303 - in head: lib/libc/gen libexec/rtld-elf sys/sys Message-ID: <20200521195010.GJ64045@kib.kiev.ua> References: <202005202208.04KM8QPA020707@repo.freebsd.org> <20200521134152.GE64045@kib.kiev.ua> <20200521151248.GA85681@raichu> <20200521165646.GF64045@kib.kiev.ua> <25dcdfaa-fea9-98a1-c731-db37489ccc6b@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <25dcdfaa-fea9-98a1-c731-db37489ccc6b@FreeBSD.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 49SgFk6ltmz4DXQ X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2020 19:50:19 -0000 On Thu, May 21, 2020 at 12:30:47PM -0700, John Baldwin wrote: > On 5/21/20 9:56 AM, Konstantin Belousov wrote: > > On Thu, May 21, 2020 at 09:03:44AM -0700, John Baldwin wrote: > >> On 5/21/20 8:12 AM, Mark Johnston wrote: > >>> On Thu, May 21, 2020 at 04:41:52PM +0300, Konstantin Belousov wrote: > >>>> On Thu, May 21, 2020 at 03:02:07PM +0200, Antoine Brodin wrote: > >>>>> On Thu, May 21, 2020 at 12:08 AM Konstantin Belousov wrote: > >>>>>> > >>>>>> Author: kib > >>>>>> Date: Wed May 20 22:08:26 2020 > >>>>>> New Revision: 361303 > >>>>>> URL: https://svnweb.freebsd.org/changeset/base/361303 > >>>>>> > >>>>>> Log: > >>>>>> Change the samantic of struct link_map l_addr member. > >>>>>> > >>>>>> It previously returned the object map base address, while all other > >>>>>> ELF operating systems return load offset, i.e. the difference between > >>>>>> map base and the link base. > >>>>>> > >>>>>> Explain the meaning of the field in the man page. > >>>>>> > >>>>>> Stop filling the mips-only l_offs member, which is apparently unused. > >>>>>> > >>>>>> PR: 246561 > >>>>>> Requested by: Damjan Jovanovic > >>>>>> Reviewed by: emaste, jhb, cem (previous version) > >>>>>> Sponsored by: The FreeBSD Foundation > >>>>>> MFC after: 1 week > >>>>>> Differential revision: https://reviews.freebsd.org/D24918 > >>>>>> > >>>>>> Modified: > >>>>>> head/lib/libc/gen/dlinfo.3 > >>>>>> head/libexec/rtld-elf/rtld.c > >>>>>> head/sys/sys/link_elf.h > >>>>> > >>>>> Hi, > >>>>> > >>>>> After this commit, some ports fail to build with signal 11. > >>>>> For instance lang/perl5.30 fails to build with default options (DTRACE on) > >>>>> Disabling the DTRACE option makes it able to build again. > >>>>> > >>>> I see, thank you for reporting. > >>>> > >>>> So drti.c:dtrace_dof_init() does read l_addr, and the dtrace code assumes > >>>> that l_addr is the base, not relocbase. > >>>> > >>>> Mark, was dofhp_addr initialization changed comparing to Solaris ? > >>> > >>> It appears it has been the same since DTrace was imported. illumos > >>> still has similar code. > >>> > >>> Note that drti.o is linked into any executable and shlib that defines > >>> static probes, so the ABI change affects more than just dtrace(1). > >>> Would it be possible to define a new value for RTLD_DI_LINKMAP, and > >>> preserve the old behaviour for the old value? > >> > >> I think a bigger question is if Solaris/illumos treat l_addr as mapbase > >> (absolute address) or relocbase (relative address). In the discussion > >> in the phabricator I had assumed that all other OS's treated l_addr as > >> the relative offset (relocbase). Does the code for illumos assume an > >> absolute address or does it assume a relative address in l_addr? > > > > It is rather clear, since the dtrace code was pristine, that Solaris > > provides the mapbase. I do not have Solaris/Illumos box anymore > > (for quite some time), so I cannot check directly. > > > > My current PoV is that l_addr semantic must be restored, and relocbase > > provided by newly added member. > > I am fine with reverting the l_addr semantic. I'm still not sure how to > resolve the original PR, though perhaps Wine just has to carry a local > patch forever? GDB will work via the current accident so long as we > never pre-link libraries. As long as PIE binaries have a starting VA of > 0 like our shared libraries then I think GDB will be ok with our PIE > binaries as well. Wine should work without patch now, and after the D24918 is applied, too. I do not intend to revert l_addr to the 'load address' semantic. I am actually trying to find a solaris box to compile the test program.