From e88c7263a3440484b3968f6abc314efd40f0c3f4 Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Tue, 2 Mar 2021 12:04:26 -0500 Subject: [PATCH] Hide private snprintf symbols The major SONAME bump to '1' gives us the opportunity to hide private symbols that should never have been visible. Change-Id: Iee731f585712c997fc92bc252ad4e4a7a4bddf3c Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- snprintf/floatio.h | 5 +++++ snprintf/fvwrite.h | 3 +++ snprintf/local.h | 18 ++++++++++++++++++ snprintf/various.h | 5 +++++ 4 files changed, 31 insertions(+) diff --git a/snprintf/floatio.h b/snprintf/floatio.h index 15081353..ad696314 100644 --- a/snprintf/floatio.h +++ b/snprintf/floatio.h @@ -10,6 +10,8 @@ * Chris Torek. */ +#include "ust-helper.h" + /* * Floating point scanf/printf (input/output) definitions. */ @@ -31,6 +33,9 @@ #error "floating point buffers too small" #endif +LTTNG_HIDDEN char *__hdtoa(double, const char *, int, int *, int *, char **); +LTTNG_HIDDEN char *__hldtoa(long double, const char *, int, int *, int *, char **); +LTTNG_HIDDEN char *__ldtoa(long double *, int, int, int *, int *, char **); diff --git a/snprintf/fvwrite.h b/snprintf/fvwrite.h index 04092aa4..a758b508 100644 --- a/snprintf/fvwrite.h +++ b/snprintf/fvwrite.h @@ -15,6 +15,8 @@ */ #include +#include "ust-helper.h" + struct __lttng_ust_siov { void *iov_base; size_t iov_len; @@ -25,4 +27,5 @@ struct __lttng_ust_suio { int uio_resid; }; +LTTNG_HIDDEN extern int __sfvwrite(LTTNG_UST_LFILE *, struct __lttng_ust_suio *); diff --git a/snprintf/local.h b/snprintf/local.h index 2df72d1a..e4af0ea2 100644 --- a/snprintf/local.h +++ b/snprintf/local.h @@ -17,27 +17,45 @@ #include #include +#include "ust-helper.h" #include "various.h" #include "wcio.h" #include "fileext.h" +LTTNG_HIDDEN int __sflush(LTTNG_UST_LFILE *); +LTTNG_HIDDEN LTTNG_UST_LFILE *__sfp(void); +LTTNG_HIDDEN int __srefill(LTTNG_UST_LFILE *); +LTTNG_HIDDEN int __sread(void *, char *, int); +LTTNG_HIDDEN int __swrite(void *, const char *, int); +LTTNG_HIDDEN fpos_t __sseek(void *, fpos_t, int); +LTTNG_HIDDEN int __sclose(void *); +LTTNG_HIDDEN void __sinit(void); +LTTNG_HIDDEN void _cleanup(void); +LTTNG_HIDDEN void __smakebuf(LTTNG_UST_LFILE *); +LTTNG_HIDDEN int __swhatbuf(LTTNG_UST_LFILE *, size_t *, int *); +LTTNG_HIDDEN int _fwalk(int (*)(LTTNG_UST_LFILE *)); +LTTNG_HIDDEN int __swsetup(LTTNG_UST_LFILE *); +LTTNG_HIDDEN int __sflags(const char *, int *); +LTTNG_HIDDEN wint_t __fgetwc_unlock(LTTNG_UST_LFILE *); +LTTNG_HIDDEN extern void __atexit_register_cleanup(void (*)(void)); +LTTNG_HIDDEN extern int __sdidinit; /* diff --git a/snprintf/various.h b/snprintf/various.h index 9b1a3014..7bf14298 100644 --- a/snprintf/various.h +++ b/snprintf/various.h @@ -16,6 +16,8 @@ #include #include +#include "ust-helper.h" + struct __lttng_ust_sbuf { unsigned char *_base; int _size; @@ -98,9 +100,12 @@ typedef struct __lttng_ust_sFILE { #define __sferror(p) (((p)->_flags & __SERR) != 0) +LTTNG_HIDDEN extern int ust_safe_fflush(LTTNG_UST_LFILE *fp); +LTTNG_HIDDEN extern int ust_safe_vfprintf(LTTNG_UST_LFILE *fp, const char *fmt0, va_list ap); +LTTNG_HIDDEN extern size_t ust_safe_mbrtowc(wchar_t *pwc, const char *s, size_t n, mbstate_t *ps); #endif /* UST_SNPRINTF_VARIOUS_H */ -- 2.34.1