File tree Expand file tree Collapse file tree 4 files changed +20
-3
lines changed Expand file tree Collapse file tree 4 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ noinst_HEADERS += src/assumptions.h
4747noinst_HEADERS += src/checkmem.h
4848noinst_HEADERS += src/testutil.h
4949noinst_HEADERS += src/util.h
50+ noinst_HEADERS += src/util_local_visibility.h
5051noinst_HEADERS += src/int128.h
5152noinst_HEADERS += src/int128_impl.h
5253noinst_HEADERS += src/int128_native.h
Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ extern "C" {
1313
1414#include "ecmult.h"
1515#include "group.h"
16+ #include "util_local_visibility.h"
17+
1618#if defined(EXHAUSTIVE_TEST_ORDER )
1719# if EXHAUSTIVE_TEST_ORDER == 7
1820# define WINDOW_G 3
@@ -27,8 +29,8 @@ static secp256k1_ge_storage secp256k1_pre_g[ECMULT_TABLE_SIZE(WINDOW_G)];
2729static secp256k1_ge_storage secp256k1_pre_g_128 [ECMULT_TABLE_SIZE (WINDOW_G )];
2830#else /* !defined(EXHAUSTIVE_TEST_ORDER) */
2931# define WINDOW_G ECMULT_WINDOW_SIZE
30- extern const secp256k1_ge_storage secp256k1_pre_g [ECMULT_TABLE_SIZE (WINDOW_G )];
31- extern const secp256k1_ge_storage secp256k1_pre_g_128 [ECMULT_TABLE_SIZE (WINDOW_G )];
32+ SECP256K1_LOCAL_VAR const secp256k1_ge_storage secp256k1_pre_g [ECMULT_TABLE_SIZE (WINDOW_G )];
33+ SECP256K1_LOCAL_VAR const secp256k1_ge_storage secp256k1_pre_g_128 [ECMULT_TABLE_SIZE (WINDOW_G )];
3234#endif /* defined(EXHAUSTIVE_TEST_ORDER) */
3335
3436#ifdef __cplusplus
Original file line number Diff line number Diff line change @@ -13,10 +13,12 @@ extern "C" {
1313
1414#include "group.h"
1515#include "ecmult_gen.h"
16+ #include "util_local_visibility.h"
17+
1618#ifdef EXHAUSTIVE_TEST_ORDER
1719static secp256k1_ge_storage secp256k1_ecmult_gen_prec_table [COMB_BLOCKS ][COMB_POINTS ];
1820#else
19- extern const secp256k1_ge_storage secp256k1_ecmult_gen_prec_table [COMB_BLOCKS ][COMB_POINTS ];
21+ SECP256K1_LOCAL_VAR const secp256k1_ge_storage secp256k1_ecmult_gen_prec_table [COMB_BLOCKS ][COMB_POINTS ];
2022#endif /* defined(EXHAUSTIVE_TEST_ORDER) */
2123
2224#ifdef __cplusplus
Original file line number Diff line number Diff line change 1+ #ifndef SECP256K1_LOCAL_VISIBILITY_H
2+ #define SECP256K1_LOCAL_VISIBILITY_H
3+
4+ /* Global variable visibility */
5+ /* See: https://github.com/bitcoin-core/secp256k1/issues/1181 */
6+ #if !defined(_WIN32 ) && defined(__GNUC__ ) && (__GNUC__ >= 4 )
7+ # define SECP256K1_LOCAL_VAR extern __attribute__ ((visibility ("hidden")))
8+ #else
9+ # define SECP256K1_LOCAL_VAR extern
10+ #endif
11+
12+ #endif /* SECP256K1_LOCAL_VISIBILITY_H */
You can’t perform that action at this time.
0 commit comments