From cae654385e6151ddbcca88838cf867976d4bb65f Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sun, 6 Mar 2011 20:20:55 +0000 Subject: [PATCH] Only export from libsensors symbols which are actually public (i.e. listed in the public header files and documented in the manual page.) Patch from Cristian Rodriguez . git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5939 7894878c-1315-0410-8ee3-d5d059ff63e0 --- CHANGES | 1 + lib/Module.mk | 2 +- lib/libsensors.map | 23 +++++++++++++++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 lib/libsensors.map diff --git a/CHANGES b/CHANGES index 9431790f..270a2cd1 100644 --- a/CHANGES +++ b/CHANGES @@ -8,6 +8,7 @@ SVN HEAD Compute MAX_*_SENSOR_TYPES at build time (#2378) Add support for new sysfs attributes Add support for humidity sensors + Limit symbol visibility sensors.conf.default: Add a section for the W83627THF Add a section for the SCH5127 Add a section for the W83627UHG diff --git a/lib/Module.mk b/lib/Module.mk index af8c14fd..cce8f955 100644 --- a/lib/Module.mk +++ b/lib/Module.mk @@ -63,7 +63,7 @@ LIBHEADERFILES := $(MODULE_DIR)/error.h $(MODULE_DIR)/sensors.h # How to create the shared library $(MODULE_DIR)/$(LIBSHLIBNAME): $(LIBSHOBJECTS) - $(CC) -shared $(LDFLAGS) -Wl,-soname,$(LIBSHSONAME) -o $@ $^ -lc -lm + $(CC) -shared $(LDFLAGS) -Wl,--version-script=$(LIB_DIR)/libsensors.map -Wl,-soname,$(LIBSHSONAME) -o $@ $^ -lc -lm $(MODULE_DIR)/$(LIBSHSONAME): $(MODULE_DIR)/$(LIBSHLIBNAME) $(RM) $@ diff --git a/lib/libsensors.map b/lib/libsensors.map new file mode 100644 index 00000000..5e2dac03 --- /dev/null +++ b/lib/libsensors.map @@ -0,0 +1,23 @@ +{ +global: + libsensors_version; + sensors_cleanup; + sensors_do_chip_sets; + sensors_free_chip_name; + sensors_get_adapter_name; + sensors_get_all_subfeatures; + sensors_get_detected_chips; + sensors_get_features; + sensors_get_label; + sensors_get_subfeature; + sensors_get_value; + sensors_init; + sensors_parse_chip_name; + sensors_set_value; + sensors_snprintf_chip_name; + sensors_strerror; + sensors_parse_error; + sensors_parse_error_wfn; + sensors_fatal_error; +local: *; + };