Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 Oct 2014 20:39:19 +0000 (UTC)
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r272842 - head/libexec/rtld-elf
Message-ID:  <201410092039.s99KdJDD094738@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: emaste
Date: Thu Oct  9 20:39:18 2014
New Revision: 272842
URL: https://svnweb.freebsd.org/changeset/base/272842

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.
  
  Approved by:	kan
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/libexec/rtld-elf/rtld.c

Modified: head/libexec/rtld-elf/rtld.c
==============================================================================
--- head/libexec/rtld-elf/rtld.c	Thu Oct  9 20:08:12 2014	(r272841)
+++ head/libexec/rtld-elf/rtld.c	Thu Oct  9 20:39:18 2014	(r272842)
@@ -3377,8 +3377,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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201410092039.s99KdJDD094738>