diff --git a/Makefile b/Makefile index 1a5115c72..63fdab2e2 100644 --- a/Makefile +++ b/Makefile @@ -96,8 +96,7 @@ BIN_SRCS := $(SRCS_DIR)/cli/common.c \ $(SRCS_DIR)/error_generic.c \ $(SRCS_DIR)/utils.c -LIB_SCRIPT = $(SRCS_DIR)/$(LIB_NAME).lds -BIN_SCRIPT = $(SRCS_DIR)/cli/$(BIN_NAME).lds +LIB_SCRIPT = $(SRCS_DIR)/$(LIB_NAME).ver ##### Target definitions ##### @@ -221,7 +220,7 @@ $(BIN_OBJS): %.o: %.c | shared $(LIB_SHARED): $(LIB_OBJS) $(MKDIR) -p $(DEBUG_DIR) - $(CC) $(LIB_CFLAGS) $(LIB_CPPFLAGS) $(LIB_LDFLAGS) $(OUTPUT_OPTION) $^ $(LIB_SCRIPT) $(LIB_LDLIBS) + $(CC) $(LIB_CFLAGS) $(LIB_CPPFLAGS) $(LIB_LDFLAGS) $(OUTPUT_OPTION) $^ -Wl,--version-script=$(LIB_SCRIPT) -Wl,-e,nvc_entrypoint -Wl,-u,interpreter -Wl,-u,abitag $(LIB_LDLIBS) $(OBJCPY) --only-keep-debug $@ $(LIB_SONAME) $(OBJCPY) --add-gnu-debuglink=$(LIB_SONAME) $@ $(MV) $(LIB_SONAME) $(DEBUG_DIR) @@ -234,7 +233,7 @@ $(LIB_STATIC_OBJ): $(LIB_OBJS) $(STRIP) --strip-unneeded -R .comment $@ $(BIN_NAME): $(BIN_OBJS) - $(CC) $(BIN_CFLAGS) $(BIN_CPPFLAGS) $(BIN_LDFLAGS) $(OUTPUT_OPTION) $^ $(BIN_SCRIPT) $(BIN_LDLIBS) + $(CC) $(BIN_CFLAGS) $(BIN_CPPFLAGS) $(BIN_LDFLAGS) $(OUTPUT_OPTION) $^ -Wl,-u,argp_err_exit_status -Wl,-u,argp_program_version_hook -Wl,-u,argp_program_bug_address $(BIN_LDLIBS) $(STRIP) --strip-unneeded -R .comment $@ ##### Public rules ##### diff --git a/src/cli/nvidia-container-cli.lds b/src/cli/nvidia-container-cli.lds deleted file mode 100644 index e8a0f63c6..000000000 --- a/src/cli/nvidia-container-cli.lds +++ /dev/null @@ -1,3 +0,0 @@ -EXTERN(argp_err_exit_status) -EXTERN(argp_program_version_hook) -EXTERN(argp_program_bug_address) diff --git a/src/libnvidia-container.lds b/src/libnvidia-container.lds deleted file mode 100644 index 440665998..000000000 --- a/src/libnvidia-container.lds +++ /dev/null @@ -1,48 +0,0 @@ -ENTRY(nvc_entrypoint) - -SECTIONS { - .interp : - { - KEEP(*(.interp)) - } - .note.ABI-tag : - { - KEEP(*(.note.ABI-tag)) - } -} - -VERSION { - NVC_1.0 { - global: - nvc_version; - nvc_context_new; - nvc_context_free; - nvc_config_new; - nvc_config_free; - nvc_init; - nvc_shutdown; - nvc_error; - nvc_ldcache_update; - nvc_container_config_new; - nvc_container_config_free; - nvc_container_new; - nvc_container_free; - nvc_driver_info_new; - nvc_driver_info_free; - nvc_device_info_new; - nvc_device_info_free; - nvc_driver_mount; - nvc_device_mount; - nvc_nvcaps_style; - nvc_nvcaps_device_from_proc_path; - nvc_mig_device_access_caps_mount; - nvc_mig_config_global_caps_mount; - nvc_mig_monitor_global_caps_mount; - nvc_device_mig_caps_mount; - nvc_imex_channel_mount; - - __ubsan_default_options; - local: - *; - }; -} diff --git a/src/libnvidia-container.ver b/src/libnvidia-container.ver new file mode 100644 index 000000000..3cd9d514a --- /dev/null +++ b/src/libnvidia-container.ver @@ -0,0 +1,33 @@ +NVC_1.0 { + global: + nvc_version; + nvc_context_new; + nvc_context_free; + nvc_config_new; + nvc_config_free; + nvc_init; + nvc_shutdown; + nvc_error; + nvc_ldcache_update; + nvc_container_config_new; + nvc_container_config_free; + nvc_container_new; + nvc_container_free; + nvc_driver_info_new; + nvc_driver_info_free; + nvc_device_info_new; + nvc_device_info_free; + nvc_driver_mount; + nvc_device_mount; + nvc_nvcaps_style; + nvc_nvcaps_device_from_proc_path; + nvc_mig_device_access_caps_mount; + nvc_mig_config_global_caps_mount; + nvc_mig_monitor_global_caps_mount; + nvc_device_mig_caps_mount; + nvc_imex_channel_mount; + + __ubsan_default_options; + local: + *; +};