summaryrefslogtreecommitdiff
path: root/libavcodec/ppc/asm.S
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/ppc/asm.S')
-rw-r--r--libavcodec/ppc/asm.S19
1 files changed, 16 insertions, 3 deletions
diff --git a/libavcodec/ppc/asm.S b/libavcodec/ppc/asm.S
index 5cbbf97b64..4d4285b6d3 100644
--- a/libavcodec/ppc/asm.S
+++ b/libavcodec/ppc/asm.S
@@ -44,10 +44,13 @@ X(\name):
L(\name):
.endm
-.macro movrel rd, sym
+.macro movrel rd, sym, gp
ld \rd, \sym@got(r2)
.endm
+.macro get_got rd
+.endm
+
#else /* ARCH_PPC64 */
#define PTR .int
@@ -65,15 +68,25 @@ X(\name):
\name:
.endm
-.macro movrel rd, sym
+.macro movrel rd, sym, gp
#if CONFIG_PIC
- lwz \rd, \sym@got(r2)
+ lwz \rd, \sym@got(\gp)
#else
lis \rd, \sym@ha
la \rd, \sym@l(\rd)
#endif
.endm
+.macro get_got rd
+#if CONFIG_PIC
+ bcl 20, 31, .Lgot\@
+.Lgot\@:
+ mflr \rd
+ addis \rd, \rd, _GLOBAL_OFFSET_TABLE_ - .Lgot\@@ha
+ addi \rd, \rd, _GLOBAL_OFFSET_TABLE_ - .Lgot\@@l
+#endif
+.endm
+
#endif /* ARCH_PPC64 */
#if HAVE_IBM_ASM