Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/common.h')
-rw-r--r--libavcodec/common.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/libavcodec/common.h b/libavcodec/common.h
index fba2306396..619719a6f3 100644
--- a/libavcodec/common.h
+++ b/libavcodec/common.h
@@ -224,11 +224,20 @@ static inline float floorf(float f) {
# include "bswap.h"
+// Use rip-relative addressing if compiling PIC code on x86-64.
# if defined(__MINGW32__) || defined(__CYGWIN__) || \
defined(__OS2__) || (defined (__OpenBSD__) && !defined(__ELF__))
-# define MANGLE(a) "_" #a
+# if defined(ARCH_X86_64) && defined(PIC)
+# define MANGLE(a) "_" #a"(%%rip)"
+# else
+# define MANGLE(a) "_" #a
+# endif
# else
-# define MANGLE(a) #a
+# if defined(ARCH_X86_64) && defined(PIC)
+# define MANGLE(a) #a"(%%rip)"
+# else
+# define MANGLE(a) #a
+# endif
# endif
/* debug stuff */