1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
lvm2/lib
Bryn M. Reeves 82a27a85b5 macros: fix default symbol export control
Fix the version export macros to make it possible to export two
different DM_* versions of a symbol: currently it is only possible for a
DM_* symbol to override a symbol in Base. Attempting to export two
symbols at different DM_* version levels (e.g. DM_1_02_104 and
DM_1_02_106) leads to a linker error due to a duplicate symbol
definition.

This is because the DM_EXPORTED_SYMBOL macro makes each exported symbol
the default (@@VERSION):

       __asm__(".symver " #func "_v" #ver ", " #func "@@DM_" #ver )

Fix the macro to use a single '@' for a symbols exported in multiple
versions and rename the macros to DM_EXPORT_*:

  DM_EXPORT_SYMBOL(func,ver)
  DM_EXPORT_SYMBOL_BASE(func,ver)

For functions that have multiple implementations these macros control
symbol export and versioning.

Function definitions that exist in only one version never need to use
these macros.

Backwards compatible implementations must include a version tag of
the form "_v1_02_104" as a suffix to the function name and use the
macro DM_EXPORT_SYMBOL to export the function and bind it to the
specified version string.

Since versioning is only available when compiling with GCC the entire
compatibility version should be enclosed in '#if defined(__GNUC__)',
for example:

  int dm_foo(int bar)
  {
    return bar;
  }

  #if defined(__GNUC__)
  // Backward compatible dm_foo() version 1.02.104
  int dm_foo_v1_02_104(void);
  int dm_foo_v1_02_104(void)
  {
    return 0;
  }
  DM_EXPORT_SYMBOL(dm_foo,1_02_104)
  #endif

A prototype for the compatibility version is required as these
functions must not be declared static.

The DM_EXPORT_SYMBOL_BASE macro is only used to export the base
versions of library symbols prior to the introduction of symbol
versioning: it must never be used for new symbols.
2015-08-24 20:03:21 +01:00
..
activate config: {thin,cache}_{check,repair}_options are never undefined 2015-07-14 10:13:41 +02:00
cache Revert "lvmcache: check for too long pvid" 2015-08-18 15:22:13 +02:00
cache_segtype cleanup: indent 2015-08-12 14:33:16 +02:00
commands vgremove: fix locking when lvmlockd global lock is removed 2015-08-10 13:04:11 -05:00
config config: improve description text layout 2015-08-18 14:02:32 -05:00
datastruct datastruct: Add str_list_add_list. 2015-03-26 18:30:37 +00:00
device device: Don't try to close config file on failure. 2015-08-17 12:57:01 +01:00
display libdm: Add dm_size_to_string to libdevmapper. 2015-07-27 21:30:20 +01:00
error segtype: drop cmdcontex pointer 2014-10-30 23:58:49 +01:00
filters config: use timestamp with nanosecond precision 2015-03-18 13:42:56 +01:00
format1 coverity: check vg->lvm1_system_id is not NULL before calling strncmp with that 2015-08-04 10:35:31 +02:00
format_pool cache: Store metadata size and checksum. 2015-03-18 23:43:02 +00:00
format_text Revert "lvmcache: check for too long pvid" 2015-08-18 15:22:13 +02:00
freeseg segtype: drop cmdcontex pointer 2014-10-30 23:58:49 +01:00
label cleanup: trace error from lvmcache_update_vgname_and_id 2015-08-18 15:00:08 +02:00
locking vgremove: fix locking when lvmlockd global lock is removed 2015-08-10 13:04:11 -05:00
log coverity: fix cppcheck warnings 2015-08-04 09:33:55 +02:00
lvmpolld lvmpolld: Fix segfault on 32 bit architectures 2015-07-10 16:16:57 +02:00
metadata cleanup: add . 2015-08-21 15:35:45 +02:00
mirror macros: Wrap PRI with FMT. 2015-07-06 15:09:17 +01:00
misc macros: fix default symbol export control 2015-08-24 20:03:21 +01:00
mm config: use find_config_tree_array for all arrays 2015-07-15 10:52:23 +02:00
properties report: add support for time (basic) 2015-06-30 15:15:10 +02:00
raid cleanup: drop unused header file 2015-07-15 13:10:22 +02:00
replicator macros: Wrap PRI with FMT. 2015-07-06 15:09:17 +01:00
report cache: api update 2015-08-12 14:32:24 +02:00
snapshot segtype: add SEG_ONLY_EXCLUSIVE flag 2014-11-10 22:05:48 +01:00
striped segtype: drop cmdcontex pointer 2014-10-30 23:58:49 +01:00
thin thin: restore transaction_id handling 2015-08-17 11:25:03 +02:00
unknown segtype: drop cmdcontex pointer 2014-10-30 23:58:49 +01:00
uuid macros: Wrap PRI with FMT. 2015-07-06 15:09:17 +01:00
zero cleanup: remove unused headers 2014-11-13 17:49:42 +01:00
Makefile.in libdm: Add dm_timestamp functions. 2015-07-29 19:21:07 +01:00