diff options
author | emaste <emaste@FreeBSD.org> | 2014-10-09 20:39:18 +0000 |
---|---|---|
committer | emaste <emaste@FreeBSD.org> | 2014-10-09 20:39:18 +0000 |
commit | 4e4631a453a14a72ebc3d9bb1ec25f151dde3191 (patch) | |
tree | b626f9c91a4b16d96487589a2a113f099113a663 /libexec/rtld-elf | |
parent | a83188df551eec7fe57716d2b8185638bc0ba424 (diff) | |
download | FreeBSD-src-4e4631a453a14a72ebc3d9bb1ec25f151dde3191.zip FreeBSD-src-4e4631a453a14a72ebc3d9bb1ec25f151dde3191.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.
Approved by: kan
Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'libexec/rtld-elf')
-rw-r--r-- | libexec/rtld-elf/rtld.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index b1337c0..cc7afda 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -3377,8 +3377,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; |