summaryrefslogtreecommitdiff
path: root/ldso/dynlink.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2018-02-02 12:15:43 -0500
committerRich Felker <dalias@aerifal.cx>2018-02-02 12:15:43 -0500
commitb3ae7beabb9f0c219bb8a8b63567a01c6530c1ac (patch)
tree53f3046e0fc492818b63c671b399c56c9e6afbd8 /ldso/dynlink.c
parent6f03b61b46d238d480f5b7730ba906e172066e59 (diff)
downloadmusl-b3ae7beabb9f0c219bb8a8b63567a01c6530c1ac.tar.gz
adjust dladdr dli_fbase definition to match other implementations
the Linux and FreeBSD man pages for dladdr document dli_fbase as the "base address" of the library/module found. normally (e.g. AT_BASE) the term "base" is used to denote the base address relative to which p_vaddr addresses are interpreted; however in the case of dladdr's Dl_info structure, existing implementations define it as the lowest address of the mapping, which makes sense in the context of determining which module's memory range the input address falls within. since this is a nonstandard interface provided to mimic one provided by other implementations, adjust it to match their behavior.
Diffstat (limited to 'ldso/dynlink.c')
-rw-r--r--ldso/dynlink.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ldso/dynlink.c b/ldso/dynlink.c
index 4b4841f9..33802400 100644
--- a/ldso/dynlink.c
+++ b/ldso/dynlink.c
@@ -1961,7 +1961,7 @@ int dladdr(const void *addr, Dl_info *info)
best = p->funcdescs + (bestsym - p->syms);
info->dli_fname = p->name;
- info->dli_fbase = p->base;
+ info->dli_fbase = p->map;
info->dli_sname = strings + bestsym->st_name;
info->dli_saddr = best;