This patch adds support for symbol versions. It is based on what
libvirt does.
The generated syms file looks like:
LIBNBD_1.0 {
global:
nbd_...;
nbd_...;
local: *;
};
In a future stable 1.2 release, new symbols would go into a new
section which would look like this:
LIBNBD_1.2 {
global:
nbd_new_symbol;
nbd_another_new_symbol;
local: *;
} LIBNBD_1.0;
In my testing the ‘local:’ label is needed. For some reason libvirt
doesn’t use it.
The change appears to be working in as much as I can see the symbol
versions appearing, and the test/example programs continue to run.
$ nm -D --with-symbol-versions lib/.libs/libnbd.so.0 | grep LIBNBD
0000000000000000 A LIBNBD_1.0@(a)LIBNBD_1.0
0000000000005470 T nbd_add_meta_context@(a)LIBNBD_1.0
00000000000085d0 T nbd_aio_block_status@(a)LIBNBD_1.0
0000000000008710 T nbd_aio_block_status_callback@(a)LIBNBD_1.0
0000000000008110 T nbd_aio_cache@(a)LIBNBD_1.0
0000000000008230 T nbd_aio_cache_callback@(a)LIBNBD_1.0
00000000000089e0 T nbd_aio_command_completed@(a)LIBNBD_1.0
0000000000006f20 T nbd_aio_connect@(a)LIBNBD_1.0
0000000000007320 T nbd_aio_connect_command@(a)LIBNBD_1.0
[etc]
$ nm -D --with-symbol-versions examples/.libs/glib-main-loop | grep LIBNBD
U nbd_aio_connect_command(a)LIBNBD_1.0
U nbd_aio_get_direction(a)LIBNBD_1.0
U nbd_aio_get_fd(a)LIBNBD_1.0
U nbd_aio_in_flight(a)LIBNBD_1.0
U nbd_aio_is_ready(a)LIBNBD_1.0
U nbd_aio_notify_read(a)LIBNBD_1.0
U nbd_aio_notify_write(a)LIBNBD_1.0
U nbd_aio_peek_command_completed(a)LIBNBD_1.0
U nbd_aio_pread_callback(a)LIBNBD_1.0
U nbd_aio_pwrite_callback(a)LIBNBD_1.0
U nbd_close(a)LIBNBD_1.0
U nbd_create(a)LIBNBD_1.0
U nbd_get_debug(a)LIBNBD_1.0
U nbd_get_error(a)LIBNBD_1.0
Rich.