From owner-svn-src-head@freebsd.org Thu May 21 16:54:54 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 946E52DDB55; Thu, 21 May 2020 16:54:54 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qt1-x843.google.com (mail-qt1-x843.google.com [IPv6:2607:f8b0:4864:20::843]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49SbML3Nvfz4194; Thu, 21 May 2020 16:54:54 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qt1-x843.google.com with SMTP id a23so6054693qto.1; Thu, 21 May 2020 09:54:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=V/yhRE5cR5xjhxY4k2hyZFhOGaDfir+doKx077jMm8A=; b=uEQxjRYuSrvbIU03x4pYUAg1OxJ0zEOlwG3E4osMf95JcLqPlmyTeKm7hWKoILzwPJ PR5bJqHH5PqnUV7EdazUaJWjXA2qoXK8KoxX6zpMONhB4n1iVmeUVUGZLWdO5BCIYBjC KNBj/SQZezM+VLnoXlWUoX8hemiHOPGDIh75wWKBmOxPkVQTGHgroK68v2bZkYJqQ8lN yDVRaRb5ti3vRKn7273VQXM5JF5x5aFLhDlRjOJT3Glmmo3lYy5bO3thwsnYl+rKfmv6 aC3vJ9fMSpWa24TJjslr6TC1w57EDuL2rPz9kBFDeePO4fIRl+xZeh8qUXKYMdHhWOPV x5Eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=V/yhRE5cR5xjhxY4k2hyZFhOGaDfir+doKx077jMm8A=; b=OwNPbNGnqEFlDHyuZ/KfJZUB2Gz0bS2X+VdrBVYp8nMG6Fjy2++KKCbhQbLRIaeZbE Q8trdAR0IMZEZBnCIwBrhIrcNCPOOjvNihd7osJzdSJpUxFmbExgOC2B+45W7Rm0CUtb FlgTUZlOTnfQSXrpL104DmIf4a7fJ4Pjt+Zgo7nbyJ4jskVBhC+qnwnNWyMilWYnS483 14zRgvfwHoOYXfTzkULlVm7CiAJrx5jBbjlJPJmEl1hpu9jRZSTvr92ZHJlu++udNdEz PhwAkKM6Q+NlsvNauCQafWUxeoEZHusnYdWQVcsvVPDQZALQ/ZyyIAJhhEwAeNFfyfhj 9MdA== X-Gm-Message-State: AOAM5305IFdnvbk5ZdVOqvj0K81PqJ28hnsp7jS0qBIbMZuIlZM/9bJ8 e0YXmOz58zESFDjtIO0RgBXYtZ/v X-Google-Smtp-Source: ABdhPJw5OGU9Y86OJx+ZWOQ46C/ajZJDGxC4pDlaeWQv6hoNSrvEs9haOVxscaO9CgycjN68JDM9sA== X-Received: by 2002:aed:3fe8:: with SMTP id w37mr11200375qth.335.1590080093331; Thu, 21 May 2020 09:54:53 -0700 (PDT) Received: from raichu (toroon0560w-lp130-15-184-144-87-103.dsl.bell.ca. [184.144.87.103]) by smtp.gmail.com with ESMTPSA id g26sm5685087qtk.76.2020.05.21.09.54.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:54:52 -0700 (PDT) Sender: Mark Johnston Date: Thu, 21 May 2020 12:54:50 -0400 From: Mark Johnston To: John Baldwin Cc: Konstantin Belousov , 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: <20200521165450.GC85681@raichu> References: <202005202208.04KM8QPA020707@repo.freebsd.org> <20200521134152.GE64045@kib.kiev.ua> <20200521151248.GA85681@raichu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 49SbML3Nvfz4194 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:15169, ipnet:2607:f8b0::/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 16:54:54 -0000 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 should be an absolute address, since dtrace appears to assume that an ELF header is mapped at l_addr. Here, "addr" is the value of l_addr for the RTLD_SELF linkmap: https://github.com/joyent/illumos-joyent/blob/master/usr/src/lib/libdtrace/common/dlink_common.c#L124