diff mbox

[05/16] ibcm: Actually use the version script when linking

Message ID 1474409425-15769-6-git-send-email-jgunthorpe@obsidianresearch.com (mailing list archive)
State Accepted
Headers show

Commit Message

Jason Gunthorpe Sept. 20, 2016, 10:10 p.m. UTC
There is a typo in the Makefile.am that resulted in the version
script being ignored.

This changes the symbol names in the shlib, eg
    50: 0000000000001620   530 FUNC    GLOBAL DEFAULT   11 ib_cm_open_device
becomes
    46: 00000000000015f0   530 FUNC    GLOBAL DEFAULT   12 ib_cm_open_device@@IBCM_1.0

Binaries linked to the old library will continue to work with the new one.

Binaries linked to the new library will print a dynamic linker warning when
using the old library:

  ./a.out: /usr/lib/x86_64-linux-gnu/libibcm.so.1: no version information available (required by ./a.out)

But apparently continue to work.

Drepper (https://www.akkadia.org/drepper/symbol-versioning) seems to indicate
that going forward if we do decide to rev a symbol version then resolution for
binaries linked to the old library will continue to prefer the IBCM_1.0
symbol.  This makes sense as it is the basic mechanism used to introduce
symbol versions in the first place.

Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
---
 libibcm/Makefile.am | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/libibcm/Makefile.am b/libibcm/Makefile.am
index e4be9f887b1c..ff0b1ded12a3 100644
--- a/libibcm/Makefile.am
+++ b/libibcm/Makefile.am
@@ -8,9 +8,9 @@  AM_CFLAGS = -g -Wall
 src_libibcm_la_CFLAGS = $(AM_CFLAGS)
 
 if HAVE_LD_VERSION_SCRIPT
-    ibcm_version_script = -Wl,--version-script=$(srcdir)/src/libibcm.map
+    libibcm_version_script = -Wl,--version-script=$(srcdir)/src/libibcm.map
 else
-    ibcm_version_script =
+    libibcm_version_script =
 endif
 
 src_libibcm_la_SOURCES = src/cm.c