From cf37aa990797e520945491134e1e5af4e2107711 Mon Sep 17 00:00:00 2001 From: "Kaleb S. KEITHLEY" Date: Fri, 5 Jan 2018 10:22:45 -0500 Subject: rpc: use export map to minimize exported symbols in libgf{rpc,xdr}.so Without an export map (at link time) libgrpc and libgfxdr export over 150 and 450 symbols each, respectively. Many are not used by anything else. (Unclear what the unused symbols are, some may be simple sloppiness, e.g. not declaring functions static that should be. Others may be intra-library calls that can't be static but aren't part of the API, per se.) By linking with an export map the number of exported symbols is reduced to ~60 and ~250 respectively. This parallels the similar change made to libglusterfs recently and the older changes to the xlators to minimize the symbols that are visible (exported) from the .so. And I don't know, do we want to go all the way to symbol versions? For these libs? And for libglusterfs? fixes gluster/glusterfs#392 Change-Id: I9cdc3eee10e5f1408d7e7f2f29fad597c97e4003 Signed-off-by: Kaleb S. KEITHLEY --- rpc/rpc-lib/src/Makefile.am | 5 +++- rpc/rpc-lib/src/libgfrpc.sym | 65 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 rpc/rpc-lib/src/libgfrpc.sym (limited to 'rpc/rpc-lib/src') diff --git a/rpc/rpc-lib/src/Makefile.am b/rpc/rpc-lib/src/Makefile.am index c07d001b057..95ce812fe7b 100644 --- a/rpc/rpc-lib/src/Makefile.am +++ b/rpc/rpc-lib/src/Makefile.am @@ -4,9 +4,12 @@ libgfrpc_la_SOURCES = auth-unix.c rpcsvc-auth.c rpcsvc.c auth-null.c \ rpc-transport.c xdr-rpc.c xdr-rpcclnt.c rpc-clnt.c auth-glusterfs.c \ rpc-drc.c $(CONTRIBDIR)/sunrpc/xdr_sizeof.c rpc-clnt-ping.c +EXTRA_DIST = libgfrpc.sym + libgfrpc_la_LIBADD = $(top_builddir)/libglusterfs/src/libglusterfs.la \ $(top_builddir)/rpc/xdr/src/libgfxdr.la -libgfrpc_la_LDFLAGS = -version-info $(LIBGFRPC_LT_VERSION) $(GF_LDFLAGS) +libgfrpc_la_LDFLAGS = -version-info $(LIBGFRPC_LT_VERSION) $(GF_LDFLAGS) \ + -export-symbols $(top_srcdir)/rpc/rpc-lib/src/libgfrpc.sym libgfrpc_la_HEADERS = rpcsvc.h rpc-transport.h xdr-common.h xdr-rpc.h xdr-rpcclnt.h \ rpc-clnt.h rpcsvc-common.h protocol-common.h rpc-drc.h rpc-clnt-ping.h \ diff --git a/rpc/rpc-lib/src/libgfrpc.sym b/rpc/rpc-lib/src/libgfrpc.sym new file mode 100644 index 00000000000..37484e435ad --- /dev/null +++ b/rpc/rpc-lib/src/libgfrpc.sym @@ -0,0 +1,65 @@ +is_rpc_clnt_disconnected +rpcclnt_cbk_program_register +rpc_clnt_cleanup_and_start +rpc_clnt_connection_cleanup +rpc_clnt_disable +rpc_clnt_disconnect +rpc_clnt_new +rpc_clnt_reconfig +rpc_clnt_reconnect +rpc_clnt_reconnect_cleanup +rpc_clnt_ref +rpc_clnt_register_notify +rpc_clnt_set_connected +rpc_clnt_start +rpc_clnt_submit +rpc_clnt_unref +rpc_clnt_unset_connected +rpc_reply_to_xdr +rpcsvc_auth_array +rpcsvc_auth_check +rpcsvc_auth_reconf +rpcsvc_auth_unix_auxgids +rpcsvc_callback_submit +rpcsvc_create_listener +rpcsvc_create_listeners +rpcsvc_drc_init +rpcsvc_drc_priv +rpcsvc_drc_reconfigure +rpcsvc_get_program_vector_sizer +rpcsvc_init +rpcsvc_init_options +rpcsvc_listener_destroy +rpcsvc_program_register +rpcsvc_program_register_portmap +rpcsvc_program_unregister +rpcsvc_program_unregister_portmap +rpcsvc_reconfigure_options +rpcsvc_register_notify +rpcsvc_register_portmap_enabled +rpcsvc_request_submit +rpcsvc_set_outstanding_rpc_limit +rpcsvc_set_throttle_on +rpcsvc_submit_generic +rpcsvc_submit_message +rpcsvc_transport_peeraddr +rpcsvc_transport_peername +rpcsvc_transport_privport_check +rpcsvc_transport_unix_options_build +rpcsvc_transport_volume_allowed +rpcsvc_transport_connect +rpcsvc_transport_getpeeraddr +rpcsvc_unregister_notify +rpcsvc_volume_allowed +rpc_transport_count +rpc_transport_connect +rpc_transport_disconnect +rpc_transport_get_peeraddr +rpc_transport_inet_options_build +rpc_transport_keepalive_options_set +rpc_transport_notify +rpc_transport_pollin_alloc +rpc_transport_pollin_destroy +rpc_transport_ref +rpc_transport_unix_options_build +rpc_transport_unref -- cgit