Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Dec 2022 15:41:31 GMT
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 98492960c3d9 - stable/13 - libdtrace: Change the binding of USDT probe symbols to STB_WEAK
Message-ID:  <202212191541.2BJFfVeF096766@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=98492960c3d91de4995ddbf5dc1860c8e57b5951

commit 98492960c3d91de4995ddbf5dc1860c8e57b5951
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2022-12-11 16:27:22 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2022-12-19 14:56:38 +0000

    libdtrace: Change the binding of USDT probe symbols to STB_WEAK
    
    Otherwise, if multiple object files contain references to the same
    probe, newish lld will refuse to link them by default, raising a
    duplicate global symbol definition error.  Previously, duplicate global
    symbols with identical absolute st_values were permitted by both lld and
    GNU ld.
    
    Since dtrace has no use for probe function symbols after the relocation
    performed by dtrace -G, make the symbols weak as well, following a
    suggestion from MaskRay.
    
    Reported by:    dim
    MFC after:      1 week
    Sponsored by:   The FreeBSD Foundation
    
    (cherry picked from commit be39466a1035ffb13268cd63723e976898e9b91e)
---
 cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c
index 0b3dac0224f9..927b4415409d 100644
--- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c
+++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c
@@ -1612,6 +1612,7 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *eprobesp)
 			 * invocation.
 			 */
 			if (rsym.st_shndx != SHN_ABS) {
+				rsym.st_info = GELF_ST_INFO(STB_WEAK, STT_FUNC);
 				rsym.st_shndx = SHN_ABS;
 				(void) gelf_update_sym(data_sym, ndx, &rsym);
 			}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202212191541.2BJFfVeF096766>