Bug 66949 - Private symbols exported
Summary: Private symbols exported
Status: RESOLVED FIXED
Alias: None
Product: libmbim
Classification: Unclassified
Component: General (show other bugs)
Version: unspecified
Hardware: All All
: medium normal
Assignee: Aleksander Morgado
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-16 06:35 UTC by Thomas Bechtold
Modified: 2013-07-16 08:07 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Patch. (4.58 KB, patch)
2013-07-16 07:34 UTC, Aleksander Morgado
Details | Splinter Review

Description Thomas Bechtold 2013-07-16 06:35:10 UTC
When I build mbim, some private symbols are exported.

nm -g libmbim-glib/.libs/libmbim-glib.so|grep _mbim

000000000000ff40 T _mbim_message_command_builder_append_byte_array
000000000000ff60 T _mbim_message_command_builder_append_guint32
000000000000ff70 T _mbim_message_command_builder_append_guint32_array
000000000000ff80 T _mbim_message_command_builder_append_guint64
000000000000ff90 T _mbim_message_command_builder_append_guint64_array
000000000000ffc0 T _mbim_message_command_builder_append_ipv4
000000000000ffd0 T _mbim_message_command_builder_append_ipv4_array
000000000000ffe0 T _mbim_message_command_builder_append_ipv6
000000000000fff0 T _mbim_message_command_builder_append_ipv6_array
000000000000ffa0 T _mbim_message_command_builder_append_string
000000000000ffb0 T _mbim_message_command_builder_append_string_array
000000000000ff50 T _mbim_message_command_builder_append_uuid
0000000000010c90 T _mbim_message_command_builder_complete
0000000000010c10 T _mbim_message_command_builder_new
00000000000103f0 T _mbim_message_fragment_collector_add
0000000000010540 T _mbim_message_fragment_collector_complete
0000000000010350 T _mbim_message_fragment_collector_init
00000000000102a0 T _mbim_message_fragment_get_current
00000000000102f0 T _mbim_message_fragment_get_payload
0000000000010250 T _mbim_message_fragment_get_total
0000000000010220 T _mbim_message_is_fragment
000000000000f5a0 T _mbim_message_read_byte_array
000000000000f380 T _mbim_message_read_guint32
000000000000f3b0 T _mbim_message_read_guint32_array
000000000000f420 T _mbim_message_read_guint64
000000000000f780 T _mbim_message_read_ipv4
000000000000f7c0 T _mbim_message_read_ipv4_array
000000000000f830 T _mbim_message_read_ipv6
000000000000f870 T _mbim_message_read_ipv6_array
000000000000f450 T _mbim_message_read_string
000000000000f500 T _mbim_message_read_string_array
000000000000f760 T _mbim_message_read_uuid
00000000000105c0 T _mbim_message_split_fragments
000000000000f9b0 T _mbim_struct_builder_append_byte_array
000000000000fb30 T _mbim_struct_builder_append_guint32
000000000000fb50 T _mbim_struct_builder_append_guint32_array
000000000000fb90 T _mbim_struct_builder_append_guint64
000000000000fbb0 T _mbim_struct_builder_append_guint64_array
000000000000fe50 T _mbim_struct_builder_append_ipv4
000000000000fdb0 T _mbim_struct_builder_append_ipv4_array
000000000000ff10 T _mbim_struct_builder_append_ipv6
000000000000fe80 T _mbim_struct_builder_append_ipv6_array
000000000000fbf0 T _mbim_struct_builder_append_string
000000000000fd80 T _mbim_struct_builder_append_string_array
000000000000fb10 T _mbim_struct_builder_append_uuid
000000000000f930 T _mbim_struct_builder_complete
000000000000f8f0 T _mbim_struct_builder_new
000000000000e860 T __mbim_utils_str_hex
Comment 1 Aleksander Morgado 2013-07-16 06:44:39 UTC
Those symbols are used by the unit testers when building the library, and won't be available in any of the installed header files. But I agree that we should not export them if possible.

If you filter them out when building the final library (e.g. -export-symbols-regex '^mbim_.*'), will I be able to still use them for the unit tests?
Comment 2 Thomas Bechtold 2013-07-16 06:55:06 UTC
(In reply to comment #1)
> Those symbols are used by the unit testers when building the library, and
> won't be available in any of the installed header files. But I agree that we
> should not export them if possible.
> 
> If you filter them out when building the final library (e.g.
> -export-symbols-regex '^mbim_.*'), will I be able to still use them for the
> unit tests?

No. Then you get:

test_fragment-test-fragment.o: In function `test_fragment_receive_multiple':
/home/tom/devel/libmbim/libmbim-glib/test/test-fragment.c:119: undefined reference to `_mbim_message_fragment_collector_init'
/home/tom/devel/libmbim/libmbim-glib/test/test-fragment.c:121: undefined reference to `_mbim_message_fragment_get_total'
/home/tom/devel/libmbim/libmbim-glib/test/test-fragment.c:122: undefined reference to `_mbim_message_fragment_get_current'
/home/tom/devel/libmbim/libmbim-glib/test/test-fragment.c:123: undefined reference to `_mbim_message_fragment_collector_complete'
/home/tom/devel/libmbim/libmbim-glib/test/test-fragment.c:128: undefined reference to `_mbim_message_fragment_collector_add'
/home/tom/devel/libmbim/libmbim-glib/test/test-fragment.c:130: undefined reference to `_mbim_message_fragment_get_total'
/home/tom/devel/libmbim/libmbim-glib/test/test-fragment.c:131: undefined reference to `_mbim_message_fragment_get_current'
/home/tom/devel/libmbim/libmbim-glib/test/test-fragment.c:132: undefined reference to `_mbim_message_fragment_collector_complete'
/home/tom/devel/libmbim/libmbim-glib/test/test-fragment.c:136: undefined reference to `_mbim_message_fragment_collector_add'
/home/tom/devel/libmbim/libmbim-glib/test/test-fragment.c:138: undefined reference to `_mbim_message_fragment_get_total'
/home/tom/devel/libmbim/libmbim-glib/test/test-fragment.c:139: undefined reference to `_mbim_message_fragment_get_current'
/home/tom/devel/libmbim/libmbim-glib/test/test-fragment.c:140: undefined reference to `_mbim_message_fragment_collector_complete'
/home/tom/devel/libmbim/libmbim-glib/test/test-fragment.c:144: undefined reference to `_mbim_message_fragment_collector_add'
/home/tom/devel/libmbim/libmbim-glib/test/test-fragment.c:146: undefined reference to `_mbim_message_fragment_get_total'
/home/tom/devel/libmbim/libmbim-glib/test/test-fragment.c:147: undefined reference to `_mbim_message_fragment_get_current'
/home/tom/devel/libmbim/libmbim-glib/test/test-fragment.c:148: undefined reference to `_mbim_message_fragment_collector_complete'
/home/tom/devel/libmbim/libmbim-glib/test/test-fragment.c:149: undefined reference to `_mbim_message_fragment_get_total'
/home/tom/devel/libmbim/libmbim-glib/test/test-fragment.c:150: undefined reference to `_mbim_message_fragment_get_current'
/home/tom/devel/libmbim/libmbim-glib/test/test-fragment.c:154: undefined reference to `_mbim_message_fragment_get_payload'
test_fragment-test-fragment.o: In function `test_fragment_receive_single':
/home/tom/devel/libmbim/libmbim-glib/test/test-fragment.c:46: undefined reference to `_mbim_message_is_fragment'
/home/tom/devel/libmbim/libmbim-glib/test/test-fragment.c:47: undefined reference to `_mbim_message_fragment_get_total'
/home/tom/devel/libmbim/libmbim-glib/test/test-fragment.c:48: undefined reference to `_mbim_message_fragment_get_current'
/home/tom/devel/libmbim/libmbim-glib/test/test-fragment.c:50: undefined reference to `_mbim_message_fragment_get_payload'
test_fragment-test-fragment.o: In function `test_fragment_send_multiple_common':
/home/tom/devel/libmbim/libmbim-glib/test/test-fragment.c:179: undefined reference to `_mbim_message_split_fragments'
collect2: error: ld returned 1 exit status
make[3]: *** [test-fragment] Error 1
make[3]: Leaving directory `/home/tom/devel/libmbim/libmbim-glib/test'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/tom/devel/libmbim/libmbim-glib'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/tom/devel/libmbim'
make: *** [all] Error 2
Comment 3 Aleksander Morgado 2013-07-16 07:03:53 UTC
Ok, let me try to handle that in some other way.
Comment 4 Aleksander Morgado 2013-07-16 07:34:09 UTC
Created attachment 82470 [details] [review]
Patch.

Thomas, what do you think of the attached patch?
Comment 5 Thomas Bechtold 2013-07-16 08:03:30 UTC
(In reply to comment #4)
> Created attachment 82470 [details] [review] [review]
> Patch.
> 
> Thomas, what do you think of the attached patch?

Works for me. Great. Thanks!
Comment 6 Aleksander Morgado 2013-07-16 08:07:16 UTC
Pushed to git master now.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.