From 5a306d34e7d8b5291ea1e43fef47e9b79f91192f Mon Sep 17 00:00:00 2001 From: Kienan Stewart Date: Tue, 17 Dec 2024 14:57:30 -0500 Subject: [PATCH] liblttng-ctl: Hide mangled C++ symbols MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit A number of functions in C++ have default visibility. To avoid those symbols being erroneously available to those who load the liblttng-ctl library, a version script has been added to set the visibility of all name-mangled symbols to local. Change-Id: If2df7cfbadb0d1b9d3747cdf4990cbc942118e6f Signed-off-by: Kienan Stewart Signed-off-by: Jérémie Galarneau --- src/lib/lttng-ctl/Makefile.am | 6 ++++-- src/lib/lttng-ctl/liblttng-ctl.map | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 src/lib/lttng-ctl/liblttng-ctl.map diff --git a/src/lib/lttng-ctl/Makefile.am b/src/lib/lttng-ctl/Makefile.am index 5700a86b2..eb18ea517 100644 --- a/src/lib/lttng-ctl/Makefile.am +++ b/src/lib/lttng-ctl/Makefile.am @@ -21,11 +21,13 @@ liblttng_ctl_la_SOURCES = \ liblttng_ctl_la_LDFLAGS = \ $(LT_NO_UNDEFINED) \ - -export-symbols $(srcdir)/liblttng-ctl.sym + -export-symbols $(srcdir)/liblttng-ctl.sym \ + -Wl,--version-script=$(srcdir)/liblttng-ctl.map EXTRA_liblttng_ctl_la_DEPENDENCIES = liblttng-ctl.sym -EXTRA_DIST = liblttng-ctl.sym +EXTRA_DIST = liblttng-ctl.map \ + liblttng-ctl.sym liblttng_ctl_la_LIBADD = \ $(top_builddir)/src/common/libsessiond-comm.la \ diff --git a/src/lib/lttng-ctl/liblttng-ctl.map b/src/lib/lttng-ctl/liblttng-ctl.map new file mode 100644 index 000000000..e3038f343 --- /dev/null +++ b/src/lib/lttng-ctl/liblttng-ctl.map @@ -0,0 +1,4 @@ +{ + local: + _Z*; +}; -- 2.39.5