~noskcaj/ubuntu/saucy/libav/merge0.8.7-1

« back to all changes in this revision

Viewing changes to debian/patches/post-0.7.1/0068-ppc-fix-32-bit-PIC-build.patch

  • Committer: Package Import Robot
  • Author(s): Reinhard Tartler
  • Date: 2011-09-28 09:18:34 UTC
  • mfrom: (1.3.7 sid)
  • Revision ID: package-import@ubuntu.com-20110928091834-w415mnuh06h4zpvc
Tags: 4:0.7.1-7ubuntu2
Revert "Convert package to include multiarch support."

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
From ecda54a640a7de55274ad2a86d58d0b483097aac Mon Sep 17 00:00:00 2001
 
2
From: Mans Rullgard <mans@mansr.com>
 
3
Date: Sun, 25 Sep 2011 12:53:44 +0100
 
4
Subject: [PATCH 68/70] ppc: fix 32-bit PIC build
 
5
 
 
6
On 32-bit ppc, the GOT pointer must be loaded manually.
 
7
This adds a "get_got" assembler macro to compute the
 
8
GOT address.  The "movrel" macro is updated to take an
 
9
additional parameter containing the GOT address since
 
10
no register is reserved for this purpose on ppc32.
 
11
These changes have no effect on ppc64 builds.
 
12
 
 
13
Signed-off-by: Mans Rullgard <mans@mansr.com>
 
14
(cherry picked from commit 6e4a35ced96cdf31a9d3bd82fd147554750af839)
 
15
 
 
16
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
 
17
---
 
18
 libavcodec/ppc/asm.S           |   19 ++++++++++++++++---
 
19
 libavcodec/ppc/fft_altivec_s.S |    7 ++++---
 
20
 2 files changed, 20 insertions(+), 6 deletions(-)
 
21
 
 
22
diff --git a/libavcodec/ppc/asm.S b/libavcodec/ppc/asm.S
 
23
index 5cbbf97..4d4285b 100644
 
24
--- a/libavcodec/ppc/asm.S
 
25
+++ b/libavcodec/ppc/asm.S
 
26
@@ -44,10 +44,13 @@ X(\name):
 
27
 L(\name):
 
28
 .endm
 
29
 
 
30
-.macro movrel rd, sym
 
31
+.macro movrel rd, sym, gp
 
32
     ld      \rd, \sym@got(r2)
 
33
 .endm
 
34
 
 
35
+.macro get_got rd
 
36
+.endm
 
37
+
 
38
 #else /* ARCH_PPC64 */
 
39
 
 
40
 #define PTR  .int
 
41
@@ -65,15 +68,25 @@ X(\name):
 
42
 \name:
 
43
 .endm
 
44
 
 
45
-.macro movrel rd, sym
 
46
+.macro movrel rd, sym, gp
 
47
 #if CONFIG_PIC
 
48
-    lwz     \rd, \sym@got(r2)
 
49
+    lwz     \rd, \sym@got(\gp)
 
50
 #else
 
51
     lis     \rd, \sym@ha
 
52
     la      \rd, \sym@l(\rd)
 
53
 #endif
 
54
 .endm
 
55
 
 
56
+.macro get_got rd
 
57
+#if CONFIG_PIC
 
58
+    bcl     20, 31, .Lgot\@
 
59
+.Lgot\@:
 
60
+    mflr    \rd
 
61
+    addis   \rd, \rd, _GLOBAL_OFFSET_TABLE_ - .Lgot\@@ha
 
62
+    addi    \rd, \rd, _GLOBAL_OFFSET_TABLE_ - .Lgot\@@l
 
63
+#endif
 
64
+.endm
 
65
+
 
66
 #endif /* ARCH_PPC64 */
 
67
 
 
68
 #if HAVE_IBM_ASM
 
69
diff --git a/libavcodec/ppc/fft_altivec_s.S b/libavcodec/ppc/fft_altivec_s.S
 
70
index ab33900..958d7df 100644
 
71
--- a/libavcodec/ppc/fft_altivec_s.S
 
72
+++ b/libavcodec/ppc/fft_altivec_s.S
 
73
@@ -353,6 +353,7 @@ extfunc ff_fft_calc\interleave\()_altivec
 
74
     mflr    r0
 
75
     stp     r0, 2*PS(r1)
 
76
     stpu    r1, -(160+16*PS)(r1)
 
77
+    get_got r11
 
78
     addi    r6, r1, 16*PS
 
79
     stvm    r6, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29
 
80
     mfvrsave r0
 
81
@@ -360,14 +361,14 @@ extfunc ff_fft_calc\interleave\()_altivec
 
82
     li      r6, 0xfffffffc
 
83
     mtvrsave r6
 
84
 
 
85
-    movrel  r6, fft_data
 
86
+    movrel  r6, fft_data, r11
 
87
     lvm     r6, v14, v15, v16, v17, v18, v19, v20, v21
 
88
     lvm     r6, v22, v23, v24, v25, v26, v27, v28, v29
 
89
 
 
90
     li      r9, 16
 
91
-    movrel  r12, X(ff_cos_tabs)
 
92
+    movrel  r12, X(ff_cos_tabs), r11
 
93
 
 
94
-    movrel  r6, fft_dispatch_tab\interleave\()_altivec
 
95
+    movrel  r6, fft_dispatch_tab\interleave\()_altivec, r11
 
96
     lwz     r3, 0(r3)
 
97
     subi    r3, r3, 2
 
98
     slwi    r3, r3, 2+ARCH_PPC64
 
99
-- 
 
100
1.7.4.1
 
101