LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File otp_src_20.1-erts-symbols.patch of Package erlang (Project home:Ledest:erlang:20)

diff -Ndurp otp_src_20.1/erts/emulator/beam/erl_async.c otp_src_20.1-erts-symbols/erts/emulator/beam/erl_async.c
--- otp_src_20.1/erts/emulator/beam/erl_async.c	2017-09-22 16:21:51.000000000 +0300
+++ otp_src_20.1-erts-symbols/erts/emulator/beam/erl_async.c	2017-09-26 20:58:04.892109151 +0300
@@ -627,7 +627,7 @@ int erts_async_ready_clean(void *varq, v
 ** The port data gives a fair distribution grom port pointer
 ** to unsigned integer - to be used in key for driver_async below.
 */
-unsigned int driver_async_port_key(ErlDrvPort port)
+unsigned int __attribute__((externally_visible)) driver_async_port_key(ErlDrvPort port)
 {
     ErlDrvTermData td = driver_mk_port(port);
     if (td == (ErlDrvTermData) NIL) {
@@ -650,9 +650,8 @@ unsigned int driver_async_port_key(ErlDr
 **      async_data     data to pass to invoke function
 **      async_free     function for relase async_data in case of failure
 */
-long driver_async(ErlDrvPort ix, unsigned int* key,
-		  void (*async_invoke)(void*), void* async_data,
-		  void (*async_free)(void*))
+long __attribute__((externally_visible))
+driver_async(ErlDrvPort ix, unsigned int* key, void (*async_invoke)(void*), void* async_data, void (*async_free)(void*))
 {
     ErtsAsync* a;
     Port* prt;
diff -Ndurp otp_src_20.1/erts/emulator/beam/erl_drv_thread.c otp_src_20.1-erts-symbols/erts/emulator/beam/erl_drv_thread.c
--- otp_src_20.1/erts/emulator/beam/erl_drv_thread.c	2017-09-22 16:21:51.000000000 +0300
+++ otp_src_20.1-erts-symbols/erts/emulator/beam/erl_drv_thread.c	2017-09-26 20:58:04.892109151 +0300
@@ -156,7 +156,7 @@ void erl_drv_thr_init(void)
  * either the erl_threads.h, the erl_smp.h or the ethread.h interface.
  */
 
-ErlDrvMutex *
+ErlDrvMutex * __attribute__((externally_visible))
 erl_drv_mutex_create(char *name)
 {
 #ifdef USE_THREADS
@@ -187,7 +187,7 @@ erl_drv_mutex_create(char *name)
 #endif
 }
 
-void
+void __attribute__((externally_visible))
 erl_drv_mutex_destroy(ErlDrvMutex *dmtx)
 {
 #ifdef USE_THREADS
@@ -203,7 +203,7 @@ erl_drv_mutex_destroy(ErlDrvMutex *dmtx)
 }
 
 
-char *
+char * __attribute__((externally_visible))
 erl_drv_mutex_name(ErlDrvMutex *dmtx)
 {
 #ifdef USE_THREADS
@@ -213,7 +213,7 @@ erl_drv_mutex_name(ErlDrvMutex *dmtx)
 #endif
 }
 
-int
+int __attribute__((externally_visible))
 erl_drv_mutex_trylock(ErlDrvMutex *dmtx)
 {
 #ifdef USE_THREADS
@@ -230,7 +230,7 @@ erl_drv_mutex_trylock(ErlDrvMutex *dmtx)
 #endif
 }
 
-void
+void __attribute__((externally_visible))
 erl_drv_mutex_lock(ErlDrvMutex *dmtx)
 {
 #ifdef USE_THREADS
@@ -246,7 +246,7 @@ erl_drv_mutex_lock(ErlDrvMutex *dmtx)
 #endif
 }
 
-void
+void __attribute__((externally_visible))
 erl_drv_mutex_unlock(ErlDrvMutex *dmtx)
 {
 #ifdef USE_THREADS
@@ -259,7 +259,7 @@ erl_drv_mutex_unlock(ErlDrvMutex *dmtx)
 #endif
 }
 
-ErlDrvCond *
+ErlDrvCond * __attribute__((externally_visible))
 erl_drv_cond_create(char *name)
 {
 #ifdef USE_THREADS
@@ -286,7 +286,7 @@ erl_drv_cond_create(char *name)
 #endif
 }
 
-void
+void __attribute__((externally_visible))
 erl_drv_cond_destroy(ErlDrvCond *dcnd)
 {
 #ifdef USE_THREADS
@@ -297,7 +297,7 @@ erl_drv_cond_destroy(ErlDrvCond *dcnd)
 #endif
 }
 
-char *
+char * __attribute__((externally_visible))
 erl_drv_cond_name(ErlDrvCond *dcnd)
 {
 #ifdef USE_THREADS
@@ -307,7 +307,7 @@ erl_drv_cond_name(ErlDrvCond *dcnd)
 #endif
 }
 
-void
+void __attribute__((externally_visible))
 erl_drv_cond_signal(ErlDrvCond *dcnd)
 {
 #ifdef USE_THREADS
@@ -317,7 +317,7 @@ erl_drv_cond_signal(ErlDrvCond *dcnd)
 #endif
 }
 
-void
+void __attribute__((externally_visible))
 erl_drv_cond_broadcast(ErlDrvCond *dcnd)
 {
 #ifdef USE_THREADS
@@ -328,7 +328,7 @@ erl_drv_cond_broadcast(ErlDrvCond *dcnd)
 }
 
 
-void
+void __attribute__((externally_visible))
 erl_drv_cond_wait(ErlDrvCond *dcnd, ErlDrvMutex *dmtx)
 {
 #ifdef USE_THREADS
@@ -351,7 +351,7 @@ erl_drv_cond_wait(ErlDrvCond *dcnd, ErlD
 #endif
 }
 
-ErlDrvRWLock *
+ErlDrvRWLock * __attribute__((externally_visible))
 erl_drv_rwlock_create(char *name)
 {
 #ifdef USE_THREADS
@@ -380,7 +380,7 @@ erl_drv_rwlock_create(char *name)
 #endif
 }
 
-void
+void __attribute__((externally_visible))
 erl_drv_rwlock_destroy(ErlDrvRWLock *drwlck)
 {
 #ifdef USE_THREADS
@@ -395,7 +395,7 @@ erl_drv_rwlock_destroy(ErlDrvRWLock *drw
 #endif
 }
 
-char *
+char * __attribute__((externally_visible))
 erl_drv_rwlock_name(ErlDrvRWLock *drwlck)
 {
 #ifdef USE_THREADS
@@ -405,7 +405,7 @@ erl_drv_rwlock_name(ErlDrvRWLock *drwlck
 #endif
 }
 
-int
+int __attribute__((externally_visible))
 erl_drv_rwlock_tryrlock(ErlDrvRWLock *drwlck)
 {
 #ifdef USE_THREADS
@@ -422,7 +422,7 @@ erl_drv_rwlock_tryrlock(ErlDrvRWLock *dr
 #endif
 }
 
-void
+void __attribute__((externally_visible))
 erl_drv_rwlock_rlock(ErlDrvRWLock *drwlck)
 {
 #ifdef USE_THREADS
@@ -438,7 +438,7 @@ erl_drv_rwlock_rlock(ErlDrvRWLock *drwlc
 #endif
 }
 
-void
+void __attribute__((externally_visible))
 erl_drv_rwlock_runlock(ErlDrvRWLock *drwlck)
 {
 #ifdef USE_THREADS
@@ -451,7 +451,7 @@ erl_drv_rwlock_runlock(ErlDrvRWLock *drw
 #endif
 }
 
-int
+int __attribute__((externally_visible))
 erl_drv_rwlock_tryrwlock(ErlDrvRWLock *drwlck)
 {
 #ifdef USE_THREADS
@@ -468,7 +468,7 @@ erl_drv_rwlock_tryrwlock(ErlDrvRWLock *d
 #endif
 }
 
-void
+void __attribute__((externally_visible))
 erl_drv_rwlock_rwlock(ErlDrvRWLock *drwlck)
 {
 #ifdef USE_THREADS
@@ -484,7 +484,7 @@ erl_drv_rwlock_rwlock(ErlDrvRWLock *drwl
 #endif
 }
 
-void
+void __attribute__((externally_visible))
 erl_drv_rwlock_rwunlock(ErlDrvRWLock *drwlck)
 {
 #ifdef USE_THREADS
@@ -497,7 +497,7 @@ erl_drv_rwlock_rwunlock(ErlDrvRWLock *dr
 #endif
 }
 
-int
+int __attribute__((externally_visible))
 erl_drv_tsd_key_create(char *name, ErlDrvTSDKey *key)
 {
     char *name_copy;
@@ -569,7 +569,7 @@ erl_drv_tsd_key_create(char *name, ErlDr
     return res;
 }
 
-void
+void __attribute__((externally_visible))
 erl_drv_tsd_key_destroy(ErlDrvTSDKey key)
 {
     erts_mtx_lock(&tsd_mtx);
@@ -596,7 +596,7 @@ erl_drv_tsd_key_destroy(ErlDrvTSDKey key
 #define ERL_DRV_TSD_LEN__ (tsd_len)
 #endif
 
-void
+void __attribute__((externally_visible))
 erl_drv_tsd_set(ErlDrvTSDKey key, void *data)
 {
 #ifdef USE_THREADS
@@ -626,7 +626,7 @@ erl_drv_tsd_set(ErlDrvTSDKey key, void *
     ERL_DRV_TSD__[key] = data;
 }
 
-void *
+void * __attribute__((externally_visible))
 erl_drv_tsd_get(ErlDrvTSDKey key)
 {
 #ifdef USE_THREADS
@@ -646,7 +646,7 @@ erl_drv_tsd_get(ErlDrvTSDKey key)
 #undef ERL_DRV_TSD_LEN__
 #undef ERL_DRV_TSD__
 
-ErlDrvThreadOpts *
+ErlDrvThreadOpts * __attribute__((externally_visible))
 erl_drv_thread_opts_create(char *name)
 {
     ErlDrvThreadOpts *opts = erts_alloc_fnf(ERTS_ALC_T_DRV_THR_OPTS,
@@ -657,7 +657,7 @@ erl_drv_thread_opts_create(char *name)
     return opts;
 }
 
-void
+void __attribute__((externally_visible))
 erl_drv_thread_opts_destroy(ErlDrvThreadOpts *opts)
 {
     if (!opts)
@@ -665,7 +665,7 @@ erl_drv_thread_opts_destroy(ErlDrvThread
     erts_free(ERTS_ALC_T_DRV_THR_OPTS, opts);
 }
 
-int
+int __attribute__((externally_visible))
 erl_drv_thread_create(char *name,
 		      ErlDrvTid *tid,
 		      void* (*func)(void*),
@@ -719,7 +719,7 @@ erl_drv_thread_create(char *name,
 #endif
 }
 
-char *
+char * __attribute__((externally_visible))
 erl_drv_thread_name(ErlDrvTid tid)
 {
 #ifdef USE_THREADS
@@ -731,7 +731,7 @@ erl_drv_thread_name(ErlDrvTid tid)
 }
 
 
-ErlDrvTid
+ErlDrvTid __attribute__((externally_visible))
 erl_drv_thread_self(void)
 {
 #ifdef USE_THREADS
@@ -758,7 +758,7 @@ erl_drv_thread_self(void)
 #endif
 }
 
-int
+int __attribute__((externally_visible))
 erl_drv_equal_tids(ErlDrvTid tid1, ErlDrvTid tid2)
 {   
 #ifdef USE_THREADS
@@ -780,7 +780,7 @@ erl_drv_equal_tids(ErlDrvTid tid1, ErlDr
 #endif
 }
 
-void
+void __attribute__((externally_visible))
 erl_drv_thread_exit(void *res)
 {
 #ifdef USE_THREADS
@@ -793,7 +793,7 @@ erl_drv_thread_exit(void *res)
     fatal_error(EACCES, "erl_drv_thread_exit()");
 }
 
-int
+int __attribute__((externally_visible))
 erl_drv_thread_join(ErlDrvTid tid, void **respp)
 {
 #ifdef USE_THREADS
diff -Ndurp otp_src_20.1/erts/emulator/beam/erl_init.c otp_src_20.1-erts-symbols/erts/emulator/beam/erl_init.c
--- otp_src_20.1/erts/emulator/beam/erl_init.c	2017-09-22 16:21:51.000000000 +0300
+++ otp_src_20.1-erts-symbols/erts/emulator/beam/erl_init.c	2017-09-26 20:58:04.893109129 +0300
@@ -2494,7 +2494,7 @@ __decl_noreturn void __noreturn erts_exi
 }
 
 /* Exit without flushing async threads */
-__decl_noreturn void __noreturn erts_exit(int n, char *fmt, ...)
+__decl_noreturn void __attribute__((externally_visible)) __noreturn erts_exit(int n, char *fmt, ...)
 {
     va_list args1, args2;
     va_start(args1, fmt);
diff -Ndurp otp_src_20.1/erts/emulator/beam/erl_nif.c otp_src_20.1-erts-symbols/erts/emulator/beam/erl_nif.c
--- otp_src_20.1/erts/emulator/beam/erl_nif.c	2017-09-22 16:21:51.000000000 +0300
+++ otp_src_20.1-erts-symbols/erts/emulator/beam/erl_nif.c	2017-09-26 20:58:04.895109086 +0300
@@ -452,22 +452,22 @@ static void cache_env(ErlNifEnv* env)
 	env->hp_end = env->heap_frag->mem + env->heap_frag->alloc_size;
     }
 }
-void* enif_priv_data(ErlNifEnv* env)
+void* __attribute__((externally_visible)) enif_priv_data(ErlNifEnv* env)
 {
     return env->mod_nif->priv_data;
 }
 
-void* enif_alloc(size_t size)
+void* __attribute__((externally_visible)) enif_alloc(size_t size)
 {
     return erts_alloc_fnf(ERTS_ALC_T_NIF, (Uint) size);
 }
 
-void* enif_realloc(void* ptr, size_t size)
+void* __attribute__((externally_visible)) enif_realloc(void* ptr, size_t size)
 {
     return erts_realloc_fnf(ERTS_ALC_T_NIF, ptr, size);
 }
 
-void enif_free(void* ptr)
+void __attribute__((externally_visible)) enif_free(void* ptr)
 {
     erts_free(ERTS_ALC_T_NIF, ptr);
 }
@@ -510,14 +510,14 @@ setup_nif_env(struct enif_msg_environmen
 #endif
 }
 
-ErlNifEnv* enif_alloc_env(void)
+ErlNifEnv* __attribute__((externally_visible)) enif_alloc_env(void)
 {
     struct enif_msg_environment_t* msg_env =
 	erts_alloc_fnf(ERTS_ALC_T_NIF, sizeof(struct enif_msg_environment_t));
     setup_nif_env(msg_env, NULL, NULL);
     return &msg_env->env;
 }
-void enif_free_env(ErlNifEnv* env)
+void __attribute__((externally_visible)) enif_free_env(ErlNifEnv* env)
 {
     enif_clear_env(env);
     erts_free(ERTS_ALC_T_NIF, env);
@@ -543,7 +543,7 @@ static ERTS_INLINE void clear_offheap(Er
     oh->overhead = 0;
 }
 
-void enif_clear_env(ErlNifEnv* env)
+void __attribute__((externally_visible)) enif_clear_env(ErlNifEnv* env)
 {
     struct enif_msg_environment_t* menv = (struct enif_msg_environment_t*)env;
     Process* p = &menv->phony_proc;
@@ -654,8 +654,8 @@ error:
 
 #endif
 
-int enif_send(ErlNifEnv* env, const ErlNifPid* to_pid,
-	      ErlNifEnv* msg_env, ERL_NIF_TERM msg)
+int __attribute__((externally_visible))
+enif_send(ErlNifEnv* env, const ErlNifPid* to_pid, ErlNifEnv* msg_env, ERL_NIF_TERM msg)
 {
     struct enif_msg_environment_t* menv = (struct enif_msg_environment_t*)msg_env;
     ErtsProcLocks rp_locks = 0;
@@ -838,7 +838,7 @@ done:
     return 1;
 }
 
-int
+int __attribute__((externally_visible))
 enif_port_command(ErlNifEnv *env, const ErlNifPort* to_port,
                   ErlNifEnv *msg_env, ERL_NIF_TERM msg)
 {
@@ -942,7 +942,7 @@ int enif_whereis_port(ErlNifEnv *env, ER
     return enif_get_local_port(env, res, port);
 }
 
-ERL_NIF_TERM enif_make_copy(ErlNifEnv* dst_env, ERL_NIF_TERM src_term)
+ERL_NIF_TERM __attribute__((externally_visible)) enif_make_copy(ErlNifEnv* dst_env, ERL_NIF_TERM src_term)
 {
     Uint sz;
     Eterm* hp;
@@ -963,7 +963,7 @@ static int is_offheap(const ErlOffHeap*
 }
 #endif
 
-ErlNifPid* enif_self(ErlNifEnv* caller_env, ErlNifPid* pid)
+ErlNifPid* __attribute__((externally_visible)) enif_self(ErlNifEnv* caller_env, ErlNifPid* pid)
 {
     if (caller_env->proc->common.id == ERTS_INVALID_PID)
         return NULL;
@@ -971,7 +971,7 @@ ErlNifPid* enif_self(ErlNifEnv* caller_e
     return pid;
 }
 
-int enif_get_local_pid(ErlNifEnv* env, ERL_NIF_TERM term, ErlNifPid* pid)
+int __attribute__((externally_visible)) enif_get_local_pid(ErlNifEnv* env, ERL_NIF_TERM term, ErlNifPid* pid)
 {
     if (is_internal_pid(term)) {
         pid->pid=term;
@@ -980,7 +980,7 @@ int enif_get_local_pid(ErlNifEnv* env, E
     return 0;
 }
 
-int enif_get_local_port(ErlNifEnv* env, ERL_NIF_TERM term, ErlNifPort* port)
+int __attribute__((externally_visible)) enif_get_local_port(ErlNifEnv* env, ERL_NIF_TERM term, ErlNifPort* port)
 {
     if (is_internal_port(term)) {
         port->port_id=term;
@@ -989,57 +989,57 @@ int enif_get_local_port(ErlNifEnv* env,
     return 0;
 }
 
-int enif_is_atom(ErlNifEnv* env, ERL_NIF_TERM term)
+int __attribute__((externally_visible)) enif_is_atom(ErlNifEnv* env, ERL_NIF_TERM term)
 {
     return is_atom(term);
 }
 
-int enif_is_binary(ErlNifEnv* env, ERL_NIF_TERM term)
+int __attribute__((externally_visible)) enif_is_binary(ErlNifEnv* env, ERL_NIF_TERM term)
 {
     return is_binary(term) && (binary_bitsize(term) % 8 == 0);
 }
 
-int enif_is_empty_list(ErlNifEnv* env, ERL_NIF_TERM term)
+int __attribute__((externally_visible)) enif_is_empty_list(ErlNifEnv* env, ERL_NIF_TERM term)
 {
     return is_nil(term);
 }
 
-int enif_is_fun(ErlNifEnv* env, ERL_NIF_TERM term)
+int __attribute__((externally_visible)) enif_is_fun(ErlNifEnv* env, ERL_NIF_TERM term)
 {
     return is_fun(term);
 }
 
-int enif_is_pid(ErlNifEnv* env, ERL_NIF_TERM term)
+int __attribute__((externally_visible)) enif_is_pid(ErlNifEnv* env, ERL_NIF_TERM term)
 {
     return is_pid(term);
 }
 
-int enif_is_port(ErlNifEnv* env, ERL_NIF_TERM term)
+int __attribute__((externally_visible)) enif_is_port(ErlNifEnv* env, ERL_NIF_TERM term)
 {
     return is_port(term);
 }
 
-int enif_is_ref(ErlNifEnv* env, ERL_NIF_TERM term)
+int __attribute__((externally_visible)) enif_is_ref(ErlNifEnv* env, ERL_NIF_TERM term)
 {
     return is_ref(term);
 }
 
-int enif_is_tuple(ErlNifEnv* env, ERL_NIF_TERM term)
+int __attribute__((externally_visible)) enif_is_tuple(ErlNifEnv* env, ERL_NIF_TERM term)
 {
     return is_tuple(term);
 }
 
-int enif_is_list(ErlNifEnv* env, ERL_NIF_TERM term)
+int __attribute__((externally_visible)) enif_is_list(ErlNifEnv* env, ERL_NIF_TERM term)
 {
     return is_list(term) || is_nil(term);
 }
 
-int enif_is_exception(ErlNifEnv* env, ERL_NIF_TERM term)
+int __attribute__((externally_visible)) enif_is_exception(ErlNifEnv* env, ERL_NIF_TERM term)
 {
     return env->exception_thrown && term == THE_NON_VALUE;
 }
 
-int enif_is_number(ErlNifEnv* env, ERL_NIF_TERM term)
+int __attribute__((externally_visible)) enif_is_number(ErlNifEnv* env, ERL_NIF_TERM term)
 {
     return is_number(term);
 }
@@ -1054,7 +1054,7 @@ static void aligned_binary_dtor(struct e
     erts_free_aligned_binary_bytes_extra((byte*)obj, obj->allocator);
 }
 
-int enif_inspect_binary(ErlNifEnv* env, Eterm bin_term, ErlNifBinary* bin)
+int __attribute__((externally_visible)) enif_inspect_binary(ErlNifEnv* env, Eterm bin_term, ErlNifBinary* bin)
 {
     ErtsAlcType_t allocator = is_proc_bound(env) ? ERTS_ALC_T_TMP : ERTS_ALC_T_NIF;
     union {
@@ -1095,7 +1095,7 @@ static void tmp_alloc_dtor(struct enif_t
     erts_free(obj->allocator,  obj);
 }
 
-int enif_inspect_iolist_as_binary(ErlNifEnv* env, Eterm term, ErlNifBinary* bin)
+int __attribute__((externally_visible)) enif_inspect_iolist_as_binary(ErlNifEnv* env, Eterm term, ErlNifBinary* bin)
 {
     struct enif_tmp_obj_t* tobj;
     ErtsAlcType_t allocator;
@@ -1130,7 +1130,7 @@ int enif_inspect_iolist_as_binary(ErlNif
     return 1;
 }
 
-int enif_alloc_binary(size_t size, ErlNifBinary* bin)
+int __attribute__((externally_visible)) enif_alloc_binary(size_t size, ErlNifBinary* bin)
 {
     Binary* refbin;
 
@@ -1146,7 +1146,7 @@ int enif_alloc_binary(size_t size, ErlNi
     return 1;
 }
 
-int enif_realloc_binary(ErlNifBinary* bin, size_t size)
+int __attribute__((externally_visible)) enif_realloc_binary(ErlNifBinary* bin, size_t size)
 {
     if (bin->ref_bin != NULL) {
 	Binary* oldbin;
@@ -1171,7 +1171,7 @@ int enif_realloc_binary(ErlNifBinary* bi
 }
 
 
-void enif_release_binary(ErlNifBinary* bin)
+void __attribute__((externally_visible)) enif_release_binary(ErlNifBinary* bin)
 {
     if (bin->ref_bin != NULL) {
 	Binary* refbin = bin->ref_bin;
@@ -1185,8 +1185,8 @@ void enif_release_binary(ErlNifBinary* b
 #endif
 }
 
-unsigned char* enif_make_new_binary(ErlNifEnv* env, size_t size,
-				    ERL_NIF_TERM* termp)
+unsigned char* __attribute__((externally_visible))
+enif_make_new_binary(ErlNifEnv* env, size_t size, ERL_NIF_TERM* termp)
 {
     flush_env(env);
     *termp = new_binary(env->proc, NULL, size);
@@ -1194,8 +1194,8 @@ unsigned char* enif_make_new_binary(ErlN
     return binary_bytes(*termp);
 }
 
-int enif_term_to_binary(ErlNifEnv *dst_env, ERL_NIF_TERM term,
-                        ErlNifBinary *bin)
+int __attribute__((externally_visible))
+enif_term_to_binary(ErlNifEnv *dst_env, ERL_NIF_TERM term, ErlNifBinary *bin)
 {
     Sint size;
     byte *bp;
@@ -1219,11 +1219,8 @@ int enif_term_to_binary(ErlNifEnv *dst_e
     return 1;
 }
 
-size_t enif_binary_to_term(ErlNifEnv *dst_env,
-                           const unsigned char* data,
-                           size_t data_sz,
-                           ERL_NIF_TERM *term,
-                           ErlNifBinaryToTerm opts)
+size_t __attribute__((externally_visible))
+enif_binary_to_term(ErlNifEnv *dst_env, const unsigned char* data, size_t data_sz, ERL_NIF_TERM *term, ErlNifBinaryToTerm opts)
 {
     Sint size;
     ErtsHeapFactory factory;
@@ -1256,12 +1253,12 @@ size_t enif_binary_to_term(ErlNifEnv *ds
     return bp - data;
 }
 
-int enif_is_identical(Eterm lhs, Eterm rhs)
+int __attribute__((externally_visible)) enif_is_identical(Eterm lhs, Eterm rhs)
 {
     return EQ(lhs,rhs);
 }
 
-int enif_compare(Eterm lhs, Eterm rhs)
+int __attribute__((externally_visible)) enif_compare(Eterm lhs, Eterm rhs)
 {
     Sint result = CMP(lhs,rhs);
 
@@ -1290,7 +1287,7 @@ ErlNifUInt64 enif_hash(ErlNifHash type,
     }
 }
 
-int enif_get_tuple(ErlNifEnv* env, Eterm tpl, int* arity, const Eterm** array)
+int __attribute__((externally_visible)) enif_get_tuple(ErlNifEnv* env, Eterm tpl, int* arity, const Eterm** array)
 {
     Eterm* ptr;
     if (is_not_tuple(tpl)) {
@@ -1302,8 +1299,8 @@ int enif_get_tuple(ErlNifEnv* env, Eterm
     return 1;
 }
 
-int enif_get_string(ErlNifEnv *env, ERL_NIF_TERM list, char* buf, unsigned len,
-		    ErlNifCharEncoding encoding)
+int __attribute__((externally_visible))
+enif_get_string(ErlNifEnv *env, ERL_NIF_TERM list, char* buf, unsigned len, ErlNifCharEncoding encoding)
 {
     Eterm* listptr;
     int n = 0;
@@ -1334,7 +1331,7 @@ int enif_get_string(ErlNifEnv *env, ERL_
     return n + 1;
 }
 
-Eterm enif_make_binary(ErlNifEnv* env, ErlNifBinary* bin)
+Eterm __attribute__((externally_visible)) enif_make_binary(ErlNifEnv* env, ErlNifBinary* bin)
 {
     if (bin->bin_term != THE_NON_VALUE) {
 	return bin->bin_term;
@@ -1371,8 +1368,8 @@ Eterm enif_make_binary(ErlNifEnv* env, E
     }
 }
 
-Eterm enif_make_sub_binary(ErlNifEnv* env, ERL_NIF_TERM bin_term,
-			   size_t pos, size_t size)
+Eterm __attribute__((externally_visible))
+enif_make_sub_binary(ErlNifEnv* env, ERL_NIF_TERM bin_term, size_t pos, size_t size)
 {
     ErlSubBin* sb;
     Eterm orig;
@@ -1399,27 +1396,27 @@ Eterm enif_make_sub_binary(ErlNifEnv* en
 }
 
 
-Eterm enif_make_badarg(ErlNifEnv* env)
+Eterm __attribute__((externally_visible)) enif_make_badarg(ErlNifEnv* env)
 {
     return enif_raise_exception(env, am_badarg);
 }
 
-Eterm enif_raise_exception(ErlNifEnv* env, ERL_NIF_TERM reason)
+Eterm __attribute__((externally_visible)) enif_raise_exception(ErlNifEnv* env, ERL_NIF_TERM reason)
 {
     env->exception_thrown = 1;
     env->proc->fvalue = reason;
     BIF_ERROR(env->proc, EXC_ERROR);
 }
 
-int enif_has_pending_exception(ErlNifEnv* env, ERL_NIF_TERM* reason)
+int __attribute__((externally_visible)) enif_has_pending_exception(ErlNifEnv* env, ERL_NIF_TERM* reason)
 {
     if (env->exception_thrown && reason != NULL)
 	*reason = env->proc->fvalue;
     return env->exception_thrown;
 }
 
-int enif_get_atom(ErlNifEnv* env, Eterm atom, char* buf, unsigned len,
-		  ErlNifCharEncoding encoding)
+int __attribute__((externally_visible))
+enif_get_atom(ErlNifEnv* env, Eterm atom, char* buf, unsigned len, ErlNifCharEncoding encoding)
 {
     Atom* ap;
     ASSERT(encoding == ERL_NIF_LATIN1);
@@ -1442,7 +1439,7 @@ int enif_get_atom(ErlNifEnv* env, Eterm
     return ap->latin1_chars + 1;
 }
 
-int enif_get_int(ErlNifEnv* env, Eterm term, int* ip)
+int __attribute__((externally_visible)) enif_get_int(ErlNifEnv* env, Eterm term, int* ip)
 {
 #if SIZEOF_INT ==  ERTS_SIZEOF_ETERM
     return term_to_Sint(term, (Sint*)ip);
@@ -1459,7 +1456,7 @@ int enif_get_int(ErlNifEnv* env, Eterm t
 #endif     
 }
 
-int enif_get_uint(ErlNifEnv* env, Eterm term, unsigned* ip)
+int __attribute__((externally_visible)) enif_get_uint(ErlNifEnv* env, Eterm term, unsigned* ip)
 {
 #if SIZEOF_INT == ERTS_SIZEOF_ETERM
     return term_to_Uint(term, (Uint*)ip);
@@ -1474,7 +1471,7 @@ int enif_get_uint(ErlNifEnv* env, Eterm
 #endif     
 }
 
-int enif_get_long(ErlNifEnv* env, Eterm term, long* ip)
+int __attribute__((externally_visible)) enif_get_long(ErlNifEnv* env, Eterm term, long* ip)
 {
 #if SIZEOF_LONG == ERTS_SIZEOF_ETERM
     return term_to_Sint(term, ip);
@@ -1492,7 +1489,7 @@ int enif_get_long(ErlNifEnv* env, Eterm
 #endif     
 }
 
-int enif_get_ulong(ErlNifEnv* env, Eterm term, unsigned long* ip)
+int __attribute__((externally_visible)) enif_get_ulong(ErlNifEnv* env, Eterm term, unsigned long* ip)
 {
 #if SIZEOF_LONG == ERTS_SIZEOF_ETERM
     return term_to_Uint(term, ip);
@@ -1512,18 +1509,18 @@ int enif_get_ulong(ErlNifEnv* env, Eterm
 }
 
 #if HAVE_INT64 && SIZEOF_LONG != 8
-int enif_get_int64(ErlNifEnv* env, ERL_NIF_TERM term, ErlNifSInt64* ip)
+int __attribute__((externally_visible)) enif_get_int64(ErlNifEnv* env, ERL_NIF_TERM term, ErlNifSInt64* ip)
 {
     return term_to_Sint64(term, ip);
 }
 
-int enif_get_uint64(ErlNifEnv* env, ERL_NIF_TERM term, ErlNifUInt64* ip)
+int __attribute__((externally_visible)) enif_get_uint64(ErlNifEnv* env, ERL_NIF_TERM term, ErlNifUInt64* ip)
 {
     return term_to_Uint64(term, ip);
 }
 #endif /* HAVE_INT64 && SIZEOF_LONG != 8 */
 
-int enif_get_double(ErlNifEnv* env, ERL_NIF_TERM term, double* dp)
+int __attribute__((externally_visible)) enif_get_double(ErlNifEnv* env, ERL_NIF_TERM term, double* dp)
 {
     FloatDef f;
     if (is_not_float(term)) {
@@ -1534,8 +1531,8 @@ int enif_get_double(ErlNifEnv* env, ERL_
     return 1;
 }
 
-int enif_get_atom_length(ErlNifEnv* env, Eterm atom, unsigned* len,
-			 ErlNifCharEncoding enc)
+int __attribute__((externally_visible))
+enif_get_atom_length(ErlNifEnv* env, Eterm atom, unsigned* len, ErlNifCharEncoding enc)
 {
     Atom* ap;
     ASSERT(enc == ERL_NIF_LATIN1);
@@ -1548,7 +1545,7 @@ int enif_get_atom_length(ErlNifEnv* env,
     return 1;
 }
 
-int enif_get_list_cell(ErlNifEnv* env, Eterm term, Eterm* head, Eterm* tail)
+int __attribute__((externally_visible)) enif_get_list_cell(ErlNifEnv* env, Eterm term, Eterm* head, Eterm* tail)
 {
     Eterm* val;
     if (is_not_list(term)) return 0;
@@ -1558,7 +1555,7 @@ int enif_get_list_cell(ErlNifEnv* env, E
     return 1;
 }
 
-int enif_get_list_length(ErlNifEnv* env, Eterm term, unsigned* len)
+int __attribute__((externally_visible)) enif_get_list_length(ErlNifEnv* env, Eterm term, unsigned* len)
 {
     Sint i;
     Uint u;
@@ -1570,7 +1567,7 @@ int enif_get_list_length(ErlNifEnv* env,
     return 1;
 }
 
-ERL_NIF_TERM enif_make_int(ErlNifEnv* env, int i)
+ERL_NIF_TERM __attribute__((externally_visible)) enif_make_int(ErlNifEnv* env, int i)
 {
 #if SIZEOF_INT == ERTS_SIZEOF_ETERM
     return IS_SSMALL(i) ? make_small(i) : small_to_big(i,alloc_heap(env,2));
@@ -1580,7 +1577,7 @@ ERL_NIF_TERM enif_make_int(ErlNifEnv* en
 #endif
 }
 
-ERL_NIF_TERM enif_make_uint(ErlNifEnv* env, unsigned i)
+ERL_NIF_TERM __attribute__((externally_visible)) enif_make_uint(ErlNifEnv* env, unsigned i)
 {
 #if SIZEOF_INT == ERTS_SIZEOF_ETERM
     return IS_USMALL(0,i) ? make_small(i) : uint_to_big(i,alloc_heap(env,2));
@@ -1590,7 +1587,7 @@ ERL_NIF_TERM enif_make_uint(ErlNifEnv* e
 #endif
 }
 
-ERL_NIF_TERM enif_make_long(ErlNifEnv* env, long i)
+ERL_NIF_TERM __attribute__((externally_visible))enif_make_long(ErlNifEnv* env, long i)
 {
     if (IS_SSMALL(i)) {
 	return make_small(i);
@@ -1605,7 +1602,7 @@ ERL_NIF_TERM enif_make_long(ErlNifEnv* e
 #endif
 }
 
-ERL_NIF_TERM enif_make_ulong(ErlNifEnv* env, unsigned long i)
+ERL_NIF_TERM __attribute__((externally_visible)) enif_make_ulong(ErlNifEnv* env, unsigned long i)
 {
     if (IS_USMALL(0,i)) {
 	return make_small(i);
@@ -1621,7 +1618,7 @@ ERL_NIF_TERM enif_make_ulong(ErlNifEnv*
 }
 
 #if HAVE_INT64 && SIZEOF_LONG != 8
-ERL_NIF_TERM enif_make_int64(ErlNifEnv* env, ErlNifSInt64 i)
+ERL_NIF_TERM __attribute__((externally_visible)) enif_make_int64(ErlNifEnv* env, ErlNifSInt64 i)
 {
     Uint* hp;
     Uint need = 0;
@@ -1630,7 +1627,7 @@ ERL_NIF_TERM enif_make_int64(ErlNifEnv*
     return erts_bld_sint64(&hp, NULL, i);
 }
 
-ERL_NIF_TERM enif_make_uint64(ErlNifEnv* env, ErlNifUInt64 i)
+ERL_NIF_TERM __attribute__((externally_visible)) enif_make_uint64(ErlNifEnv* env, ErlNifUInt64 i)
 {
     Uint* hp;
     Uint need = 0;
@@ -1640,7 +1637,7 @@ ERL_NIF_TERM enif_make_uint64(ErlNifEnv*
 }
 #endif /* HAVE_INT64 && SIZEOF_LONG != 8 */
 
-ERL_NIF_TERM enif_make_double(ErlNifEnv* env, double d)
+ERL_NIF_TERM __attribute__((externally_visible)) enif_make_double(ErlNifEnv* env, double d)
 {
     Eterm* hp;
     FloatDef f;
@@ -1653,26 +1650,26 @@ ERL_NIF_TERM enif_make_double(ErlNifEnv*
     return make_float(hp);
 }
 
-ERL_NIF_TERM enif_make_atom(ErlNifEnv* env, const char* name)
+ERL_NIF_TERM __attribute__((externally_visible)) enif_make_atom(ErlNifEnv* env, const char* name)
 {
     return enif_make_atom_len(env, name, sys_strlen(name));
 }
 
-ERL_NIF_TERM enif_make_atom_len(ErlNifEnv* env, const char* name, size_t len)
+ERL_NIF_TERM __attribute__((externally_visible)) enif_make_atom_len(ErlNifEnv* env, const char* name, size_t len)
 {
     if (len > MAX_ATOM_CHARACTERS)
         return enif_make_badarg(env);
     return erts_atom_put((byte*)name, len, ERTS_ATOM_ENC_LATIN1, 1);
 }
 
-int enif_make_existing_atom(ErlNifEnv* env, const char* name, ERL_NIF_TERM* atom,
-			    ErlNifCharEncoding enc)
+int __attribute__((externally_visible))
+enif_make_existing_atom(ErlNifEnv* env, const char* name, ERL_NIF_TERM* atom, ErlNifCharEncoding enc)
 {
     return enif_make_existing_atom_len(env, name, sys_strlen(name), atom, enc);
 }
 
-int enif_make_existing_atom_len(ErlNifEnv* env, const char* name, size_t len,
-				ERL_NIF_TERM* atom, ErlNifCharEncoding encoding)
+int __attribute__((externally_visible))
+enif_make_existing_atom_len(ErlNifEnv* env, const char* name, size_t len, ERL_NIF_TERM* atom, ErlNifCharEncoding encoding)
 {
     ASSERT(encoding == ERL_NIF_LATIN1);
     if (len > MAX_ATOM_CHARACTERS)
@@ -1680,7 +1677,7 @@ int enif_make_existing_atom_len(ErlNifEn
     return erts_atom_get(name, len, atom, ERTS_ATOM_ENC_LATIN1);
 }
 
-ERL_NIF_TERM enif_make_tuple(ErlNifEnv* env, unsigned cnt, ...)
+ERL_NIF_TERM __attribute__((externally_visible)) enif_make_tuple(ErlNifEnv* env, unsigned cnt, ...)
 {
 #ifdef ERTS_NIF_ASSERT_IN_ENV
     int nr = 0;
@@ -1700,7 +1697,8 @@ ERL_NIF_TERM enif_make_tuple(ErlNifEnv*
     return ret;
 }
 
-ERL_NIF_TERM enif_make_tuple_from_array(ErlNifEnv* env, const ERL_NIF_TERM arr[], unsigned cnt)
+ERL_NIF_TERM __attribute__((externally_visible))
+enif_make_tuple_from_array(ErlNifEnv* env, const ERL_NIF_TERM arr[], unsigned cnt)
 {
 #ifdef ERTS_NIF_ASSERT_IN_ENV
     int nr = 0;
@@ -1717,7 +1715,7 @@ ERL_NIF_TERM enif_make_tuple_from_array(
     return ret;
 }
 
-ERL_NIF_TERM enif_make_list_cell(ErlNifEnv* env, Eterm car, Eterm cdr)
+ERL_NIF_TERM __attribute__((externally_visible)) enif_make_list_cell(ErlNifEnv* env, Eterm car, Eterm cdr)
 {
     Eterm* hp = alloc_heap(env,2);
     Eterm ret = make_list(hp);
@@ -1729,7 +1727,7 @@ ERL_NIF_TERM enif_make_list_cell(ErlNifE
     return ret;
 }
 
-ERL_NIF_TERM enif_make_list(ErlNifEnv* env, unsigned cnt, ...)
+ERL_NIF_TERM __attribute__((externally_visible)) enif_make_list(ErlNifEnv* env, unsigned cnt, ...)
 {
     if (cnt == 0) {
 	return NIL;
@@ -1758,7 +1756,8 @@ ERL_NIF_TERM enif_make_list(ErlNifEnv* e
     }
 }
 
-ERL_NIF_TERM enif_make_list_from_array(ErlNifEnv* env, const ERL_NIF_TERM arr[], unsigned cnt)
+ERL_NIF_TERM __attribute__((externally_visible))
+enif_make_list_from_array(ErlNifEnv* env, const ERL_NIF_TERM arr[], unsigned cnt)
 {
 #ifdef ERTS_NIF_ASSERT_IN_ENV
     int nr = 0;
@@ -1780,32 +1779,32 @@ ERL_NIF_TERM enif_make_list_from_array(E
     return ret;
 }
 
-ERL_NIF_TERM enif_make_string(ErlNifEnv* env, const char* string,
-			      ErlNifCharEncoding encoding)
+ERL_NIF_TERM __attribute__((externally_visible))
+enif_make_string(ErlNifEnv* env, const char* string, ErlNifCharEncoding encoding)
 {
     return enif_make_string_len(env, string, sys_strlen(string), encoding);
 }
 
-ERL_NIF_TERM enif_make_string_len(ErlNifEnv* env, const char* string,
-				  size_t len, ErlNifCharEncoding encoding)
+ERL_NIF_TERM __attribute__((externally_visible))
+enif_make_string_len(ErlNifEnv* env, const char* string, size_t len, ErlNifCharEncoding encoding)
 {
     Eterm* hp = alloc_heap(env,len*2);
     ASSERT(encoding == ERL_NIF_LATIN1);
     return erts_bld_string_n(&hp,NULL,string,len);
 }
 
-ERL_NIF_TERM enif_make_ref(ErlNifEnv* env)
+ERL_NIF_TERM __attribute__((externally_visible)) enif_make_ref(ErlNifEnv* env)
 {
     Eterm* hp = alloc_heap(env, ERTS_REF_THING_SIZE);
     return erts_make_ref_in_buffer(hp);
 }
 
-void enif_system_info(ErlNifSysInfo *sip, size_t si_size)
+void __attribute__((externally_visible)) enif_system_info(ErlNifSysInfo *sip, size_t si_size)
 {
     driver_system_info(sip, si_size);
 }
 
-int enif_make_reverse_list(ErlNifEnv* env, ERL_NIF_TERM term, ERL_NIF_TERM *list)
+int __attribute__((externally_visible)) enif_make_reverse_list(ErlNifEnv* env, ERL_NIF_TERM term, ERL_NIF_TERM *list)
 {
     Eterm *listptr, ret, *hp;
 
@@ -1824,7 +1823,7 @@ int enif_make_reverse_list(ErlNifEnv* en
     return 1;
 }
 
-int enif_is_current_process_alive(ErlNifEnv* env)
+int __attribute__((externally_visible)) enif_is_current_process_alive(ErlNifEnv* env)
 {
     Process *c_p;
     int scheduler;
@@ -1843,7 +1842,7 @@ int enif_is_current_process_alive(ErlNif
     return !ERTS_PROC_IS_EXITING(c_p);
 }
 
-int enif_is_process_alive(ErlNifEnv* env, ErlNifPid *proc)
+int __attribute__((externally_visible)) enif_is_process_alive(ErlNifEnv* env, ErlNifPid *proc)
 {
     int scheduler;
 
@@ -1867,7 +1866,7 @@ int enif_is_process_alive(ErlNifEnv* env
     }
 }
 
-int enif_is_port_alive(ErlNifEnv *env, ErlNifPort *port)
+int __attribute__((externally_visible)) enif_is_port_alive(ErlNifEnv *env, ErlNifPort *port)
 {
     int scheduler;
     Uint32 iflags = (erts_port_synchronous_ops
@@ -1893,7 +1892,7 @@ int enif_is_port_alive(ErlNifEnv *env, E
     }
 }
 
-ERL_NIF_TERM
+ERL_NIF_TERM __attribute__((externally_visible))
 enif_now_time(ErlNifEnv *env)
 {
     Uint mega, sec, micro;
@@ -1903,7 +1902,7 @@ enif_now_time(ErlNifEnv *env)
     return TUPLE3(hp, make_small(mega), make_small(sec), make_small(micro));
 }
 
-ERL_NIF_TERM
+ERL_NIF_TERM __attribute__((externally_visible))
 enif_cpu_time(ErlNifEnv *env)
 {
 #ifdef HAVE_ERTS_NOW_CPU
@@ -1917,7 +1916,7 @@ enif_cpu_time(ErlNifEnv *env)
 #endif
 }
 
-ERL_NIF_TERM
+ERL_NIF_TERM __attribute__((externally_visible))
 enif_make_unique_integer(ErlNifEnv *env, ErlNifUniqueInteger properties)
 {
     int monotonic = properties & ERL_NIF_UNIQUE_MONOTONIC;
@@ -1939,51 +1938,51 @@ enif_make_unique_integer(ErlNifEnv *env,
     }
 }
 
-ErlNifMutex* enif_mutex_create(char *name) { return erl_drv_mutex_create(name); }
-void enif_mutex_destroy(ErlNifMutex *mtx) {  erl_drv_mutex_destroy(mtx); }
-int enif_mutex_trylock(ErlNifMutex *mtx) { return erl_drv_mutex_trylock(mtx); }
-void enif_mutex_lock(ErlNifMutex *mtx) { erl_drv_mutex_lock(mtx); }
-void enif_mutex_unlock(ErlNifMutex *mtx) { erl_drv_mutex_unlock(mtx); }
-ErlNifCond* enif_cond_create(char *name) { return erl_drv_cond_create(name); }
-void enif_cond_destroy(ErlNifCond *cnd) { erl_drv_cond_destroy(cnd); }
-void enif_cond_signal(ErlNifCond *cnd) { erl_drv_cond_signal(cnd); }
-void enif_cond_broadcast(ErlNifCond *cnd) { erl_drv_cond_broadcast(cnd); }
-void enif_cond_wait(ErlNifCond *cnd, ErlNifMutex *mtx) { erl_drv_cond_wait(cnd,mtx); }
-ErlNifRWLock* enif_rwlock_create(char *name) { return erl_drv_rwlock_create(name); }
-void enif_rwlock_destroy(ErlNifRWLock *rwlck) { erl_drv_rwlock_destroy(rwlck); }
-int enif_rwlock_tryrlock(ErlNifRWLock *rwlck) { return erl_drv_rwlock_tryrlock(rwlck); }
-void enif_rwlock_rlock(ErlNifRWLock *rwlck) { erl_drv_rwlock_rlock(rwlck); }
-void enif_rwlock_runlock(ErlNifRWLock *rwlck) { erl_drv_rwlock_runlock(rwlck); }
-int enif_rwlock_tryrwlock(ErlNifRWLock *rwlck) { return erl_drv_rwlock_tryrwlock(rwlck); }
-void enif_rwlock_rwlock(ErlNifRWLock *rwlck) { erl_drv_rwlock_rwlock(rwlck); }
-void enif_rwlock_rwunlock(ErlNifRWLock *rwlck) { erl_drv_rwlock_rwunlock(rwlck); }
-int enif_tsd_key_create(char *name, ErlNifTSDKey *key) { return erl_drv_tsd_key_create(name,key); }
-void enif_tsd_key_destroy(ErlNifTSDKey key) { erl_drv_tsd_key_destroy(key); }
-void enif_tsd_set(ErlNifTSDKey key, void *data) { erl_drv_tsd_set(key,data); }
-void* enif_tsd_get(ErlNifTSDKey key) { return erl_drv_tsd_get(key); }
-ErlNifThreadOpts* enif_thread_opts_create(char *name) { return (ErlNifThreadOpts*) erl_drv_thread_opts_create(name); }
-void enif_thread_opts_destroy(ErlNifThreadOpts *opts) { erl_drv_thread_opts_destroy((ErlDrvThreadOpts*)opts); }
-int enif_thread_create(char *name, ErlNifTid *tid, void* (*func)(void *),
-		       void *args, ErlNifThreadOpts *opts) {
+ErlNifMutex* __attribute__((externally_visible)) enif_mutex_create(char *name) { return erl_drv_mutex_create(name); }
+void __attribute__((externally_visible)) enif_mutex_destroy(ErlNifMutex *mtx) {  erl_drv_mutex_destroy(mtx); }
+int __attribute__((externally_visible)) enif_mutex_trylock(ErlNifMutex *mtx) { return erl_drv_mutex_trylock(mtx); }
+void __attribute__((externally_visible)) enif_mutex_lock(ErlNifMutex *mtx) { erl_drv_mutex_lock(mtx); }
+void __attribute__((externally_visible)) enif_mutex_unlock(ErlNifMutex *mtx) { erl_drv_mutex_unlock(mtx); }
+ErlNifCond* __attribute__((externally_visible)) enif_cond_create(char *name) { return erl_drv_cond_create(name); }
+void __attribute__((externally_visible)) enif_cond_destroy(ErlNifCond *cnd) { erl_drv_cond_destroy(cnd); }
+void __attribute__((externally_visible)) enif_cond_signal(ErlNifCond *cnd) { erl_drv_cond_signal(cnd); }
+void __attribute__((externally_visible)) enif_cond_broadcast(ErlNifCond *cnd) { erl_drv_cond_broadcast(cnd); }
+void __attribute__((externally_visible)) enif_cond_wait(ErlNifCond *cnd, ErlNifMutex *mtx) { erl_drv_cond_wait(cnd,mtx); }
+ErlNifRWLock* __attribute__((externally_visible)) enif_rwlock_create(char *name) { return erl_drv_rwlock_create(name); }
+void __attribute__((externally_visible)) enif_rwlock_destroy(ErlNifRWLock *rwlck) { erl_drv_rwlock_destroy(rwlck); }
+int __attribute__((externally_visible)) enif_rwlock_tryrlock(ErlNifRWLock *rwlck) { return erl_drv_rwlock_tryrlock(rwlck); }
+void __attribute__((externally_visible)) enif_rwlock_rlock(ErlNifRWLock *rwlck) { erl_drv_rwlock_rlock(rwlck); }
+void __attribute__((externally_visible)) enif_rwlock_runlock(ErlNifRWLock *rwlck) { erl_drv_rwlock_runlock(rwlck); }
+int __attribute__((externally_visible)) enif_rwlock_tryrwlock(ErlNifRWLock *rwlck) { return erl_drv_rwlock_tryrwlock(rwlck); }
+void __attribute__((externally_visible)) enif_rwlock_rwlock(ErlNifRWLock *rwlck) { erl_drv_rwlock_rwlock(rwlck); }
+void __attribute__((externally_visible)) enif_rwlock_rwunlock(ErlNifRWLock *rwlck) { erl_drv_rwlock_rwunlock(rwlck); }
+int __attribute__((externally_visible)) enif_tsd_key_create(char *name, ErlNifTSDKey *key) { return erl_drv_tsd_key_create(name,key); }
+void __attribute__((externally_visible)) enif_tsd_key_destroy(ErlNifTSDKey key) { erl_drv_tsd_key_destroy(key); }
+void __attribute__((externally_visible)) enif_tsd_set(ErlNifTSDKey key, void *data) { erl_drv_tsd_set(key,data); }
+void* __attribute__((externally_visible)) enif_tsd_get(ErlNifTSDKey key) { return erl_drv_tsd_get(key); }
+ErlNifThreadOpts* __attribute__((externally_visible)) enif_thread_opts_create(char *name) { return (ErlNifThreadOpts*) erl_drv_thread_opts_create(name); }
+void __attribute__((externally_visible)) enif_thread_opts_destroy(ErlNifThreadOpts *opts) { erl_drv_thread_opts_destroy((ErlDrvThreadOpts*)opts); }
+int __attribute__((externally_visible))
+enif_thread_create(char *name, ErlNifTid *tid, void* (*func)(void *), void *args, ErlNifThreadOpts *opts) {
     return erl_drv_thread_create(name,tid,func,args,(ErlDrvThreadOpts*)opts);
 }
-ErlNifTid enif_thread_self(void) { return erl_drv_thread_self(); }
-int enif_equal_tids(ErlNifTid tid1, ErlNifTid tid2) { return erl_drv_equal_tids(tid1,tid2); }
-void enif_thread_exit(void *resp) { erl_drv_thread_exit(resp); }
-int enif_thread_join(ErlNifTid tid, void **respp) { return erl_drv_thread_join(tid,respp); }
-int enif_getenv(const char *key, char *value, size_t *value_size) { return erl_drv_getenv(key, value, value_size); }
+ErlNifTid __attribute__((externally_visible)) enif_thread_self(void) { return erl_drv_thread_self(); }
+int __attribute__((externally_visible)) enif_equal_tids(ErlNifTid tid1, ErlNifTid tid2) { return erl_drv_equal_tids(tid1,tid2); }
+void __attribute__((externally_visible)) enif_thread_exit(void *resp) { erl_drv_thread_exit(resp); }
+int __attribute__((externally_visible)) enif_thread_join(ErlNifTid tid, void **respp) { return erl_drv_thread_join(tid,respp); }
+int __attribute__((externally_visible)) enif_getenv(const char *key, char *value, size_t *value_size) { return erl_drv_getenv(key, value, value_size); }
 
-ErlNifTime enif_monotonic_time(ErlNifTimeUnit time_unit)
+ErlNifTime __attribute__((externally_visible)) enif_monotonic_time(ErlNifTimeUnit time_unit)
 {
     return (ErlNifTime) erts_napi_monotonic_time((int) time_unit);
 }
 
-ErlNifTime enif_time_offset(ErlNifTimeUnit time_unit)
+ErlNifTime __attribute__((externally_visible)) enif_time_offset(ErlNifTimeUnit time_unit)
 {
     return (ErlNifTime) erts_napi_time_offset((int) time_unit);
 }
 
-ErlNifTime
+ErlNifTime __attribute__((externally_visible))
 enif_convert_time_unit(ErlNifTime val,
 		       ErlNifTimeUnit from,
 		       ErlNifTimeUnit to)
@@ -1993,7 +1992,7 @@ enif_convert_time_unit(ErlNifTime val,
 						    (int) to);
 }
 
-int enif_fprintf(void* filep, const char* format, ...) 
+int __attribute__((externally_visible)) enif_fprintf(void* filep, const char* format, ...) 
 { 
     int ret;
     va_list arglist;
@@ -2003,7 +2002,7 @@ int enif_fprintf(void* filep, const char
     return ret;
 }    
 
-int enif_snprintf(char *buffer, size_t size, const char* format, ...) 
+int __attribute__((externally_visible)) enif_snprintf(char *buffer, size_t size, const char* format, ...) 
 { 
     int ret;
     va_list arglist;
@@ -2143,7 +2142,7 @@ ErlNifResourceType* open_resource_type(E
     return type;
 }
 
-ErlNifResourceType*
+ErlNifResourceType* __attribute__((externally_visible))
 enif_open_resource_type(ErlNifEnv* env,
                         const char* module_str,
                         const char* name_str,
@@ -2430,7 +2429,7 @@ void erts_fire_nif_monitor(ErtsResource*
     erts_destroy_monitor(rmon);
 }
 
-void* enif_alloc_resource(ErlNifResourceType* type, size_t data_sz)
+void* __attribute__((externally_visible)) enif_alloc_resource(ErlNifResourceType* type, size_t data_sz)
 {
     size_t magic_sz = offsetof(ErtsResource,data);
     Binary* bin;
@@ -2474,7 +2473,7 @@ void* enif_alloc_resource(ErlNifResource
     return resource->data;
 }
 
-void enif_release_resource(void* obj)
+void __attribute__((externally_visible)) enif_release_resource(void* obj)
 {
     ErtsResource* resource = DATA_TO_RESOURCE(obj);
     ErtsBinary* bin = ERTS_MAGIC_BIN_FROM_UNALIGNED_DATA(resource);
@@ -2487,7 +2486,7 @@ void enif_release_resource(void* obj)
     erts_bin_release(&bin->binary);
 }
 
-void enif_keep_resource(void* obj)
+void __attribute__((externally_visible)) enif_keep_resource(void* obj)
 {
     ErtsResource* resource = DATA_TO_RESOURCE(obj);
     ErtsBinary* bin = ERTS_MAGIC_BIN_FROM_UNALIGNED_DATA(resource);
@@ -2507,7 +2506,7 @@ Eterm erts_bld_resource_ref(Eterm** hpp,
     return erts_mk_magic_ref(hpp, oh, &bin->binary);
 }
 
-ERL_NIF_TERM enif_make_resource(ErlNifEnv* env, void* obj)
+ERL_NIF_TERM __attribute__((externally_visible)) enif_make_resource(ErlNifEnv* env, void* obj)
 {
     ErtsResource* resource = DATA_TO_RESOURCE(obj);
     ErtsBinary* bin = ERTS_MAGIC_BIN_FROM_UNALIGNED_DATA(resource);
@@ -2516,8 +2515,8 @@ ERL_NIF_TERM enif_make_resource(ErlNifEn
     return erts_mk_magic_ref(&hp, &MSO(env->proc), &bin->binary);
 }
 
-ERL_NIF_TERM enif_make_resource_binary(ErlNifEnv* env, void* obj,
-				       const void* data, size_t size)
+ERL_NIF_TERM __attribute__((externally_visible))
+enif_make_resource_binary(ErlNifEnv* env, void* obj, const void* data, size_t size)
 {
     ErtsResource* resource = DATA_TO_RESOURCE(obj);
     ErtsBinary* bin = ERTS_MAGIC_BIN_FROM_UNALIGNED_DATA(resource);
@@ -2539,8 +2538,8 @@ ERL_NIF_TERM enif_make_resource_binary(E
     return make_binary(hp);
 }
 
-int enif_get_resource(ErlNifEnv* env, ERL_NIF_TERM term, ErlNifResourceType* type,
-		      void** objp)
+int __attribute__((externally_visible))
+enif_get_resource(ErlNifEnv* env, ERL_NIF_TERM term, ErlNifResourceType* type, void** objp)
 {
     Binary* mbin;
     ErtsResource* resource;
@@ -2571,7 +2570,7 @@ int enif_get_resource(ErlNifEnv* env, ER
     return 1;
 }
 
-size_t enif_sizeof_resource(void* obj)
+size_t __attribute__((externally_visible)) enif_sizeof_resource(void* obj)
 {
     ErtsResource* resource = DATA_TO_RESOURCE(obj);
     if (resource->monitors) {
@@ -2584,8 +2583,8 @@ size_t enif_sizeof_resource(void* obj)
 }
 
 
-void* enif_dlopen(const char* lib,
-		  void (*err_handler)(void*,const char*), void* err_arg)
+void* __attribute__((externally_visible))
+enif_dlopen(const char* lib, void (*err_handler)(void*,const char*), void* err_arg)
 {
     ErtsSysDdllError errdesc = ERTS_SYS_DDLL_ERROR_INIT;
     void* handle;
@@ -2605,8 +2604,8 @@ void* enif_dlopen(const char* lib,
     return handle;
 }
 
-void* enif_dlsym(void* handle, const char* symbol,
-		 void (*err_handler)(void*,const char*), void* err_arg)
+void* __attribute__((externally_visible))
+enif_dlsym(void* handle, const char* symbol, void (*err_handler)(void*,const char*), void* err_arg)
 {
     ErtsSysDdllError errdesc = ERTS_SYS_DDLL_ERROR_INIT;
     void* ret;
@@ -2620,7 +2619,7 @@ void* enif_dlsym(void* handle, const cha
     return ret;
 }
 
-int enif_consume_timeslice(ErlNifEnv* env, int percent)
+int __attribute__((externally_visible)) enif_consume_timeslice(ErlNifEnv* env, int percent)
 {
     Process *proc;
     Sint reds;
@@ -2843,7 +2842,7 @@ execute_nif(ErlNifEnv* env, int argc, co
     return result;
 }
 
-ERL_NIF_TERM
+ERL_NIF_TERM __attribute__((externally_visible))
 enif_schedule_nif(ErlNifEnv* env, const char* fun_name, int flags,
 		  ERL_NIF_TERM (*fp)(ErlNifEnv*, int, const ERL_NIF_TERM[]),
 		  int argc, const ERL_NIF_TERM argv[])
@@ -2884,7 +2883,7 @@ enif_schedule_nif(ErlNifEnv* env, const
     return result;
 }
 
-int
+int __attribute__((externally_visible))
 enif_thread_type(void)
 {
     ErtsSchedulerData *esdp = erts_get_scheduler_data();
@@ -2909,12 +2908,12 @@ enif_thread_type(void)
 
 /* Maps */
 
-int enif_is_map(ErlNifEnv* env, ERL_NIF_TERM term)
+int __attribute__((externally_visible)) enif_is_map(ErlNifEnv* env, ERL_NIF_TERM term)
 {
     return is_map(term);
 }
 
-int enif_get_map_size(ErlNifEnv* env, ERL_NIF_TERM term, size_t *size)
+int __attribute__((externally_visible)) enif_get_map_size(ErlNifEnv* env, ERL_NIF_TERM term, size_t *size)
 {
     if (is_flatmap(term)) {
 	flatmap_t *mp;
@@ -2929,7 +2928,7 @@ int enif_get_map_size(ErlNifEnv* env, ER
     return 0;
 }
 
-ERL_NIF_TERM enif_make_new_map(ErlNifEnv* env)
+ERL_NIF_TERM __attribute__((externally_visible)) enif_make_new_map(ErlNifEnv* env)
 {
     Eterm* hp = alloc_heap(env,MAP_HEADER_FLATMAP_SZ+1);
     Eterm tup;
@@ -2945,11 +2944,8 @@ ERL_NIF_TERM enif_make_new_map(ErlNifEnv
     return make_flatmap(mp);
 }
 
-int enif_make_map_put(ErlNifEnv* env,
-	              Eterm map_in,
-		      Eterm key,
-		      Eterm value,
-		      Eterm *map_out)
+int __attribute__((externally_visible))
+enif_make_map_put(ErlNifEnv* env, Eterm map_in, Eterm key, Eterm value, Eterm *map_out)
 {
     if (!is_map(map_in)) {
 	return 0;
@@ -2964,10 +2960,7 @@ int enif_make_map_put(ErlNifEnv* env,
     return 1;
 }
 
-int enif_get_map_value(ErlNifEnv* env,
-	               Eterm map,
-		       Eterm key,
-		       Eterm *value)
+int __attribute__((externally_visible)) enif_get_map_value(ErlNifEnv* env, Eterm map, Eterm key, Eterm *value)
 {
     const Eterm *ret;
     if (!is_map(map)) {
@@ -2981,11 +2974,7 @@ int enif_get_map_value(ErlNifEnv* env,
     return 0;
 }
 
-int enif_make_map_update(ErlNifEnv* env,
-	                 Eterm map_in,
-			 Eterm key,
-			 Eterm value,
-			 Eterm *map_out)
+int __attribute__((externally_visible)) enif_make_map_update(ErlNifEnv* env, Eterm map_in, Eterm key, Eterm value, Eterm *map_out)
 {
     int res;
     if (!is_map(map_in)) {
@@ -3002,10 +2991,7 @@ int enif_make_map_update(ErlNifEnv* env,
     return res;
 }
 
-int enif_make_map_remove(ErlNifEnv* env,
-	                 Eterm map_in,
-			 Eterm key,
-			 Eterm *map_out)
+int __attribute__((externally_visible)) enif_make_map_remove(ErlNifEnv* env, Eterm map_in, Eterm key, Eterm *map_out)
 {
     if (!is_map(map_in)) {
 	return 0;
@@ -3016,10 +3002,8 @@ int enif_make_map_remove(ErlNifEnv* env,
     return 1;
 }
 
-int enif_map_iterator_create(ErlNifEnv *env,
-	                     Eterm map,
-			     ErlNifMapIterator *iter,
-			     ErlNifMapIteratorEntry entry)
+int __attribute__((externally_visible))
+enif_map_iterator_create(ErlNifEnv *env, Eterm map, ErlNifMapIterator *iter, ErlNifMapIteratorEntry entry)
 {
     if (is_flatmap(map)) {
 	flatmap_t *mp = (flatmap_t*)flatmap_val(map);
@@ -3074,7 +3058,7 @@ error:
     return 0;
 }
 
-void enif_map_iterator_destroy(ErlNifEnv *env, ErlNifMapIterator *iter)
+void __attribute__((externally_visible)) enif_map_iterator_destroy(ErlNifEnv *env, ErlNifMapIterator *iter)
 {
     if (is_hashmap(iter->map)) {
         WSTACK_DESTROY(iter->u.hash.wstack->ws);
@@ -3088,7 +3072,7 @@ void enif_map_iterator_destroy(ErlNifEnv
 #endif
 }
 
-int enif_map_iterator_is_tail(ErlNifEnv *env, ErlNifMapIterator *iter)
+int __attribute__((externally_visible)) enif_map_iterator_is_tail(ErlNifEnv *env, ErlNifMapIterator *iter)
 {
     ASSERT(iter);
     if (is_flatmap(iter->map)) {
@@ -3102,7 +3086,7 @@ int enif_map_iterator_is_tail(ErlNifEnv
     }
 }
 
-int enif_map_iterator_is_head(ErlNifEnv *env, ErlNifMapIterator *iter)
+int __attribute__((externally_visible)) enif_map_iterator_is_head(ErlNifEnv *env, ErlNifMapIterator *iter)
 {
     ASSERT(iter);
     if (is_flatmap(iter->map)) {
@@ -3117,7 +3101,7 @@ int enif_map_iterator_is_head(ErlNifEnv
 }
 
 
-int enif_map_iterator_next(ErlNifEnv *env, ErlNifMapIterator *iter)
+int __attribute__((externally_visible)) enif_map_iterator_next(ErlNifEnv *env, ErlNifMapIterator *iter)
 {
     ASSERT(iter);
     if (is_flatmap(iter->map)) {
@@ -3143,7 +3127,7 @@ int enif_map_iterator_next(ErlNifEnv *en
     }
 }
 
-int enif_map_iterator_prev(ErlNifEnv *env, ErlNifMapIterator *iter)
+int __attribute__((externally_visible)) enif_map_iterator_prev(ErlNifEnv *env, ErlNifMapIterator *iter)
 {
     ASSERT(iter);
     if (is_flatmap(iter->map)) {
@@ -3169,10 +3153,7 @@ int enif_map_iterator_prev(ErlNifEnv *en
     }
 }
 
-int enif_map_iterator_get_pair(ErlNifEnv *env,
-			       ErlNifMapIterator *iter,
-			       Eterm *key,
-			       Eterm *value)
+int __attribute__((externally_visible)) enif_map_iterator_get_pair(ErlNifEnv *env, ErlNifMapIterator *iter, Eterm *key, Eterm *value)
 {
     ASSERT(iter);
     if (is_flatmap(iter->map)) {
diff -Ndurp otp_src_20.1/erts/emulator/beam/erl_port_task.c otp_src_20.1-erts-symbols/erts/emulator/beam/erl_port_task.c
--- otp_src_20.1/erts/emulator/beam/erl_port_task.c	2017-09-22 16:21:51.000000000 +0300
+++ otp_src_20.1-erts-symbols/erts/emulator/beam/erl_port_task.c	2017-09-26 20:58:04.896109064 +0300
@@ -752,7 +752,7 @@ enqueue_proc2port_data(Port *pp,
  * as a write-read request.
  */
 
-void
+void __attribute__((externally_visible))
 erl_drv_busy_msgq_limits(ErlDrvPort dport, ErlDrvSizeT *lowp, ErlDrvSizeT *highp)
 {
     Port *pp = erts_drvport2port(dport);
@@ -1268,7 +1268,7 @@ select_task_for_exec(Port *pp,
  * Cut time slice
  */
 
-int
+int __attribute__((externally_visible))
 erl_drv_consume_timeslice(ErlDrvPort dprt, int percent)
 {
     Port *pp = erts_drvport2port(dprt);
diff -Ndurp otp_src_20.1/erts/emulator/beam/erl_posix_str.c otp_src_20.1-erts-symbols/erts/emulator/beam/erl_posix_str.c
--- otp_src_20.1/erts/emulator/beam/erl_posix_str.c	2017-09-22 16:21:51.000000000 +0300
+++ otp_src_20.1-erts-symbols/erts/emulator/beam/erl_posix_str.c	2017-09-26 20:58:04.896109064 +0300
@@ -46,7 +46,7 @@
  *----------------------------------------------------------------------
  */
 
-char *
+char * __attribute__((externally_visible))
 erl_errno_id(error)
     int error;			/* Posix error number (as from errno). */
 {
diff -Ndurp otp_src_20.1/erts/emulator/beam/io.c otp_src_20.1-erts-symbols/erts/emulator/beam/io.c
--- otp_src_20.1/erts/emulator/beam/io.c	2017-09-22 16:21:51.000000000 +0300
+++ otp_src_20.1-erts-symbols/erts/emulator/beam/io.c	2017-09-26 20:59:23.335450014 +0300
@@ -71,7 +71,7 @@ static erts_smp_tsd_key_t driver_list_la
 
 ErtsPTab erts_port erts_align_attribute(ERTS_CACHE_LINE_SIZE); /* The port table */
 
-const ErlDrvTermData driver_term_nil = (ErlDrvTermData)NIL;
+const ErlDrvTermData __attribute__((externally_visible)) driver_term_nil = (ErlDrvTermData)NIL;
 
 const Port erts_invalid_port = {{ERTS_INVALID_PORT}};
 
@@ -192,7 +192,7 @@ typedef struct line_buf_context {
     dtrace_proc_str((PID), process_str);                     \
     dtrace_port_str((PORT), port_str);
 
-void
+void __attribute__((externally_visible))
 dtrace_drvport_str(ErlDrvPort drvport, char *port_buf)
 {
     Port *port = erts_drvport2port(drvport);
@@ -775,7 +775,7 @@ ERTS_SCHED_PREF_QUICK_ALLOC_IMPL(xports_
  * Historical reason: to be used with inet_drv for creating
  * accept sockets inorder to avoid a global table.
  */
-ErlDrvPort
+ErlDrvPort __attribute__((externally_visible))
 driver_create_port(ErlDrvPort creator_port_ix, /* Creating port */
 		   ErlDrvTermData pid,    /* Owner/Caller */
 		   char* name,            /* Driver name */
@@ -5201,7 +5201,7 @@ print_port_info(Port *p, fmtfn_t to, voi
     }
 }
 
-void
+void __attribute__((externally_visible))
 set_busy_port(ErlDrvPort dprt, int on)
 {
     Port *prt;
@@ -5311,14 +5311,14 @@ erts_port_resume_procs(Port *prt)
     }
 }
 
-void set_port_control_flags(ErlDrvPort port_num, int flags)
+void __attribute__((externally_visible)) set_port_control_flags(ErlDrvPort port_num, int flags)
 {
     Port *prt = erts_drvport2port(port_num);
     if (prt != ERTS_INVALID_ERL_DRV_PORT)
 	prt->control_flags = flags;
 }
 
-int get_port_flags(ErlDrvPort ix)
+int __attribute__((externally_visible)) get_port_flags(ErlDrvPort ix)
 {
     int flags;
     Port *prt;
@@ -5541,7 +5541,7 @@ erts_free_port_names(ErtsPortNames *pnp)
     erts_free(ERTS_ALC_T_PORT_NAMES, pnp);
 }
 
-ErlDrvTermData driver_mk_term_nil(void)
+ErlDrvTermData __attribute__((externally_visible)) driver_mk_term_nil(void)
 {
     return driver_term_nil;
 }
@@ -6284,7 +6284,8 @@ done:
     return res;
 }
 
-int erl_drv_output_term(ErlDrvTermData port_id, ErlDrvTermData* data, int len)
+int __attribute__((externally_visible))
+erl_drv_output_term(ErlDrvTermData port_id, ErlDrvTermData* data, int len)
 {
     /* May be called from arbitrary thread */
     Eterm connected = NIL; /* Shut up faulty warning... */
@@ -6300,7 +6301,7 @@ int erl_drv_output_term(ErlDrvTermData p
  * removal in OTP-R17. It is replaced by erl_drv_output_term()
  * above.
  */
-int 
+int __attribute__((externally_visible))
 driver_output_term(ErlDrvPort drvport, ErlDrvTermData* data, int len)
 {
     erts_aint32_t state;
@@ -6319,10 +6320,8 @@ driver_output_term(ErlDrvPort drvport, E
     return driver_deliver_term(prt, ERTS_PORT_GET_CONNECTED(prt), data, len);
 }
 
-int erl_drv_send_term(ErlDrvTermData port_id,
-		      ErlDrvTermData to,
-		      ErlDrvTermData* data,
-		      int len)
+int __attribute__((externally_visible))
+erl_drv_send_term(ErlDrvTermData port_id, ErlDrvTermData to, ErlDrvTermData* data, int len)
 {
     /* May be called from arbitrary thread */
     Port *prt = NULL;
@@ -6336,7 +6335,7 @@ int erl_drv_send_term(ErlDrvTermData por
  * driver_send_term() is deprecated, and has been scheduled for
  * removal in OTP-R17. It is replaced by erl_drv_send_term() above.
  */
-int
+int __attribute__((externally_visible))
 driver_send_term(ErlDrvPort drvport,
 		 ErlDrvTermData to,
 		 ErlDrvTermData* data,
@@ -6371,8 +6370,9 @@ driver_send_term(ErlDrvPort drvport,
  * and data is len length of bin starting from offset offs.
  */
 
-int driver_output_binary(ErlDrvPort ix, char* hbuf, ErlDrvSizeT hlen,
-			 ErlDrvBinary* bin, ErlDrvSizeT offs, ErlDrvSizeT len)
+int __attribute__((externally_visible))
+driver_output_binary(ErlDrvPort ix, char* hbuf, ErlDrvSizeT hlen,
+		     ErlDrvBinary* bin, ErlDrvSizeT offs, ErlDrvSizeT len)
 {
     erts_aint32_t state;
     Port* prt = erts_drvport2port_state(ix, &state);
@@ -6410,8 +6410,8 @@ int driver_output_binary(ErlDrvPort ix,
 ** Example: if hlen = 3 then the port owner will receive the data
 ** [H1,H2,H3 | T]
 */
-int driver_output2(ErlDrvPort ix, char* hbuf, ErlDrvSizeT hlen,
-		   char* buf, ErlDrvSizeT len)
+int __attribute__((externally_visible))
+driver_output2(ErlDrvPort ix, char* hbuf, ErlDrvSizeT hlen, char* buf, ErlDrvSizeT len)
 {
     erts_aint32_t state;
     Port* prt = erts_drvport2port_state(ix, &state);
@@ -6454,14 +6454,14 @@ int driver_output2(ErlDrvPort ix, char*
 
 /* Interface functions available to driver writers */
 
-int driver_output(ErlDrvPort ix, char* buf, ErlDrvSizeT len)
+int __attribute__((externally_visible)) driver_output(ErlDrvPort ix, char* buf, ErlDrvSizeT len)
 {
     ERTS_SMP_CHK_NO_PROC_LOCKS;
     return driver_output2(ix, NULL, 0, buf, len);
 }
 
-int driver_outputv(ErlDrvPort ix, char* hbuf, ErlDrvSizeT hlen,
-		   ErlIOVec* vec, ErlDrvSizeT skip)
+int __attribute__((externally_visible))
+driver_outputv(ErlDrvPort ix, char* hbuf, ErlDrvSizeT hlen, ErlIOVec* vec, ErlDrvSizeT skip)
 {
     int n;
     ErlDrvSizeT len;
@@ -6522,7 +6522,8 @@ int driver_outputv(ErlDrvPort ix, char*
 ** input is a vector a buffer and a max length
 ** return bytes copied
 */
-ErlDrvSizeT driver_vec_to_buf(ErlIOVec *vec, char *buf, ErlDrvSizeT len)
+ErlDrvSizeT __attribute__((externally_visible))
+driver_vec_to_buf(ErlIOVec *vec, char *buf, ErlDrvSizeT len)
 {
     SysIOVec* iov = vec->iov;
     int n = vec->vsize;
@@ -6548,21 +6549,21 @@ ErlDrvSizeT driver_vec_to_buf(ErlIOVec *
  * reference count on driver binaries...
  */
 
-ErlDrvSInt
+ErlDrvSInt __attribute__((externally_visible))
 driver_binary_get_refc(ErlDrvBinary *dbp)
 {
     Binary* bp = ErlDrvBinary2Binary(dbp);
     return (ErlDrvSInt) erts_refc_read(&bp->intern.refc, 1);
 }
 
-ErlDrvSInt
+ErlDrvSInt __attribute__((externally_visible))
 driver_binary_inc_refc(ErlDrvBinary *dbp)
 {
     Binary* bp = ErlDrvBinary2Binary(dbp);
     return (ErlDrvSInt) erts_refc_inctest(&bp->intern.refc, 2);
 }
 
-ErlDrvSInt
+ErlDrvSInt __attribute__((externally_visible))
 driver_binary_dec_refc(ErlDrvBinary *dbp)
 {
     Binary* bp = ErlDrvBinary2Binary(dbp);
@@ -6574,7 +6575,7 @@ driver_binary_dec_refc(ErlDrvBinary *dbp
 ** Allocation/Deallocation of binary objects 
 */
 
-ErlDrvBinary*
+ErlDrvBinary* __attribute__((externally_visible))
 driver_alloc_binary(ErlDrvSizeT size)
 {
     Binary* bin;
@@ -6587,7 +6588,8 @@ driver_alloc_binary(ErlDrvSizeT size)
 
 /* Reallocate space held by binary */
 
-ErlDrvBinary* driver_realloc_binary(ErlDrvBinary* bin, ErlDrvSizeT size)
+ErlDrvBinary* __attribute__((externally_visible))
+driver_realloc_binary(ErlDrvBinary* bin, ErlDrvSizeT size)
 {
     Binary* oldbin;
     Binary* newbin;
@@ -6604,7 +6606,7 @@ ErlDrvBinary* driver_realloc_binary(ErlD
 }
 
 
-void driver_free_binary(ErlDrvBinary* dbin)
+void __attribute__((externally_visible)) driver_free_binary(ErlDrvBinary* dbin)
 {
     Binary *bin;
     if (!dbin)
@@ -6619,17 +6621,17 @@ void driver_free_binary(ErlDrvBinary* db
  * Allocation/deallocation of memory for drivers 
  */
 
-void *driver_alloc(ErlDrvSizeT size)
+void __attribute__((externally_visible)) *driver_alloc(ErlDrvSizeT size)
 {
     return erts_alloc_fnf(ERTS_ALC_T_DRV, (Uint) size);
 }
 
-void *driver_realloc(void *ptr, ErlDrvSizeT size)
+void __attribute__((externally_visible)) *driver_realloc(void *ptr, ErlDrvSizeT size)
 {
     return erts_realloc_fnf(ERTS_ALC_T_DRV, ptr, (Uint) size);
 }
 
-void driver_free(void *ptr)
+void __attribute__((externally_visible)) driver_free(void *ptr)
 {
     erts_free(ERTS_ALC_T_DRV, ptr);
 }
@@ -6727,7 +6729,7 @@ static void driver_monitor_unlock_pdl(Po
  * exported driver_pdl_* functions ...
  */
 
-ErlDrvPDL
+ErlDrvPDL __attribute__((externally_visible))
 driver_pdl_create(ErlDrvPort dp)
 {
     ErlDrvPDL pdl;
@@ -6747,7 +6749,7 @@ driver_pdl_create(ErlDrvPort dp)
     return pdl;
 }
 
-void
+void __attribute__((externally_visible))
 driver_pdl_lock(ErlDrvPDL pdl)
 {
 #ifdef HARDDEBUG
@@ -6757,7 +6759,7 @@ driver_pdl_lock(ErlDrvPDL pdl)
     erts_mtx_lock(&pdl->mtx);
 }
 
-void
+void __attribute__((externally_visible))
 driver_pdl_unlock(ErlDrvPDL pdl)
 {
     ErlDrvSInt refc;
@@ -6770,13 +6772,13 @@ driver_pdl_unlock(ErlDrvPDL pdl)
 	pdl_destroy(pdl);
 }
 
-ErlDrvSInt
+ErlDrvSInt __attribute__((externally_visible))
 driver_pdl_get_refc(ErlDrvPDL pdl)
 {
     return pdl_read_refc(pdl);
 }
 
-ErlDrvSInt
+ErlDrvSInt __attribute__((externally_visible))
 driver_pdl_inc_refc(ErlDrvPDL pdl)
 {
     ErlDrvSInt refc = pdl_inctest_refc(pdl);
@@ -6787,7 +6789,7 @@ driver_pdl_inc_refc(ErlDrvPDL pdl)
     return refc;
 }
 
-ErlDrvSInt
+ErlDrvSInt __attribute__((externally_visible))
 driver_pdl_dec_refc(ErlDrvPDL pdl)
 {
     ErlDrvSInt refc = pdl_dectest_refc(pdl);
@@ -6801,14 +6803,14 @@ driver_pdl_dec_refc(ErlDrvPDL pdl)
 }
 
 /* Put elements from vec at q tail */
-int driver_enqv(ErlDrvPort ix, ErlIOVec* vec, ErlDrvSizeT skip)
+int __attribute__((externally_visible)) driver_enqv(ErlDrvPort ix, ErlIOVec* vec, ErlDrvSizeT skip)
 {
     ASSERT(vec->size >= skip);
     return erts_ioq_enqv(drvport2ioq(ix), (ErtsIOVec*)vec, skip);
 }
 
 /* Put elements from vec at q head */
-int driver_pushqv(ErlDrvPort ix, ErlIOVec* vec, ErlDrvSizeT skip)
+int __attribute__((externally_visible)) driver_pushqv(ErlDrvPort ix, ErlIOVec* vec, ErlDrvSizeT skip)
 {
     ASSERT(vec->size >= skip);
     return erts_ioq_pushqv(drvport2ioq(ix), (ErtsIOVec*)vec, skip);
@@ -6818,7 +6820,7 @@ int driver_pushqv(ErlDrvPort ix, ErlIOVe
 ** Remove size bytes from queue head
 ** Return number of bytes that remain in queue
 */
-ErlDrvSizeT driver_deq(ErlDrvPort ix, ErlDrvSizeT size)
+ErlDrvSizeT __attribute__((externally_visible)) driver_deq(ErlDrvPort ix, ErlDrvSizeT size)
 {
     ErlPortIOQueue *q = drvport2ioq(ix);
     if (erts_ioq_deq(q, size) == -1)
@@ -6827,18 +6829,18 @@ ErlDrvSizeT driver_deq(ErlDrvPort ix, Er
 }
 
 
-ErlDrvSizeT driver_peekqv(ErlDrvPort ix, ErlIOVec *ev)
+ErlDrvSizeT __attribute__((externally_visible)) driver_peekqv(ErlDrvPort ix, ErlIOVec *ev)
 {
     return erts_ioq_peekqv(drvport2ioq(ix), (ErtsIOVec*)ev);
 }
 
-SysIOVec* driver_peekq(ErlDrvPort ix, int* vlenp)  /* length of io-vector */
+SysIOVec* __attribute__((externally_visible)) driver_peekq(ErlDrvPort ix, int* vlenp) /* length of io-vector */
 {
     return erts_ioq_peekq(drvport2ioq(ix), vlenp);
 }
 
 
-ErlDrvSizeT driver_sizeq(ErlDrvPort ix)
+ErlDrvSizeT __attribute__((externally_visible)) driver_sizeq(ErlDrvPort ix)
 {
     ErlPortIOQueue *q = drvport2ioq(ix);
 
@@ -6851,8 +6853,8 @@ ErlDrvSizeT driver_sizeq(ErlDrvPort ix)
 /* Utils */
 
 /* Enqueue a binary */
-int driver_enq_bin(ErlDrvPort ix, ErlDrvBinary* bin,
-		   ErlDrvSizeT offs, ErlDrvSizeT len)
+int __attribute__((externally_visible))
+driver_enq_bin(ErlDrvPort ix, ErlDrvBinary* bin, ErlDrvSizeT offs, ErlDrvSizeT len)
 {
     SysIOVec      iov;
     ErlIOVec      ev;
@@ -6869,7 +6871,7 @@ int driver_enq_bin(ErlDrvPort ix, ErlDrv
     return driver_enqv(ix, &ev, 0);
 }
 
-int driver_enq(ErlDrvPort ix, char* buffer, ErlDrvSizeT len)
+int __attribute__((externally_visible)) driver_enq(ErlDrvPort ix, char* buffer, ErlDrvSizeT len)
 {
     int code;
     ErlDrvBinary* bin;
@@ -6885,8 +6887,8 @@ int driver_enq(ErlDrvPort ix, char* buff
     return code;
 }
 
-int driver_pushq_bin(ErlDrvPort ix, ErlDrvBinary* bin,
-		     ErlDrvSizeT offs, ErlDrvSizeT len)
+int __attribute__((externally_visible))
+driver_pushq_bin(ErlDrvPort ix, ErlDrvBinary* bin, ErlDrvSizeT offs, ErlDrvSizeT len)
 {
     SysIOVec      iov;
     ErlIOVec      ev;
@@ -6903,7 +6905,7 @@ int driver_pushq_bin(ErlDrvPort ix, ErlD
     return driver_pushqv(ix, &ev, 0);
 }
 
-int driver_pushq(ErlDrvPort ix, char* buffer, ErlDrvSizeT len)
+int __attribute__((externally_visible)) driver_pushq(ErlDrvPort ix, char* buffer, ErlDrvSizeT len)
 {
     int code;
     ErlDrvBinary* bin;
@@ -6920,7 +6922,7 @@ int driver_pushq(ErlDrvPort ix, char* bu
     return code;
 }
 
-int driver_set_timer(ErlDrvPort ix, unsigned long t)
+int __attribute__((externally_visible)) driver_set_timer(ErlDrvPort ix, unsigned long t)
 {
     Port* prt = erts_drvport2port(ix);
 
@@ -6936,7 +6938,7 @@ int driver_set_timer(ErlDrvPort ix, unsi
     return 0;
 }
 
-int driver_cancel_timer(ErlDrvPort ix)
+int __attribute__((externally_visible)) driver_cancel_timer(ErlDrvPort ix)
 {
     Port* prt = erts_drvport2port(ix);
     if (prt == ERTS_INVALID_ERL_DRV_PORT)
@@ -6946,7 +6948,7 @@ int driver_cancel_timer(ErlDrvPort ix)
     return 0;
 }
 
-int
+int __attribute__((externally_visible))
 driver_read_timer(ErlDrvPort ix, unsigned long* t)
 {
     Port* prt = erts_drvport2port(ix);
@@ -6967,7 +6969,7 @@ driver_read_timer(ErlDrvPort ix, unsigne
     return 0;
 }
 
-int 
+int __attribute__((externally_visible))
 driver_get_now(ErlDrvNowData *now_data)
 {
     Uint mega,secs,micro;
@@ -7053,9 +7055,8 @@ static int do_driver_monitor_process(Por
 /*
  * This can be called from a non scheduler thread iff a port_data_lock exists
  */
-int driver_monitor_process(ErlDrvPort drvport,
-			   ErlDrvTermData process,
-			   ErlDrvMonitor *monitor)
+int __attribute__((externally_visible))
+driver_monitor_process(ErlDrvPort drvport, ErlDrvTermData process, ErlDrvMonitor *monitor)
 {
     Port *prt;
     int ret;
@@ -7112,8 +7113,8 @@ static int do_driver_demonitor_process(P
     return 0;
 }
 
-int driver_demonitor_process(ErlDrvPort drvport,
-			     const ErlDrvMonitor *monitor)
+int __attribute__((externally_visible))
+driver_demonitor_process(ErlDrvPort drvport, const ErlDrvMonitor *monitor)
 {
     Port *prt;
     int ret;
@@ -7152,9 +7153,8 @@ static ErlDrvTermData do_driver_get_moni
     return (ErlDrvTermData) to;
 }
 
-
-ErlDrvTermData driver_get_monitored_process(ErlDrvPort drvport,
-					    const ErlDrvMonitor *monitor)
+ErlDrvTermData __attribute__((externally_visible))
+driver_get_monitored_process(ErlDrvPort drvport, const ErlDrvMonitor *monitor)
 {
     Port *prt;
     ErlDrvTermData ret;
@@ -7174,8 +7174,8 @@ ErlDrvTermData driver_get_monitored_proc
     return ret;
 }
 
-int driver_compare_monitors(const ErlDrvMonitor *monitor1,
-			    const ErlDrvMonitor *monitor2)
+int __attribute__((externally_visible))
+driver_compare_monitors(const ErlDrvMonitor *monitor1, const ErlDrvMonitor *monitor2)
 {
     return sys_memcmp((void *) monitor1, (void *) monitor2,
                       ERTS_REF_THING_SIZE*sizeof(Eterm));
@@ -7268,7 +7268,7 @@ driver_failure_term(ErlDrvPort ix, Eterm
 ** Do a (soft) exit. unlink the connected process before doing
 ** driver posix error or (normal)
 */
-int driver_exit(ErlDrvPort ix, int err)
+int __attribute__((externally_visible)) driver_exit(ErlDrvPort ix, int err)
 {
     Port* prt = erts_drvport2port(ix);
     Process* rp;
@@ -7312,12 +7312,12 @@ int driver_exit(ErlDrvPort ix, int err)
 }
 
 
-int driver_failure(ErlDrvPort ix, int code)
+int __attribute__((externally_visible)) driver_failure(ErlDrvPort ix, int code)
 {
     return driver_failure_term(ix, make_small(code), code == 0);
 }
 
-int driver_failure_atom(ErlDrvPort ix, char* string)
+int __attribute__((externally_visible)) driver_failure_atom(ErlDrvPort ix, char* string)
 {
     return driver_failure_term(ix,
 			       erts_atom_put((byte *) string,
@@ -7327,19 +7327,19 @@ int driver_failure_atom(ErlDrvPort ix, c
 			       0);
 }
 
-int driver_failure_posix(ErlDrvPort ix, int err)
+int __attribute__((externally_visible)) driver_failure_posix(ErlDrvPort ix, int err)
 {
     return driver_failure_atom(ix, erl_errno_id(err));
 }
 
-int driver_failure_eof(ErlDrvPort ix)
+int __attribute__((externally_visible)) driver_failure_eof(ErlDrvPort ix)
 {
     return driver_failure_term(ix, NIL, 1);
 }
 
 
 
-ErlDrvTermData driver_mk_atom(char* string)
+ErlDrvTermData __attribute__((externally_visible)) driver_mk_atom(char* string)
 {
     Eterm am = erts_atom_put((byte *) string,
 			     sys_strlen(string),
@@ -7349,7 +7349,7 @@ ErlDrvTermData driver_mk_atom(char* stri
     return (ErlDrvTermData) am;
 }
 
-ErlDrvTermData driver_mk_port(ErlDrvPort ix)
+ErlDrvTermData __attribute__((externally_visible)) driver_mk_port(ErlDrvPort ix)
 {
     Port* prt = erts_drvport2port(ix);
     if (prt == ERTS_INVALID_ERL_DRV_PORT)
@@ -7358,7 +7358,7 @@ ErlDrvTermData driver_mk_port(ErlDrvPort
     return (ErlDrvTermData) prt->common.id;
 }
 
-ErlDrvTermData driver_connected(ErlDrvPort ix)
+ErlDrvTermData __attribute__((externally_visible)) driver_connected(ErlDrvPort ix)
 {
     Port* prt = erts_drvport2port(ix);
     ERTS_SMP_CHK_NO_PROC_LOCKS;
@@ -7368,7 +7368,7 @@ ErlDrvTermData driver_connected(ErlDrvPo
     return ERTS_PORT_GET_CONNECTED(prt);
 }
 
-ErlDrvTermData driver_caller(ErlDrvPort ix)
+ErlDrvTermData __attribute__((externally_visible)) driver_caller(ErlDrvPort ix)
 {
     Port* prt = erts_drvport2port(ix);
     ERTS_SMP_CHK_NO_PROC_LOCKS;
@@ -7378,7 +7378,7 @@ ErlDrvTermData driver_caller(ErlDrvPort
     return prt->caller;
 }
 
-int driver_lock_driver(ErlDrvPort ix)
+int __attribute__((externally_visible)) driver_lock_driver(ErlDrvPort ix)
 {
     Port* prt = erts_drvport2port(ix);
     DE_Handle* dh;
@@ -7433,7 +7433,7 @@ static void maybe_unlock_driver_list(int
    Writing code using these interfaces spanning several driver callbacks between loading/lookup 
    and error handling may give undesired results...
 */
-void *driver_dl_open(char * path)
+void* __attribute__((externally_visible)) driver_dl_open(char * path)
 {
     void *ptr;
     int res;
@@ -7453,7 +7453,7 @@ void *driver_dl_open(char * path)
     }
 }
 
-void *driver_dl_sym(void * handle, char *func_name)
+void* __attribute__((externally_visible)) driver_dl_sym(void * handle, char *func_name)
 {
     void *ptr;
     int res;
@@ -7473,7 +7473,7 @@ void *driver_dl_sym(void * handle, char
     }
 }
     
-int driver_dl_close(void *handle)
+int __attribute__((externally_visible)) driver_dl_close(void *handle)
 {
     int res;
     int locked = maybe_lock_driver_list();
@@ -7482,7 +7482,7 @@ int driver_dl_close(void *handle)
     return res;
 }
 
-char *driver_dl_error(void) 
+char* __attribute__((externally_visible)) driver_dl_error(void)
 {
     char *res;
     int *last_error_p = erts_smp_tsd_get(driver_list_lock_status_key);
@@ -7497,7 +7497,7 @@ char *driver_dl_error(void)
   (offsetof(ErlDrvSysInfo, LAST_FIELD) \
    + sizeof(((ErlDrvSysInfo *) 0)->LAST_FIELD))
 
-void
+void __attribute__((externally_visible))
 driver_system_info(ErlDrvSysInfo *sip, size_t si_size)
 {
     /*
@@ -7715,7 +7715,8 @@ erts_destroy_driver(erts_driver_t *drv)
  * Exposed in the driver interface, and therefore possibly locking directly.
  */
 
-void add_driver_entry(ErlDrvEntry *drv){
+void __attribute__((externally_visible)) add_driver_entry(ErlDrvEntry *drv)
+{
     void *rec_lock;
     rec_lock = erts_smp_tsd_get(driver_list_lock_status_key);
     /* 
@@ -7766,7 +7767,7 @@ int erts_add_driver_entry(ErlDrvEntry *d
 }
 
 /* Not allowed for dynamic drivers */
-int remove_driver_entry(ErlDrvEntry *drv)
+int __attribute__((externally_visible)) remove_driver_entry(ErlDrvEntry *drv)
 {
     erts_driver_t *dp;
     void *rec_lock;
@@ -7808,18 +7809,18 @@ int remove_driver_entry(ErlDrvEntry *drv
 /* very useful function that can be used in entries that are not used
  * so that not every driver writer must supply a personal version
  */
-int null_func(void)
+int __attribute__((externally_visible)) null_func(void)
 {
     return 0;
 }
 
-int
+int __attribute__((externally_visible))
 erl_drv_putenv(const char *key, char *value)
 {
     return erts_sys_putenv_raw((char*)key, value);
 }
 
-int
+int __attribute__((externally_visible))
 erl_drv_getenv(const char *key, char *value, size_t *value_size)
 {
     return erts_sys_getenv_raw((char*)key, value, value_size);
diff -Ndurp otp_src_20.1/erts/emulator/sys/unix/sys.c otp_src_20.1-erts-symbols/erts/emulator/sys/unix/sys.c
--- otp_src_20.1/erts/emulator/sys/unix/sys.c	2017-09-22 16:21:51.000000000 +0300
+++ otp_src_20.1-erts-symbols/erts/emulator/sys/unix/sys.c	2017-09-26 20:58:04.898109021 +0300
@@ -185,13 +185,13 @@ struct {
 } io_func = {0};
 
 
-int
+int __attribute__((externally_visible))
 driver_select(ErlDrvPort port, ErlDrvEvent event, int mode, int on)
 {
     return (*io_func.select)(port, event, mode, on);
 }
 
-int
+int __attribute__((externally_visible))
 driver_event(ErlDrvPort port, ErlDrvEvent event, ErlDrvEventData event_data)
 {
     return (*io_func.event)(port, event, event_data);
diff -Ndurp otp_src_20.1/erts/emulator/sys/unix/sys_float.c otp_src_20.1-erts-symbols/erts/emulator/sys/unix/sys_float.c
--- otp_src_20.1/erts/emulator/sys/unix/sys_float.c	2017-09-22 16:21:51.000000000 +0300
+++ otp_src_20.1-erts-symbols/erts/emulator/sys/unix/sys_float.c	2017-09-26 20:58:04.898109021 +0300
@@ -683,7 +683,7 @@ void erts_thread_init_float(void)
 #endif
 }
 
-void erts_thread_disable_fpe(void)
+void __attribute__((externally_visible)) erts_thread_disable_fpe(void)
 {
 #if !defined(NO_FPE_SIGNALS)
     (void)mask_fpe();
diff -Ndurp otp_src_20.1/erts/lib_src/common/erl_memory_trace_parser.c otp_src_20.1-erts-symbols/erts/lib_src/common/erl_memory_trace_parser.c
--- otp_src_20.1/erts/lib_src/common/erl_memory_trace_parser.c	2017-09-22 16:21:51.000000000 +0300
+++ otp_src_20.1-erts-symbols/erts/lib_src/common/erl_memory_trace_parser.c	2017-09-26 20:58:04.899108999 +0300
@@ -160,7 +160,7 @@ struct emtp_state_ {
 static char unknown_allocator[] = "unknown_allocator";
 static char unknown_block_type[] = "unknown_block_type";
 
-const char *
+const char * __attribute__((externally_visible))
 emtp_error_string(int res)
 {
     switch (res) {
@@ -202,7 +202,7 @@ emtp_error_string(int res)
 
 }
 
-int
+int __attribute__((externally_visible))
 emtp_get_info(emtp_info *infop, size_t *info_szp, emtp_state *statep)
 {
     if (!infop || !info_szp || *info_szp < sizeof(emtp_info))
@@ -254,7 +254,7 @@ emtp_get_info(emtp_info *infop, size_t *
     return 1;
 }
 
-emtp_state *
+emtp_state * __attribute__((externally_visible))
 emtp_state_new(void * (*alloc)(size_t),
 	       void * (*realloc)(void *, size_t),
 	       void   (*free)(void *))
@@ -307,7 +307,7 @@ emtp_state_new(void * (*alloc)(size_t),
     return statep;
 }
 
-void
+void __attribute__((externally_visible))
 emtp_state_destroy(emtp_state *statep)
 {
     void (*freep)(void *);
@@ -1653,7 +1653,7 @@ parse_header(emtp_state *statep,
 }
 
 
-int
+int __attribute__((externally_visible))
 emtp_parse(emtp_state *statep,
 	   usgnd_int_8 **tracepp, size_t *trace_lenp,
 	   emtp_operation *op_start, size_t op_size, size_t *op_lenp)