Commit 9259324f authored by Daniel Verkamp's avatar Daniel Verkamp Committed by Jim Harris
Browse files

shared_lib: only export spdk_* symbols



Add a basic linker version script to limit exported symbols to those
intended to be public API.  Currently, many internal-only functions are
also named spdk_*, but this will at least limit exported symbols to
those that will not pollute the global namespace.

This also does not assign a version to any symbols; in the future, we
may want to extend the version script to enable ABI compatibility, but
for now, the version script is just used to control symbol visibility.

Change-Id: I1f020300b3288a026b47e9b1466ebc72952d9401
Signed-off-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/415897


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent f387d321
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -7,7 +7,6 @@
*.kdev4
*.ko
*.log
*.map
*.o
*.pyc
*.so
+2 −1
Original line number Diff line number Diff line
@@ -83,13 +83,14 @@ LIBS += $(ENV_LINKER_ARGS)

comma := ,

$(SHARED_LIB): $(SPDK_LIB_FILES) $(SPDK_WHOLE_LIBS) $(BLOCKDEV_MODULES_FILES) $(COPY_MODULES_FILES) $(NET_MODULES_FILES) $(LINKER_MODULES) $(ENV_LIBS) $(MAKEFILE_LIST)
$(SHARED_LIB): $(SPDK_LIB_FILES) $(SPDK_WHOLE_LIBS) $(BLOCKDEV_MODULES_FILES) $(COPY_MODULES_FILES) $(NET_MODULES_FILES) $(LINKER_MODULES) $(ENV_LIBS) $(MAKEFILE_LIST) spdk.map
	$(Q)echo "  SO $(notdir $@)"; \
	rm -f $@; \
	$(CC) -o $@ -shared $(CPPFLAGS) $(LDFLAGS) \
		-Wl,--whole-archive \
		$(filter-out -Wl$(comma)--no-whole-archive,$(LIBS)) \
		-Wl,--no-whole-archive \
		-Wl,--version-script=spdk.map \
		-lcrypto \
		$(SYS_LIBS)

shared_lib/spdk.map

0 → 100644
+4 −0
Original line number Diff line number Diff line
{
	global: spdk_*;
	local: *;
};