aboutsummaryrefslogtreecommitdiff
path: root/cddl/contrib/opensolaris/lib/libdtrace
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2017-11-16 07:14:29 +0000
committerMark Johnston <markj@FreeBSD.org>2017-11-16 07:14:29 +0000
commitad1633b34b3043f9527d5af2eb833f3043bf1c2d (patch)
tree14f1ddcefe8d5991eddbf0f2882a894490c63492 /cddl/contrib/opensolaris/lib/libdtrace
parentd3d5e96893604f7de179d6073079e1919c6b6333 (diff)
downloadsrc-ad1633b34b3043f9527d5af2eb833f3043bf1c2d.tar.gz
src-ad1633b34b3043f9527d5af2eb833f3043bf1c2d.zip
Take r313504 into account when recomputing the string table length.
When we encounter a USDT probe in a weak symbol, we emit an alias for the probe function symbol. Such aliases are named differently from the aliases we emit for probes in local functions, so make sure to take that difference into account when resizing the output object file's string table. Otherwise, we underrun the string table buffer. PR: 223680
Notes
Notes: svn path=/head/; revision=325886
Diffstat (limited to 'cddl/contrib/opensolaris/lib/libdtrace')
-rw-r--r--cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c
index e5d30f0e037d..0184ec23a3ed 100644
--- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c
+++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c
@@ -1416,8 +1416,15 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *eprobesp)
"expected %s to be of type function", s));
}
- len = snprintf(NULL, 0, dt_symfmt, dt_symprefix,
- objkey, s) + 1;
+ /*
+ * Aliases of weak symbols don't get a uniquifier.
+ */
+ if (GELF_ST_BIND(fsym.st_info) == STB_WEAK)
+ len = snprintf(NULL, 0, dt_weaksymfmt,
+ dt_symprefix, s) + 1;
+ else
+ len = snprintf(NULL, 0, dt_symfmt, dt_symprefix,
+ objkey, s) + 1;
if ((p = dt_alloc(dtp, len)) == NULL) {
dt_strtab_destroy(strtab);
goto err;