From owner-svn-src-stable@FreeBSD.ORG Fri Nov 14 21:52:32 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D18BDE5A; Fri, 14 Nov 2014 21:52:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A318F8A6; Fri, 14 Nov 2014 21:52:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAELqWJu079034; Fri, 14 Nov 2014 21:52:32 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAELqWUN079031; Fri, 14 Nov 2014 21:52:32 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201411142152.sAELqWUN079031@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 14 Nov 2014 21:52:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r274531 - in stable/10: lib/libc/gen libexec/rtld-elf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Nov 2014 21:52:32 -0000 Author: emaste Date: Fri Nov 14 21:52:31 2014 New Revision: 274531 URL: https://svnweb.freebsd.org/changeset/base/274531 Log: Always return pathname in dl_iterate_phdr's dlpi_name, as Linux does Linux LD_ITERATE_PHDR(3): The dlpi_name field is a null-terminated string giving the pathname from which the shared object was loaded. That functionality is much more useful than returning just the short name. Update dl_iterate_phdr(3) to follow r272842 MFC of r272842 and r272848 Modified: stable/10/lib/libc/gen/dl_iterate_phdr.3 stable/10/libexec/rtld-elf/rtld.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/gen/dl_iterate_phdr.3 ============================================================================== --- stable/10/lib/libc/gen/dl_iterate_phdr.3 Fri Nov 14 21:12:28 2014 (r274530) +++ stable/10/lib/libc/gen/dl_iterate_phdr.3 Fri Nov 14 21:52:31 2014 (r274531) @@ -15,7 +15,7 @@ .\" .\" $OpenBSD: dl_iterate_phdr.3,v 1.3 2007/05/31 19:19:48 jmc Exp $ .\" $FreeBSD$ -.Dd February 15, 2012 +.Dd October 9, 2014 .Dt DL_ITERATE_PHDR 3 .Os .Sh NAME @@ -68,7 +68,7 @@ have the following meaning: The base address at which the object is mapped into the address space of the calling process. .It Fa dlpi_name -The name of the ELF object. +The pathname of the ELF object. .It Fa dlpi_phdr A pointer to the object's program headers. .It Fa dlpi_phnum Modified: stable/10/libexec/rtld-elf/rtld.c ============================================================================== --- stable/10/libexec/rtld-elf/rtld.c Fri Nov 14 21:12:28 2014 (r274530) +++ stable/10/libexec/rtld-elf/rtld.c Fri Nov 14 21:52:31 2014 (r274531) @@ -3252,8 +3252,7 @@ rtld_fill_dl_phdr_info(const Obj_Entry * { phdr_info->dlpi_addr = (Elf_Addr)obj->relocbase; - phdr_info->dlpi_name = STAILQ_FIRST(&obj->names) ? - STAILQ_FIRST(&obj->names)->name : obj->path; + phdr_info->dlpi_name = obj->path; phdr_info->dlpi_phdr = obj->phdr; phdr_info->dlpi_phnum = obj->phsize / sizeof(obj->phdr[0]); phdr_info->dlpi_tls_modid = obj->tlsindex;