File tree 4 files changed +20
-3
lines changed
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
47
47
noinst_HEADERS += src/checkmem.h
48
48
noinst_HEADERS += src/testutil.h
49
49
noinst_HEADERS += src/util.h
50
+ noinst_HEADERS += src/util_local_visibility.h
50
51
noinst_HEADERS += src/int128.h
51
52
noinst_HEADERS += src/int128_impl.h
52
53
noinst_HEADERS += src/int128_native.h
Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ extern "C" {
13
13
14
14
#include "ecmult.h"
15
15
#include "group.h"
16
+ #include "util_local_visibility.h"
17
+
16
18
#if defined(EXHAUSTIVE_TEST_ORDER )
17
19
# if EXHAUSTIVE_TEST_ORDER == 7
18
20
# define WINDOW_G 3
@@ -27,8 +29,8 @@ static secp256k1_ge_storage secp256k1_pre_g[ECMULT_TABLE_SIZE(WINDOW_G)];
27
29
static secp256k1_ge_storage secp256k1_pre_g_128 [ECMULT_TABLE_SIZE (WINDOW_G )];
28
30
#else /* !defined(EXHAUSTIVE_TEST_ORDER) */
29
31
# 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 )];
32
34
#endif /* defined(EXHAUSTIVE_TEST_ORDER) */
33
35
34
36
#ifdef __cplusplus
Original file line number Diff line number Diff line change @@ -13,10 +13,12 @@ extern "C" {
13
13
14
14
#include "group.h"
15
15
#include "ecmult_gen.h"
16
+ #include "util_local_visibility.h"
17
+
16
18
#ifdef EXHAUSTIVE_TEST_ORDER
17
19
static secp256k1_ge_storage secp256k1_ecmult_gen_prec_table [COMB_BLOCKS ][COMB_POINTS ];
18
20
#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 ];
20
22
#endif /* defined(EXHAUSTIVE_TEST_ORDER) */
21
23
22
24
#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