diff options
author | Mans Rullgard <mans@mansr.com> | 2012-08-08 14:37:57 +0100 |
---|---|---|
committer | Mans Rullgard <mans@mansr.com> | 2012-08-09 00:58:20 +0100 |
commit | 070a402b60cb4ebc6fd2ba59c13758811815bb19 (patch) | |
tree | 2feb29c4a9807cb2a1c8023bf59fb6add356c838 /libavutil/x86 | |
parent | c318626ce248e55df032146b16e8e0f4ed1d99fb (diff) | |
download | ffmpeg-070a402b60cb4ebc6fd2ba59c13758811815bb19.tar.gz |
x86: move MANGLE() and related macros to libavutil/x86/asm.h
These x86-specific macros do not belong in generic code.
Signed-off-by: Mans Rullgard <mans@mansr.com>
Diffstat (limited to 'libavutil/x86')
-rw-r--r-- | libavutil/x86/asm.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libavutil/x86/asm.h b/libavutil/x86/asm.h index b447fabb57..a43ab3c074 100644 --- a/libavutil/x86/asm.h +++ b/libavutil/x86/asm.h @@ -95,4 +95,16 @@ typedef int x86_reg; # define XMM_CLOBBERS_ONLY(...) #endif +/* Use to export labels from asm. */ +#define LABEL_MANGLE(a) EXTERN_PREFIX #a + +// Use rip-relative addressing if compiling PIC code on x86-64. +#if ARCH_X86_64 && defined(PIC) +# define LOCAL_MANGLE(a) #a "(%%rip)" +#else +# define LOCAL_MANGLE(a) #a +#endif + +#define MANGLE(a) EXTERN_PREFIX LOCAL_MANGLE(a) + #endif /* AVUTIL_X86_ASM_H */ |