summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Krah <skrah@bytereef.org>2012-12-22 13:18:35 (GMT)
committerStefan Krah <skrah@bytereef.org>2012-12-22 13:18:35 (GMT)
commitfdf1a34ba113a783ed4865f810adbbbde11c8635 (patch)
treeb6a93a1342c0366aa6fc95136cf547b7b1a87e59
parentfb7f580e81ed048f374cb9d624960f695ba032ba (diff)
downloadcpython-fdf1a34ba113a783ed4865f810adbbbde11c8635.zip
cpython-fdf1a34ba113a783ed4865f810adbbbde11c8635.tar.gz
cpython-fdf1a34ba113a783ed4865f810adbbbde11c8635.tar.bz2
Issue #16745: Hide symbols in _decimal.so.
-rw-r--r--Modules/_decimal/libmpdec/basearith.h7
-rw-r--r--Modules/_decimal/libmpdec/constants.h7
-rw-r--r--Modules/_decimal/libmpdec/convolute.h9
-rw-r--r--Modules/_decimal/libmpdec/crt.h7
-rw-r--r--Modules/_decimal/libmpdec/difradix2.h7
-rw-r--r--Modules/_decimal/libmpdec/fnt.h7
-rw-r--r--Modules/_decimal/libmpdec/fourstep.h7
-rw-r--r--Modules/_decimal/libmpdec/memory.h7
-rw-r--r--Modules/_decimal/libmpdec/mpdecimal.h17
-rw-r--r--Modules/_decimal/libmpdec/numbertheory.h7
-rw-r--r--Modules/_decimal/libmpdec/sixstep.h7
-rw-r--r--Modules/_decimal/libmpdec/transpose.h7
12 files changed, 95 insertions, 1 deletions
diff --git a/Modules/_decimal/libmpdec/basearith.h b/Modules/_decimal/libmpdec/basearith.h
index 5004b2c..114cef3 100644
--- a/Modules/_decimal/libmpdec/basearith.h
+++ b/Modules/_decimal/libmpdec/basearith.h
@@ -35,6 +35,10 @@
#include "typearith.h"
+/* Internal header file: all symbols have local scope in the DSO */
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_START)
+
+
mpd_uint_t _mpd_baseadd(mpd_uint_t *w, const mpd_uint_t *u, const mpd_uint_t *v,
mpd_size_t m, mpd_size_t n);
void _mpd_baseaddto(mpd_uint_t *w, const mpd_uint_t *u, mpd_size_t n);
@@ -209,6 +213,9 @@ _mpd_isallnine(const mpd_uint_t *data, mpd_ssize_t len)
}
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_END) /* restore previous scope rules */
+
+
#endif /* BASEARITH_H */
diff --git a/Modules/_decimal/libmpdec/constants.h b/Modules/_decimal/libmpdec/constants.h
index 2d63d7e..13df920 100644
--- a/Modules/_decimal/libmpdec/constants.h
+++ b/Modules/_decimal/libmpdec/constants.h
@@ -33,6 +33,10 @@
#include "mpdecimal.h"
+/* Internal header file: all symbols have local scope in the DSO */
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_START)
+
+
/* choice of optimized functions */
#if defined(CONFIG_64)
/* x64 */
@@ -77,6 +81,9 @@ extern const mpd_uint_t LH_P1P2;
extern const mpd_uint_t UH_P1P2;
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_END) /* restore previous scope rules */
+
+
#endif /* CONSTANTS_H */
diff --git a/Modules/_decimal/libmpdec/convolute.h b/Modules/_decimal/libmpdec/convolute.h
index 2f8d6d8..c35ed46 100644
--- a/Modules/_decimal/libmpdec/convolute.h
+++ b/Modules/_decimal/libmpdec/convolute.h
@@ -33,11 +33,18 @@
#include "mpdecimal.h"
#include <stdio.h>
-#define SIX_STEP_THRESHOLD 4096
+/* Internal header file: all symbols have local scope in the DSO */
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_START)
+
+
+#define SIX_STEP_THRESHOLD 4096
int fnt_convolute(mpd_uint_t *c1, mpd_uint_t *c2, mpd_size_t n, int modnum);
int fnt_autoconvolute(mpd_uint_t *c1, mpd_size_t n, int modnum);
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_END) /* restore previous scope rules */
+
+
#endif
diff --git a/Modules/_decimal/libmpdec/crt.h b/Modules/_decimal/libmpdec/crt.h
index 0e03e5d..8909232 100644
--- a/Modules/_decimal/libmpdec/crt.h
+++ b/Modules/_decimal/libmpdec/crt.h
@@ -34,7 +34,14 @@
#include <stdio.h>
+/* Internal header file: all symbols have local scope in the DSO */
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_START)
+
+
void crt3(mpd_uint_t *x1, mpd_uint_t *x2, mpd_uint_t *x3, mpd_size_t nmemb);
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_END) /* restore previous scope rules */
+
+
#endif
diff --git a/Modules/_decimal/libmpdec/difradix2.h b/Modules/_decimal/libmpdec/difradix2.h
index 759442a..81aa598 100644
--- a/Modules/_decimal/libmpdec/difradix2.h
+++ b/Modules/_decimal/libmpdec/difradix2.h
@@ -35,7 +35,14 @@
#include "numbertheory.h"
+/* Internal header file: all symbols have local scope in the DSO */
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_START)
+
+
void fnt_dif2(mpd_uint_t a[], mpd_size_t n, struct fnt_params *tparams);
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_END) /* restore previous scope rules */
+
+
#endif
diff --git a/Modules/_decimal/libmpdec/fnt.h b/Modules/_decimal/libmpdec/fnt.h
index 2d701b6..1f302cc 100644
--- a/Modules/_decimal/libmpdec/fnt.h
+++ b/Modules/_decimal/libmpdec/fnt.h
@@ -34,9 +34,16 @@
#include <stdio.h>
+/* Internal header file: all symbols have local scope in the DSO */
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_START)
+
+
int std_fnt(mpd_uint_t a[], mpd_size_t n, int modnum);
int std_inv_fnt(mpd_uint_t a[], mpd_size_t n, int modnum);
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_END) /* restore previous scope rules */
+
+
#endif
diff --git a/Modules/_decimal/libmpdec/fourstep.h b/Modules/_decimal/libmpdec/fourstep.h
index 61d9d6a..593f27d 100644
--- a/Modules/_decimal/libmpdec/fourstep.h
+++ b/Modules/_decimal/libmpdec/fourstep.h
@@ -34,8 +34,15 @@
#include <stdio.h>
+/* Internal header file: all symbols have local scope in the DSO */
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_START)
+
+
int four_step_fnt(mpd_uint_t *a, mpd_size_t n, int modnum);
int inv_four_step_fnt(mpd_uint_t *a, mpd_size_t n, int modnum);
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_END) /* restore previous scope rules */
+
+
#endif
diff --git a/Modules/_decimal/libmpdec/memory.h b/Modules/_decimal/libmpdec/memory.h
index b3a4a56..7e73c13 100644
--- a/Modules/_decimal/libmpdec/memory.h
+++ b/Modules/_decimal/libmpdec/memory.h
@@ -33,11 +33,18 @@
#include "mpdecimal.h"
+/* Internal header file: all symbols have local scope in the DSO */
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_START)
+
+
int mpd_switch_to_dyn(mpd_t *result, mpd_ssize_t size, uint32_t *status);
int mpd_switch_to_dyn_zero(mpd_t *result, mpd_ssize_t size, uint32_t *status);
int mpd_realloc_dyn(mpd_t *result, mpd_ssize_t size, uint32_t *status);
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_END) /* restore previous scope rules */
+
+
#endif
diff --git a/Modules/_decimal/libmpdec/mpdecimal.h b/Modules/_decimal/libmpdec/mpdecimal.h
index d131c71..f5affdb 100644
--- a/Modules/_decimal/libmpdec/mpdecimal.h
+++ b/Modules/_decimal/libmpdec/mpdecimal.h
@@ -67,10 +67,24 @@ extern "C" {
#else
#define UNUSED
#endif
+ #if defined(__GNUC__) && __GNUC__ >= 4 && !defined(__INTEL_COMPILER)
+ #define MPD_PRAGMA(x) _Pragma(x)
+ #define MPD_HIDE_SYMBOLS_START "GCC visibility push(hidden)"
+ #define MPD_HIDE_SYMBOLS_END "GCC visibility pop"
+ #else
+ #define MPD_PRAGMA(x)
+ #define MPD_HIDE_SYMBOLS_START
+ #define MPD_HIDE_SYMBOLS_END
+ #endif
#define EXTINLINE
#endif
+/* This header file is internal for the purpose of building _decimal.so.
+ * All symbols should have local scope in the DSO. */
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_START)
+
+
#if !defined(LEGACY_COMPILER)
#if !defined(UINT64_MAX)
/* The following #error is just a warning. If the compiler indeed does
@@ -789,6 +803,9 @@ int mpd_resize(mpd_t *result, mpd_ssize_t size, mpd_context_t *ctx);
int mpd_resize_zero(mpd_t *result, mpd_ssize_t size, mpd_context_t *ctx);
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_END) /* restore previous scope rules */
+
+
#ifdef __cplusplus
} /* END extern "C" */
#endif
diff --git a/Modules/_decimal/libmpdec/numbertheory.h b/Modules/_decimal/libmpdec/numbertheory.h
index f54d11d..1092254 100644
--- a/Modules/_decimal/libmpdec/numbertheory.h
+++ b/Modules/_decimal/libmpdec/numbertheory.h
@@ -34,6 +34,10 @@
#include "mpdecimal.h"
+/* Internal header file: all symbols have local scope in the DSO */
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_START)
+
+
/* transform parameters */
struct fnt_params {
int modnum;
@@ -66,6 +70,9 @@ std_setmodulus(int modnum, mpd_uint_t *umod)
#endif
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_END) /* restore previous scope rules */
+
+
#endif
diff --git a/Modules/_decimal/libmpdec/sixstep.h b/Modules/_decimal/libmpdec/sixstep.h
index 4d251df..0467007 100644
--- a/Modules/_decimal/libmpdec/sixstep.h
+++ b/Modules/_decimal/libmpdec/sixstep.h
@@ -34,8 +34,15 @@
#include <stdio.h>
+/* Internal header file: all symbols have local scope in the DSO */
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_START)
+
+
int six_step_fnt(mpd_uint_t *a, mpd_size_t n, int modnum);
int inv_six_step_fnt(mpd_uint_t *a, mpd_size_t n, int modnum);
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_END) /* restore previous scope rules */
+
+
#endif
diff --git a/Modules/_decimal/libmpdec/transpose.h b/Modules/_decimal/libmpdec/transpose.h
index dd0aec6..7e349ee 100644
--- a/Modules/_decimal/libmpdec/transpose.h
+++ b/Modules/_decimal/libmpdec/transpose.h
@@ -34,6 +34,10 @@
#include <stdio.h>
+/* Internal header file: all symbols have local scope in the DSO */
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_START)
+
+
enum {FORWARD_CYCLE, BACKWARD_CYCLE};
@@ -52,4 +56,7 @@ static inline void pointerswap(mpd_uint_t **a, mpd_uint_t **b)
}
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_END) /* restore previous scope rules */
+
+
#endif