diff options
-rw-r--r-- | Makefile.rules | 9 | ||||
-rwxr-xr-x | build_tools/strip_nonapi | 37 | ||||
-rw-r--r-- | default.exports | 4 | ||||
-rw-r--r-- | include/asterisk/astobj2.h | 12 | ||||
-rw-r--r-- | main/Makefile | 13 | ||||
-rw-r--r-- | main/asterisk.exports | 28 | ||||
-rw-r--r-- | main/astobj2.c | 6 | ||||
-rw-r--r-- | makeopts.in | 2 | ||||
-rw-r--r-- | res/res_adsi.exports | 33 | ||||
-rw-r--r-- | res/res_agi.exports | 7 | ||||
-rw-r--r-- | res/res_config_odbc.c | 2 | ||||
-rw-r--r-- | res/res_config_pgsql.c | 2 | ||||
-rw-r--r-- | res/res_crypto.c | 2 | ||||
-rw-r--r-- | res/res_features.exports | 13 | ||||
-rw-r--r-- | res/res_indications.c | 2 | ||||
-rw-r--r-- | res/res_jabber.exports | 13 | ||||
-rw-r--r-- | res/res_monitor.exports | 11 | ||||
-rw-r--r-- | res/res_musiconhold.c | 2 | ||||
-rw-r--r-- | res/res_odbc.exports | 11 | ||||
-rw-r--r-- | res/res_smdi.exports | 18 | ||||
-rw-r--r-- | res/res_snmp.c | 2 | ||||
-rw-r--r-- | res/res_speech.exports | 21 |
22 files changed, 191 insertions, 59 deletions
diff --git a/Makefile.rules b/Makefile.rules index e4b174577..e6427172d 100644 --- a/Makefile.rules +++ b/Makefile.rules @@ -51,8 +51,13 @@ endif # per-target settings will be applied CC_CFLAGS=$(PTHREAD_CFLAGS) $(ASTCFLAGS) CXX_CFLAGS=$(PTHREAD_CFLAGS) $(filter-out -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(AST_DECLARATION_AFTER_STATEMENT),$(ASTCFLAGS)) -CC_LDFLAGS_SO=$(PTHREAD_CFLAGS) $(ASTLDFLAGS) $(SOLINK) -CXX_LDFLAGS_SO=$(PTHREAD_CFLAGS) $(ASTLDFLAGS) $(SOLINK) + +ifeq ($(GNU_LD),1) +SO_SUPPRESS_SYMBOLS=-Wl,--version-script,$(if $(wildcard $(subst .so,.exports,$@)),$(subst .so,.exports,$@),$(ASTTOPDIR)/default.exports) +endif + +CC_LDFLAGS_SO=$(PTHREAD_CFLAGS) $(ASTLDFLAGS) $(SOLINK) $(SO_SUPPRESS_SYMBOLS) +CXX_LDFLAGS_SO=$(PTHREAD_CFLAGS) $(ASTLDFLAGS) $(SOLINK) $(SO_SUPPRESS_SYMBOLS) CC_LIBS=$(PTHREAD_LIBS) $(LIBS) CXX_LIBS=$(PTHREAD_LIBS) $(LIBS) diff --git a/build_tools/strip_nonapi b/build_tools/strip_nonapi deleted file mode 100755 index ade30c978..000000000 --- a/build_tools/strip_nonapi +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh -e - -# This script is designed to remove all non-API global symbols from an object -# file. The only global symbols that should be retained are those that belong -# to the official namespace. Unfortunately doing this is platform-specific, as -# the object file manipulation tools are not consistent across platforms. -# -# On platforms where this script does not know what to do, the object file -# will retain non-API global symbols, and this may have unpleasant side effects. -# -# Prefixes that belong to the official namespace are: -# ast_ -# _ast_ -# __ast_ -# astman_ -# pbx_ - -case "${PROC}" in - powerpc64) - TEXTSYM=" D " - ;; - *) - TEXTSYM=" T " - ;; -esac - -FILTER="${GREP} -v -e ^ast_ -e ^_ast_ -e ^__ast_ -e ^astman_ -e ^pbx_" - -case "${OSARCH}" in - linux-gnu) - nm ${1} | ${GREP} -e "$TEXTSYM" | cut -d" " -f3 | ${FILTER} > striplist - sed -e "s/^/-N /" striplist | xargs -n 40 ${STRIP} ${1} - rm -f striplist - ;; - *) - ;; -esac diff --git a/default.exports b/default.exports new file mode 100644 index 000000000..5e767549c --- /dev/null +++ b/default.exports @@ -0,0 +1,4 @@ +{ + local: + *; +}; diff --git a/include/asterisk/astobj2.h b/include/asterisk/astobj2.h index dd154ec85..ec841b888 100644 --- a/include/asterisk/astobj2.h +++ b/include/asterisk/astobj2.h @@ -188,15 +188,15 @@ int ao2_ref(void *o, int delta); #ifndef DEBUG_THREADS int ao2_lock(void *a); #else -#define ao2_lock(a) _ao2_lock(a, __FILE__, __PRETTY_FUNCTION__, __LINE__, #a) -int _ao2_lock(void *a, const char *file, const char *func, int line, const char *var); +#define ao2_lock(a) __ao2_lock(a, __FILE__, __PRETTY_FUNCTION__, __LINE__, #a) +int __ao2_lock(void *a, const char *file, const char *func, int line, const char *var); #endif #ifndef DEBUG_THREADS int ao2_trylock(void *a); #else -#define ao2_trylock(a) _ao2_trylock(a, __FILE__, __PRETTY_FUNCTION__, __LINE__, #a) -int _ao2_trylock(void *a, const char *file, const char *func, int line, const char *var); +#define ao2_trylock(a) __ao2_trylock(a, __FILE__, __PRETTY_FUNCTION__, __LINE__, #a) +int __ao2_trylock(void *a, const char *file, const char *func, int line, const char *var); #endif /*! @@ -208,8 +208,8 @@ int _ao2_trylock(void *a, const char *file, const char *func, int line, const ch #ifndef DEBUG_THREADS int ao2_unlock(void *a); #else -#define ao2_unlock(a) _ao2_unlock(a, __FILE__, __PRETTY_FUNCTION__, __LINE__, #a) -int _ao2_unlock(void *a, const char *file, const char *func, int line, const char *var); +#define ao2_unlock(a) __ao2_unlock(a, __FILE__, __PRETTY_FUNCTION__, __LINE__, #a) +int __ao2_unlock(void *a, const char *file, const char *func, int line, const char *var); #endif /*! diff --git a/main/Makefile b/main/Makefile index c8a878378..0b83191e0 100644 --- a/main/Makefile +++ b/main/Makefile @@ -94,6 +94,10 @@ ifeq ($(OSARCH),SunOS) ASTLINK= endif +ifeq ($(GNU_LD),1) +ASTLINK+=-Wl,--version-script,asterisk.exports +endif + editline/libedit.a: cd editline && test -f config.h || CFLAGS="$(PTHREAD_CFLAGS) $(subst $(ASTTOPDIR),../../,$(ASTCFLAGS:-Werror=))" LDFLAGS="$(ASTLDFLAGS)" ./configure --build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) --with-ncurses=$(NCURSES_DIR) --with-curses=$(CURSES_DIR) --with-termcap=$(TERMCAP_DIR) --with-tinfo=$(TINFO_DIR) $(MAKE) -C editline libedit.a @@ -133,20 +137,19 @@ else H323LDLIBS= endif -asterisk: $(OBJS) editline/libedit.a db1-ast/libdb1.a $(AST_EMBED_LDSCRIPTS) +asterisk: $(OBJS) editline/libedit.a db1-ast/libdb1.a $(AST_EMBED_LDSCRIPTS) asterisk.exports @$(ASTTOPDIR)/build_tools/make_build_h > $(ASTTOPDIR)/include/asterisk/build.h.tmp @if cmp -s $(ASTTOPDIR)/include/asterisk/build.h.tmp $(ASTTOPDIR)/include/asterisk/build.h ; then echo ; else \ mv $(ASTTOPDIR)/include/asterisk/build.h.tmp $(ASTTOPDIR)/include/asterisk/build.h ; \ fi @rm -f $(ASTTOPDIR)/include/asterisk/build.h.tmp @$(CC) -c -o buildinfo.o $(ASTCFLAGS) buildinfo.c - $(ECHO_PREFIX) echo " [LD] $^ -> $@" + $(ECHO_PREFIX) echo " [LD] $(OBJS) editline/libedit.a db1-ast/libdb1.a $(AST_EMBED_LDSCRIPTS) -> $@" ifneq ($(findstring chan_h323,$(MENUSELECT_CHANNELS)),) - $(CMD_PREFIX) $(CC) $(STATIC_BUILD) -o $@ $(ASTLINK) $(AST_EMBED_LDFLAGS) $(ASTLDFLAGS) $^ buildinfo.o $(AST_LIBS) $(AST_EMBED_LIBS) + $(CMD_PREFIX) $(CC) $(STATIC_BUILD) -o $@ $(ASTLINK) $(AST_EMBED_LDFLAGS) $(ASTLDFLAGS) $(OBJS) editline/libedit.a db1-ast/libdb1.a $(AST_EMBED_LDSCRIPTS) buildinfo.o $(AST_LIBS) $(AST_EMBED_LIBS) else - $(CMD_PREFIX) $(CXX) $(STATIC_BUILD) -o $@ $(ASTLINK) $(AST_EMBED_LDFLAGS) $(ASTLDFLAGS) $(H323LDFLAGS) $^ buildinfo.o $(AST_LIBS) $(AST_EMBED_LIBS) $(H323LDLIBS) + $(CMD_PREFIX) $(CXX) $(STATIC_BUILD) -o $@ $(ASTLINK) $(AST_EMBED_LDFLAGS) $(ASTLDFLAGS) $(H323LDFLAGS) $(OBJS) editline/libedit.a db1-ast/libdb1.a $(AST_EMBED_LDSCRIPTS) buildinfo.o $(AST_LIBS) $(AST_EMBED_LIBS) $(H323LDLIBS) endif - $(CMD_PREFIX) $(ASTTOPDIR)/build_tools/strip_nonapi $@ || rm $@ clean:: rm -f asterisk diff --git a/main/asterisk.exports b/main/asterisk.exports new file mode 100644 index 000000000..f18c0fff0 --- /dev/null +++ b/main/asterisk.exports @@ -0,0 +1,28 @@ +{ + global: + ast_*; + _ast_*; + __ast_*; + pbx_*; + astman_*; + ao2_*; + __ao2_*; + option_debug; + option_verbose; + dahdi_chan_name; + dahdi_chan_name_len; + dahdi_chan_mode; + cid_di; + cid_dr; + clidsb; + MD5*; + sched_*; + io_*; + jb_*; + channelreloadreason2txt; + devstate2str; + manager_event; + dialed_interface_info; + local: + *; +}; diff --git a/main/astobj2.c b/main/astobj2.c index 56ab75a21..8157c78cf 100644 --- a/main/astobj2.c +++ b/main/astobj2.c @@ -128,7 +128,7 @@ static inline struct astobj2 *INTERNAL_OBJ(void *user_data) #ifndef DEBUG_THREADS int ao2_lock(void *user_data) #else -int _ao2_lock(void *user_data, const char *file, const char *func, int line, const char *var) +int __ao2_lock(void *user_data, const char *file, const char *func, int line, const char *var) #endif { struct astobj2 *p = INTERNAL_OBJ(user_data); @@ -150,7 +150,7 @@ int _ao2_lock(void *user_data, const char *file, const char *func, int line, con #ifndef DEBUG_THREADS int ao2_trylock(void *user_data) #else -int _ao2_trylock(void *user_data, const char *file, const char *func, int line, const char *var) +int __ao2_trylock(void *user_data, const char *file, const char *func, int line, const char *var) #endif { struct astobj2 *p = INTERNAL_OBJ(user_data); @@ -177,7 +177,7 @@ int _ao2_trylock(void *user_data, const char *file, const char *func, int line, #ifndef DEBUG_THREADS int ao2_unlock(void *user_data) #else -int _ao2_unlock(void *user_data, const char *file, const char *func, int line, const char *var) +int __ao2_unlock(void *user_data, const char *file, const char *func, int line, const char *var) #endif { struct astobj2 *p = INTERNAL_OBJ(user_data); diff --git a/makeopts.in b/makeopts.in index 790ba6e86..f680cd76d 100644 --- a/makeopts.in +++ b/makeopts.in @@ -43,6 +43,8 @@ GC_LDFLAGS=@GC_LDFLAGS@ PTHREAD_CFLAGS=@PTHREAD_CFLAGS@ PTHREAD_LIBS=@PTHREAD_LIBS@ +GNU_LD=@GNU_LD@ + prefix = @prefix@ exec_prefix = @exec_prefix@ diff --git a/res/res_adsi.exports b/res/res_adsi.exports new file mode 100644 index 000000000..a4119dc1f --- /dev/null +++ b/res/res_adsi.exports @@ -0,0 +1,33 @@ +{ + global: + ast_adsi_available; + ast_adsi_begin_download; + ast_adsi_channel_restore; + ast_adsi_clear_screen; + ast_adsi_clear_soft_keys; + ast_adsi_connect_session; + ast_adsi_data_mode; + ast_adsi_disconnect_session; + ast_adsi_display; + ast_adsi_download_connect; + ast_adsi_download_disconnect; + ast_adsi_end_download; + ast_adsi_get_cpeid; + ast_adsi_get_cpeinfo; + ast_adsi_input_control; + ast_adsi_input_format; + ast_adsi_load_session; + ast_adsi_load_soft_key; + ast_adsi_print; + ast_adsi_query_cpeid; + ast_adsi_query_cpeinfo; + ast_adsi_read_encoded_dtmf; + ast_adsi_set_keys; + ast_adsi_set_line; + ast_adsi_transmit_message; + ast_adsi_transmit_message_full; + ast_adsi_unload_session; + ast_adsi_voice_mode; + local: + *; +}; diff --git a/res/res_agi.exports b/res/res_agi.exports new file mode 100644 index 000000000..e1b11968f --- /dev/null +++ b/res/res_agi.exports @@ -0,0 +1,7 @@ +{ + global: + ast_agi_register; + ast_agi_unregister; + local: + *; +}; diff --git a/res/res_config_odbc.c b/res/res_config_odbc.c index 7f11b5db3..5c3c1f669 100644 --- a/res/res_config_odbc.c +++ b/res/res_config_odbc.c @@ -558,7 +558,7 @@ static int load_module (void) return 0; } -AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS, "ODBC Configuration", +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "ODBC Configuration", .load = load_module, .unload = unload_module, ); diff --git a/res/res_config_pgsql.c b/res/res_config_pgsql.c index 494497033..986223480 100644 --- a/res/res_config_pgsql.c +++ b/res/res_config_pgsql.c @@ -835,7 +835,7 @@ static int realtime_pgsql_status(int fd, int argc, char **argv) } /* needs usecount semantics defined */ -AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS, "PostgreSQL RealTime Configuration Driver", +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "PostgreSQL RealTime Configuration Driver", .load = load_module, .unload = unload_module, .reload = reload diff --git a/res/res_crypto.c b/res/res_crypto.c index c2c33d015..8fd78c498 100644 --- a/res/res_crypto.c +++ b/res/res_crypto.c @@ -624,7 +624,7 @@ static int unload_module(void) } /* needs usecount semantics defined */ -AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS, "Cryptographic Digital Signatures", +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Cryptographic Digital Signatures", .load = load_module, .unload = unload_module, .reload = reload diff --git a/res/res_features.exports b/res/res_features.exports new file mode 100644 index 000000000..344a652c8 --- /dev/null +++ b/res/res_features.exports @@ -0,0 +1,13 @@ +{ + global: + ast_bridge_call; + ast_masq_park_call; + ast_park_call; + ast_parking_ext; + ast_pickup_call; + ast_pickup_ext; + ast_register_feature; + ast_unregister_feature; + local: + *; +}; diff --git a/res/res_indications.c b/res/res_indications.c index 9bff10b76..b1c948c95 100644 --- a/res/res_indications.c +++ b/res/res_indications.c @@ -399,7 +399,7 @@ static int reload(void) return ind_load_module(); } -AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS, "Indications Resource", +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Indications Resource", .load = load_module, .unload = unload_module, .reload = reload, diff --git a/res/res_jabber.exports b/res/res_jabber.exports new file mode 100644 index 000000000..8df1fee0e --- /dev/null +++ b/res/res_jabber.exports @@ -0,0 +1,13 @@ +{ + global: + ast_aji_create_chat; + ast_aji_disconnect; + ast_aji_get_client; + ast_aji_get_clients; + ast_aji_increment_mid; + ast_aji_invite_chat; + ast_aji_join_chat; + ast_aji_send; + local: + *; +}; diff --git a/res/res_monitor.exports b/res/res_monitor.exports new file mode 100644 index 000000000..4352dc8b6 --- /dev/null +++ b/res/res_monitor.exports @@ -0,0 +1,11 @@ +{ + global: + ast_monitor_change_fname; + ast_monitor_pause; + ast_monitor_setjoinfiles; + ast_monitor_start; + ast_monitor_stop; + ast_monitor_unpause; + local: + *; +}; diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c index cd8bb3e10..95fe16ec2 100644 --- a/res/res_musiconhold.c +++ b/res/res_musiconhold.c @@ -1486,7 +1486,7 @@ static int unload_module(void) return res; } -AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS, "Music On Hold Resource", +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Music On Hold Resource", .load = load_module, .unload = unload_module, .reload = reload, diff --git a/res/res_odbc.exports b/res/res_odbc.exports new file mode 100644 index 000000000..1e38d49da --- /dev/null +++ b/res/res_odbc.exports @@ -0,0 +1,11 @@ +{ + global: + ast_odbc_backslash_is_escape; + ast_odbc_prepare_and_execute; + ast_odbc_release_obj; + ast_odbc_request_obj; + ast_odbc_sanity_check; + ast_odbc_smart_execute; + local: + *; +}; diff --git a/res/res_smdi.exports b/res/res_smdi.exports new file mode 100644 index 000000000..7fe3edff3 --- /dev/null +++ b/res/res_smdi.exports @@ -0,0 +1,18 @@ +{ + global: + ast_smdi_interface_find; + ast_smdi_interface_unref; + ast_smdi_md_message_destroy; + ast_smdi_md_message_pop; + ast_smdi_md_message_putback; + ast_smdi_md_message_wait; + ast_smdi_mwi_message_destroy; + ast_smdi_mwi_message_pop; + ast_smdi_mwi_message_putback; + ast_smdi_mwi_message_wait; + ast_smdi_mwi_message_wait_station; + ast_smdi_mwi_set; + ast_smdi_mwi_unset; + local: + *; +}; diff --git a/res/res_snmp.c b/res/res_snmp.c index 6bbf23171..5ec0419ad 100644 --- a/res/res_snmp.c +++ b/res/res_snmp.c @@ -109,7 +109,7 @@ static int unload_module(void) return ((thread != AST_PTHREADT_NULL) ? pthread_join(thread, NULL) : 0); } -AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS, "SNMP [Sub]Agent for Asterisk", +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "SNMP [Sub]Agent for Asterisk", .load = load_module, .unload = unload_module, ); diff --git a/res/res_speech.exports b/res/res_speech.exports new file mode 100644 index 000000000..226660735 --- /dev/null +++ b/res/res_speech.exports @@ -0,0 +1,21 @@ +{ + global: + ast_speech_change; + ast_speech_change_results_type; + ast_speech_change_state; + ast_speech_destroy; + ast_speech_dtmf; + ast_speech_grammar_activate; + ast_speech_grammar_deactivate; + ast_speech_grammar_load; + ast_speech_grammar_unload; + ast_speech_new; + ast_speech_register; + ast_speech_results_free; + ast_speech_results_get; + ast_speech_start; + ast_speech_unregister; + ast_speech_write; + local: + *; +}; |