From: Felipe Sateler Date: Mon, 28 Aug 2017 16:49:03 +0000 (-0300) Subject: shared: Add a linker script so that all functions are tagget @SD_SHARED instead of... X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=af2885973e3018b639d8297bd838ec8ebbe93e8a;p=elogind.git shared: Add a linker script so that all functions are tagget @SD_SHARED instead of @Base (#6669) This helps prevent symbol collisions with other programs and libraries. In particular, because PAM modules are loaded into the process that is creating the session, and elogind creates PAM sessions, the potential for collisions is high. Disambiguate all elogind calls by tagging a 'version' SD_SHARED. Fixes #6624 --- diff --git a/src/shared/meson.build b/src/shared/meson.build index ff7a8349f..06ecaf633 100644 --- a/src/shared/meson.build +++ b/src/shared/meson.build @@ -168,6 +168,8 @@ libshared_deps = [threads, libselinux] #endif // 0 +libshared_sym_path = '@0@/libshared.sym'.format(meson.current_source_dir()) + libshared = shared_library( libshared_name, shared_sources, @@ -180,7 +182,8 @@ libshared = shared_library( libelogind_internal_sources, #endif // 0 include_directories : includes, - link_args : ['-shared'], + link_args : ['-shared', + '-Wl,--version-script=' + libshared_sym_path], c_args : ['-fvisibility=default'], dependencies : libshared_deps, install : true,