mirror of
https://github.com/freebsd/freebsd-src
synced 2024-07-21 10:19:04 +00:00
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 be39466a10
)
This commit is contained in:
parent
47f21d9180
commit
98492960c3
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue