aspell-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[aspell-devel] reducing the number of symbols exported by libaspell


From: Dan Nicolaescu
Subject: [aspell-devel] reducing the number of symbols exported by libaspell
Date: Tue, 24 Jan 2006 15:51:17 -0800

Hi!

It seems that aspell does not take any measure to reduce the number of
externally visible symbols in libaspell.so. 
Reducing the number of symbols reduces the dynamic linking time, but
also the binary size.


Here's an example: 

size -f .libs-original/libaspell.so.15.1.4  .libs/libaspell.so.15.1.4
   text    data     bss     dec     hex filename
 737724   14016   16216  767956   bb7d4 .libs-original/libaspell.so.15.1.4
 684940   13412   16216  714568   ae748 .libs/libaspell.so.15.1.4


The second version of libaspell.so was created by adding
-Wl,-version-script -Wl,/tmp/aspell.script
to the gcc command line that creates libaspell.so: 

/tmp/aspell.script is included below.

This is just a proof of concept, I was just playing with this stuff and used
aspell as an example. 

Using -fvisibility, #pragma GCC visibility and/or the visibility
attribute is probably better than the above solution. But this was
just a proof of concept to see the advantages of reducing the number
of exported symbols. 

I won't try to integrate this in aspell, but if someone wants to do
it, and needs some help, I would be glad to help. 

Thanks
                --dan



/tmp/aspell.script

{ global:

# Big hammer: make visible all the symbols that the aspell binaries seems to 
need, this can be more fine grained.
_ZN7acommon*;
 _ZNK7acommon*;
 _ZTVN7acommon*;
  _ZN8aspeller*;
 _ZNK8aspeller*;


 aspell_gettext_init;

#Big hammer again: make all the functions in aspell.h global
 aspell_mutable_container_add;
aspell_mutable_container_remove;
aspell_mutable_container_clear;
aspell_mutable_container_to_mutable_container;
aspell_key_info_enumeration_at_end;
aspell_key_info_enumeration_next;
delete_aspell_key_info_enumeration;
aspell_key_info_enumeration_clone;
aspell_key_info_enumeration_assign;
new_aspell_config;
delete_aspell_config;
aspell_config_clone;
aspell_config_assign;
aspell_config_error_number;
aspell_config_error_message;
aspell_config_error;
aspell_config_set_extra;
aspell_config_keyinfo;
aspell_config_possible_elements;
aspell_config_get_default;
aspell_config_elements;
aspell_config_replace;
aspell_config_remove;
aspell_config_have;
aspell_config_retrieve;
aspell_config_retrieve_list;
aspell_config_retrieve_bool;
aspell_config_retrieve_int;
aspell_error_is_a;
aspell_error_number;
aspell_error_message;
aspell_error;
delete_aspell_can_have_error;
new_aspell_speller;
to_aspell_speller;
delete_aspell_speller;
aspell_speller_error_number;
aspell_speller_error_message;
aspell_speller_error;
aspell_speller_config;
aspell_speller_check;
aspell_speller_add_to_personal;
aspell_speller_add_to_session;
aspell_speller_personal_word_list;
aspell_speller_session_word_list;
aspell_speller_main_word_list;
aspell_speller_save_all_word_lists;
aspell_speller_clear_session;
aspell_speller_suggest;
aspell_speller_store_replacement;
delete_aspell_filter;
aspell_filter_error_number;
aspell_filter_error_message;
aspell_filter_error;
to_aspell_filter;
delete_aspell_document_checker;
aspell_document_checker_error_number;
aspell_document_checker_error_message;
aspell_document_checker_error;
new_aspell_document_checker;
to_aspell_document_checker;
aspell_document_checker_reset;
aspell_document_checker_next_misspelling;
aspell_document_checker_filter;
aspell_word_list_empty;
aspell_word_list_size;
aspell_word_list_elements;
delete_aspell_string_enumeration;
aspell_string_enumeration_clone;
aspell_string_enumeration_assign;
aspell_string_enumeration_at_end;
aspell_string_enumeration_next;
get_aspell_module_info_list;
aspell_module_info_list_empty;
aspell_module_info_list_size;
aspell_module_info_list_elements;
get_aspell_dict_info_list;
aspell_dict_info_list_empty;
aspell_dict_info_list_size;
aspell_dict_info_list_elements;
aspell_module_info_enumeration_at_end;
aspell_module_info_enumeration_next;
delete_aspell_module_info_enumeration;
aspell_module_info_enumeration_clone;
aspell_module_info_enumeration_assign;
aspell_dict_info_enumeration_at_end;
aspell_dict_info_enumeration_next;
delete_aspell_dict_info_enumeration;
aspell_dict_info_enumeration_clone;
aspell_dict_info_enumeration_assign;
new_aspell_string_list;
aspell_string_list_empty;
aspell_string_list_size;
aspell_string_list_elements;
aspell_string_list_add;
aspell_string_list_remove;
aspell_string_list_clear;
aspell_string_list_to_mutable_container;
delete_aspell_string_list;
aspell_string_list_clone;
aspell_string_list_assign;
new_aspell_string_map;
aspell_string_map_add;
aspell_string_map_remove;
aspell_string_map_clear;
aspell_string_map_to_mutable_container;
delete_aspell_string_map;
aspell_string_map_clone;
aspell_string_map_assign;
aspell_string_map_empty;
aspell_string_map_size;
aspell_string_map_elements;
aspell_string_map_insert;
aspell_string_map_replace;
aspell_string_map_lookup;
aspell_string_pair_enumeration_at_end;
aspell_string_pair_enumeration_next;
delete_aspell_string_pair_enumeration;
aspell_string_pair_enumeration_clone;
aspell_string_pair_enumeration_assign;
aspell_reset_cache;

# some data structures in aspell.h, they might not be needed here
aerror_other;
aerror_operation_not_supported;
  aerror_cant_copy;
  aerror_unimplemented_method;
aerror_file;
  aerror_cant_open_file;
    aerror_cant_read_file;
    aerror_cant_write_file;
  aerror_invalid_name;
  aerror_bad_file_format;
aerror_dir;
  aerror_cant_read_dir;
aerror_config;
  aerror_unknown_key;
  aerror_cant_change_value;
  aerror_bad_key;
  aerror_bad_value;
  aerror_duplicate;
  aerror_key_not_string;
  aerror_key_not_int;
  aerror_key_not_bool;
  aerror_key_not_list;
  aerror_no_value_reset;
  aerror_no_value_enable;
  aerror_no_value_disable;
  aerror_no_value_clear;
aerror_language_related;
  aerror_unknown_language;
  aerror_unknown_soundslike;
  aerror_language_not_supported;
  aerror_no_wordlist_for_lang;
  aerror_mismatched_language;
aerror_affix;
  aerror_corrupt_affix;
  aerror_invalid_cond;
  aerror_invalid_cond_strip;
  aerror_incorrect_encoding;
aerror_encoding;
  aerror_unknown_encoding;
  aerror_encoding_not_supported;
  aerror_conversion_not_supported;
aerror_pipe;
  aerror_cant_create_pipe;
  aerror_process_died;
aerror_bad_input;
  aerror_invalid_string;
  aerror_invalid_word;
  aerror_invalid_affix;
  aerror_inapplicable_affix;
  aerror_unknown_unichar;
  aerror_word_list_flags;
    aerror_invalid_flag;
    aerror_conflicting_flags;
aerror_version_control;
  aerror_bad_version_string;
aerror_filter;
  aerror_cant_dlopen_file;
  aerror_empty_filter;
  aerror_no_such_filter;
  aerror_confusing_version;
  aerror_bad_version;
  aerror_identical_option;
  aerror_options_only;
  aerror_invalid_option_modifier;
  aerror_cant_describe_filter;
aerror_filter_mode_file;
  aerror_mode_option_name;
  aerror_no_filter_to_option;
  aerror_bad_mode_key;
  aerror_expect_mode_key;
  aerror_mode_version_requirement;
  aerror_confusing_mode_version;
  aerror_bad_mode_version;
  aerror_missing_magic_expression;
  aerror_empty_file_ext;
aerror_filter_mode_expand;
  aerror_unknown_mode;
  aerror_mode_extend_expand;
aerror_filter_mode_magic;
  aerror_file_magic_pos;
  aerror_file_magic_range;
  aerror_missing_magic;
  aerror_bad_magic;
aerror_expression;
  aerror_invalid_expression;
 local: *; };

 
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]