From owner-svn-src-head@freebsd.org Thu May 21 19:30:49 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 ECD302F23EC; Thu, 21 May 2020 19:30:49 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49SfqF63SJz4B31; Thu, 21 May 2020 19:30:49 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-274.local (unknown [IPv6:2601:648:8203:2990:fd49:a52a:25ad:4719]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 1445C1B168; Thu, 21 May 2020 19:30:48 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r361303 - in head: lib/libc/gen libexec/rtld-elf sys/sys To: Konstantin Belousov Cc: Mark Johnston , Antoine Brodin , src-committers , svn-src-all , svn-src-head@freebsd.org References: <202005202208.04KM8QPA020707@repo.freebsd.org> <20200521134152.GE64045@kib.kiev.ua> <20200521151248.GA85681@raichu> <20200521165646.GF64045@kib.kiev.ua> From: John Baldwin Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/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TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <25dcdfaa-fea9-98a1-c731-db37489ccc6b@FreeBSD.org> Date: Thu, 21 May 2020 12:30:47 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <20200521165646.GF64045@kib.kiev.ua> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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:30:50 -0000 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. -- John Baldwin