summaryrefslogtreecommitdiffstats
path: root/lib/libproc/proc_rtld.c
diff options
context:
space:
mode:
authormarkj <markj@FreeBSD.org>2014-05-03 04:44:03 +0000
committermarkj <markj@FreeBSD.org>2014-05-03 04:44:03 +0000
commit75ad05df26f3cecd5f725835509a6a1da7d56b77 (patch)
tree7884e396a0047dc82d52f581518423af55054191 /lib/libproc/proc_rtld.c
parent9b78ac2c57dff6f432596ec30c4f310e854ac95c (diff)
downloadFreeBSD-src-75ad05df26f3cecd5f725835509a6a1da7d56b77.zip
FreeBSD-src-75ad05df26f3cecd5f725835509a6a1da7d56b77.tar.gz
Allow "a.out" as an alias for the executable if no other matching entries
are found. This improves compatibility with Solaris' libproc and fixes a number of failing DTrace tests that rely on this feature. MFC after: 3 weeks
Diffstat (limited to 'lib/libproc/proc_rtld.c')
-rw-r--r--lib/libproc/proc_rtld.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/libproc/proc_rtld.c b/lib/libproc/proc_rtld.c
index 5259049..8dff3b7 100644
--- a/lib/libproc/proc_rtld.c
+++ b/lib/libproc/proc_rtld.c
@@ -49,6 +49,9 @@ map_iter(const rd_loadobj_t *lop, void *arg)
if (phdl->rdobjs == NULL)
return (-1);
}
+ if (strcmp(lop->rdl_path, phdl->execname) == 0 &&
+ (lop->rdl_prot & RD_RDL_X) != 0)
+ phdl->rdexec = &phdl->rdobjs[phdl->nobjs];
memcpy(&phdl->rdobjs[phdl->nobjs++], lop, sizeof(*lop));
return (0);
OpenPOWER on IntegriCloud