diff options
author | Martin Mares <mj@ucw.cz> | 2022-12-28 13:48:47 +0100 |
---|---|---|
committer | Martin Mares <mj@ucw.cz> | 2022-12-28 13:48:47 +0100 |
commit | 2d16e3a7875a9cb5abd60713bb2e39b536a7dec4 (patch) | |
tree | ad812a0e6efa0ae611ba748b837e7a0027120679 | |
parent | 42e6a803bda392e98276b71994db0b0dd285cab1 (diff) | |
download | pciutils-2d16e3a7875a9cb5abd60713bb2e39b536a7dec4.tar.gz |
Fix versioned symbol aliases when used with link-time optimization
-rw-r--r-- | lib/internal.h | 4 |
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" \ |