Avoid modifying the object string table when patching USDT probes.
authormarkj <markj@FreeBSD.org>
Tue, 20 Dec 2016 18:25:41 +0000 (18:25 +0000)
committermarkj <markj@FreeBSD.org>
Tue, 20 Dec 2016 18:25:41 +0000 (18:25 +0000)
commitbdbe7eaee6d095d91694b16f10fd0c3b90c0de20
treeab34ce5dbf24d4d73e786b3fa8ccc92efd6bc6d2
parentbb6e94e83de26240f0b864ce7caec08308dd2559
Avoid modifying the object string table when patching USDT probes.

dtrace converts pairs of consecutive underscores in a probe name to dashes.
When dtrace -G processes relocations corresponding to USDT probe sites, it
performs this conversion on the corresponding symbol names prior to looking
up the resulting probe names in the USDT provider definition. However, in
so doing it would actually modify the input object's string table, which
breaks the string suffix merging done by recent binutils. Because we don't
care about the symbol name once the probe site is recorded, just perform the
probe lookup using a temporary copy.

Reported by: hrs, swills
MFC after: 3 weeks
cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c