summaryrefslogtreecommitdiffstats
path: root/libexec
diff options
context:
space:
mode:
authoremaste <emaste@FreeBSD.org>2014-11-14 21:52:31 +0000
committeremaste <emaste@FreeBSD.org>2014-11-14 21:52:31 +0000
commitb81b7af08d5a7e79b1cba290e2f9eeddeca21f30 (patch)
tree13005874e06791b045e978139d69f58545efa9aa /libexec
parentcc923c43ad1c7310f403fd5844557ced50917882 (diff)
downloadFreeBSD-src-b81b7af08d5a7e79b1cba290e2f9eeddeca21f30.zip
FreeBSD-src-b81b7af08d5a7e79b1cba290e2f9eeddeca21f30.tar.gz
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
Diffstat (limited to 'libexec')
-rw-r--r--libexec/rtld-elf/rtld.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c
index 06eecb7..9398209 100644
--- a/libexec/rtld-elf/rtld.c
+++ b/libexec/rtld-elf/rtld.c
@@ -3252,8 +3252,7 @@ rtld_fill_dl_phdr_info(const Obj_Entry *obj, struct dl_phdr_info *phdr_info)
{
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;
OpenPOWER on IntegriCloud