build: Abstract symbol versioning via new libbsd_symver_* macros

This makes it more obvious what they are doing. It will make it easier
to make these directives more portable, as they are really ELF specific.
This commit is contained in:
Guillem Jover
2019-08-06 18:51:45 +02:00
parent b0ebb0d4c2
commit 890699a78b
4 changed files with 18 additions and 6 deletions

View File

@@ -30,4 +30,11 @@
#define libbsd_link_warning(symbol, msg) \
static const char libbsd_emit_link_warning_##symbol[] \
__attribute__((__used__,__section__(".gnu.warning." #symbol))) = msg;
#define libbsd_symver_default(alias, symbol, version) \
__asm__(".symver " #symbol "," #alias "@@" #version)
#define libbsd_symver_variant(alias, symbol, version) \
__asm__(".symver " #symbol "," #alias "@" #version)
#endif