From 95fa2ba4fbbfac95bca6f437b2bb4389789b21eb Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Wed, 21 Apr 2021 19:19:16 -0400 Subject: [PATCH] Hide symbols that shouldn't be part of the ABI Change-Id: I1d3304cb60dddbd8cdb7ec9fdef66326564a3b7c Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- src/common/ringbuffer/ring_buffer_frontend.c | 2 ++ src/common/smp.h | 3 ++- src/lib/lttng-ust/lttng-context-ipc-ns.c | 2 +- src/lib/lttng-ust/lttng-ust-comm.c | 4 ++-- src/lib/lttng-ust/lttng-ust-statedump.c | 2 +- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/common/ringbuffer/ring_buffer_frontend.c b/src/common/ringbuffer/ring_buffer_frontend.c index d6f5365c..fa0a984b 100644 --- a/src/common/ringbuffer/ring_buffer_frontend.c +++ b/src/common/ringbuffer/ring_buffer_frontend.c @@ -78,6 +78,8 @@ /* * Non-static to ensure the compiler does not optimize away the xor. */ +uint8_t lttng_crash_magic_xor[] + __attribute__((visibility("hidden"))); uint8_t lttng_crash_magic_xor[] = RB_CRASH_DUMP_ABI_MAGIC_XOR; /* diff --git a/src/common/smp.h b/src/common/smp.h index 563fe623..5f81094f 100644 --- a/src/common/smp.h +++ b/src/common/smp.h @@ -13,7 +13,8 @@ * * If the sysconf call fails, don't populate the cache and return 0. */ -int num_possible_cpus(void); +int num_possible_cpus(void) + __attribute__((visibility("hidden"))); #define for_each_possible_cpu(cpu) \ for ((cpu) = 0; (cpu) < num_possible_cpus(); (cpu)++) diff --git a/src/lib/lttng-ust/lttng-context-ipc-ns.c b/src/lib/lttng-ust/lttng-context-ipc-ns.c index 96267ef9..f635a230 100644 --- a/src/lib/lttng-ust/lttng-context-ipc-ns.c +++ b/src/lib/lttng-ust/lttng-context-ipc-ns.c @@ -121,7 +121,7 @@ void ipc_ns_get_value(void *priv __attribute__((unused)), value->u.u64 = get_ipc_ns(); } -const struct lttng_ust_ctx_field *ctx_field = lttng_ust_static_ctx_field( +static const struct lttng_ust_ctx_field *ctx_field = lttng_ust_static_ctx_field( lttng_ust_static_event_field("ipc_ns", lttng_ust_static_type_integer(sizeof(ino_t) * CHAR_BIT, lttng_ust_rb_alignof(ino_t) * CHAR_BIT, diff --git a/src/lib/lttng-ust/lttng-ust-comm.c b/src/lib/lttng-ust/lttng-ust-comm.c index 442ca892..dc1b6e37 100644 --- a/src/lib/lttng-ust/lttng-ust-comm.c +++ b/src/lib/lttng-ust/lttng-ust-comm.c @@ -264,7 +264,7 @@ struct sock_info { }; /* Socket from app (connect) to session daemon (listen) for communication */ -struct sock_info global_apps = { +static struct sock_info global_apps = { .name = "global", .global = 1, @@ -286,7 +286,7 @@ struct sock_info global_apps = { /* TODO: allow global_apps_sock_path override */ -struct sock_info local_apps = { +static struct sock_info local_apps = { .name = "local", .global = 0, .root_handle = -1, diff --git a/src/lib/lttng-ust/lttng-ust-statedump.c b/src/lib/lttng-ust/lttng-ust-statedump.c index a663487e..fca97d3e 100644 --- a/src/lib/lttng-ust/lttng-ust-statedump.c +++ b/src/lib/lttng-ust/lttng-ust-statedump.c @@ -63,7 +63,7 @@ struct lttng_ust_dl_node { #define UST_DL_STATE_HASH_BITS 8 #define UST_DL_STATE_TABLE_SIZE (1 << UST_DL_STATE_HASH_BITS) -struct cds_hlist_head dl_state_table[UST_DL_STATE_TABLE_SIZE]; +static struct cds_hlist_head dl_state_table[UST_DL_STATE_TABLE_SIZE]; typedef void (*tracepoint_cb)(struct lttng_ust_session *session, void *priv); -- 2.34.1