summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>2022-12-28 13:48:47 +0100
committerMartin Mares <mj@ucw.cz>2022-12-28 13:48:47 +0100
commit2d16e3a7875a9cb5abd60713bb2e39b536a7dec4 (patch)
treead812a0e6efa0ae611ba748b837e7a0027120679
parent42e6a803bda392e98276b71994db0b0dd285cab1 (diff)
downloadpciutils-2d16e3a7875a9cb5abd60713bb2e39b536a7dec4.tar.gz
Fix versioned symbol aliases when used with link-time optimization
-rw-r--r--lib/internal.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/internal.h b/lib/internal.h
index ed0e94f..e9e413e 100644
--- a/lib/internal.h
+++ b/lib/internal.h
@@ -15,12 +15,12 @@
// optimizations is happy to optimize them away, leading to linker failures.
#define VERSIONED_ABI __attribute__((used)) PCI_ABI
#ifdef __APPLE__
-#define STATIC_ALIAS(_decl, _for) _decl PCI_ABI { return _for; }
+#define STATIC_ALIAS(_decl, _for) _decl VERSIONED_ABI { return _for; }
#define DEFINE_ALIAS(_decl, _for)
#define SYMBOL_VERSION(_int, _ext)
#else
#define STATIC_ALIAS(_decl, _for)
-#define DEFINE_ALIAS(_decl, _for) extern _decl __attribute__((alias(#_for)))
+#define DEFINE_ALIAS(_decl, _for) extern _decl __attribute__((alias(#_for))) VERSIONED_ABI
#ifdef _WIN32
/* GCC does not support asm .symver directive for Windows targets, so define new external global function symbol as alias to internal symbol */
#define SYMBOL_VERSION(_int, _ext) asm(".globl\t" PCI_STRINGIFY(__MINGW_USYMBOL(_ext)) "\n\t" \