Skip to content

Commit 17d919d

Browse files
committed
build: add versioned symbol support
Versioned symbols add information to the ELF .gnu.version_r section which rtld can use to provide more descriptive information in the case of linking failures, and which dependency generators can use to avoid those failures. Signed-off-by: Gordon Messmer <gmessmer@redhat.com>
1 parent 4b0bf50 commit 17d919d

2 files changed

Lines changed: 47 additions & 1 deletion

File tree

src/Makefile.am

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ SOURCES_ALL = \
4949

5050
EXTRA_DIST = \
5151
arch-syscall-validate arch-syscall-check \
52-
arch-gperf-generate syscalls.csv syscalls.perf.template
52+
arch-gperf-generate syscalls.csv syscalls.perf.template \
53+
libseccomp.map
5354

5455
TESTS = arch-syscall-check
5556

@@ -65,6 +66,7 @@ libseccomp_la_CFLAGS = ${AM_CFLAGS} ${CODE_COVERAGE_CFLAGS} ${CFLAGS} \
6566
-fPIC -DPIC -fvisibility=hidden
6667
libseccomp_la_LDFLAGS = ${AM_LDFLAGS} ${CODE_COVERAGE_LDFLAGS} ${LDFLAGS} \
6768
-version-number ${VERSION_MAJOR}:${VERSION_MINOR}:${VERSION_MICRO}
69+
libseccomp_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libseccomp.map
6870

6971
EXTRA_DIST += syscalls.perf.c syscalls.perf
7072
CLEANFILES = syscalls.perf.c syscalls.perf

src/libseccomp.map

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/* Avoid modifying a symbol set after it has been released
2+
When adding features in a new release, add a new set
3+
Removing features is a breaking change */
4+
LIBSECCOMP_2.7 {
5+
global:
6+
seccomp_api_get;
7+
seccomp_api_set;
8+
seccomp_arch_add;
9+
seccomp_arch_exist;
10+
seccomp_arch_native;
11+
seccomp_arch_remove;
12+
seccomp_arch_resolve_name;
13+
seccomp_attr_get;
14+
seccomp_attr_set;
15+
seccomp_export_bpf;
16+
seccomp_export_bpf_mem;
17+
seccomp_export_pfc;
18+
seccomp_init;
19+
seccomp_load;
20+
seccomp_merge;
21+
seccomp_notify_alloc;
22+
seccomp_notify_addfd;
23+
seccomp_notify_fd;
24+
seccomp_notify_free;
25+
seccomp_notify_id_valid;
26+
seccomp_notify_receive;
27+
seccomp_notify_respond;
28+
seccomp_precompute;
29+
seccomp_release;
30+
seccomp_reset;
31+
seccomp_rule_add;
32+
seccomp_rule_add_array;
33+
seccomp_rule_add_exact;
34+
seccomp_rule_add_exact_array;
35+
seccomp_syscall_priority;
36+
seccomp_syscall_resolve_name;
37+
seccomp_syscall_resolve_name_arch;
38+
seccomp_syscall_resolve_name_rewrite;
39+
seccomp_syscall_resolve_num_arch;
40+
seccomp_transaction_commit;
41+
seccomp_transaction_reject;
42+
seccomp_transaction_start;
43+
seccomp_version;
44+
};

0 commit comments

Comments
 (0)