[SCM] libav/experimental: FLAT objects cannot have multiple sections, so using the L1 attributes breaks linking. The FDPIC relocs also break for any other format. Thus check the compiler environment and select the appropriate sections/relocs. patch by Mike Frysinger, vapier.adi a gmail d com

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 16:15:06 UTC 2013


The following commit has been merged in the experimental branch:
commit e44d7c659ba56d7efd6de10d5d99a1c44fd997fa
Author: Mike Frysinger <vapier.adi at gmail.com>
Date:   Sat Feb 16 15:17:31 2008 +0000

    FLAT objects cannot have multiple sections, so using the L1 attributes breaks
    linking. The FDPIC relocs also break for any other format. Thus check the
    compiler environment and select the appropriate sections/relocs.
    patch by Mike Frysinger, vapier.adi a gmail d com
    
    Originally committed as revision 12125 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavcodec/bfin/config_bfin.h b/libavcodec/bfin/config_bfin.h
index 85b478f..0f0eab6 100644
--- a/libavcodec/bfin/config_bfin.h
+++ b/libavcodec/bfin/config_bfin.h
@@ -35,10 +35,14 @@ DEFUN(put_pixels_clamped,mL1,
 
 #ifndef DEFUN
 
+#define mL3 .text
 #ifndef mL1
+#ifdef __FDPIC__
 #define mL1 .l1.text
+#else
+#define mL1 mL3
+#endif
 #endif
-#define mL3 .text
 
 #define DEFUN(fname,where,interface) \
         .section where;              \
@@ -50,6 +54,11 @@ DEFUN(put_pixels_clamped,mL1,
 #define DEFUN_END(fname) \
         .size _ff_bfin_ ## fname, . - _ff_bfin_ ## fname
 
+#ifdef __FDPIC__
+#define RELOC(reg,got,obj) reg = [got + obj at GOT17M4]
+#else
+#define RELOC(reg,got,obj) reg.L = obj; reg.H = obj
+#endif
 
 #endif
 
diff --git a/libavcodec/bfin/dsputil_bfin.c b/libavcodec/bfin/dsputil_bfin.c
index 93b324c..a724599 100644
--- a/libavcodec/bfin/dsputil_bfin.c
+++ b/libavcodec/bfin/dsputil_bfin.c
@@ -173,7 +173,7 @@ static int bfin_vsad (void *c, uint8_t *blk1, uint8_t *blk2, int stride, int h)
         + ff_bfin_z_sad16x16 (blk2,blk2+stride,stride<<1,stride<<1,h);
 }
 
-static uint8_t vtmp_blk[256] __attribute__((l1_data_B));
+static uint8_t vtmp_blk[256] attribute_l1_data_b;
 
 static int bfin_pix_abs16_x2 (void *c, uint8_t *blk1, uint8_t *blk2, int line_size, int h)
 {
diff --git a/libavcodec/bfin/dsputil_bfin.h b/libavcodec/bfin/dsputil_bfin.h
index 5731f4f..411c8ea 100644
--- a/libavcodec/bfin/dsputil_bfin.h
+++ b/libavcodec/bfin/dsputil_bfin.h
@@ -24,7 +24,13 @@
 #ifndef FFMPEG_DSPUTIL_BFIN_H
 #define FFMPEG_DSPUTIL_BFIN_H
 
+#ifdef __FDPIC__
 #define attribute_l1_text  __attribute__ ((l1_text))
+#define attribute_l1_data_b __attribute__((l1_data_B))
+#else
+#define attribute_l1_text
+#define attribute_l1_data_b
+#endif
 
 #ifdef BFIN_PROFILE
 
diff --git a/libavcodec/bfin/fdct_bfin.S b/libavcodec/bfin/fdct_bfin.S
index 9f3ef1f..03f2709 100644
--- a/libavcodec/bfin/fdct_bfin.S
+++ b/libavcodec/bfin/fdct_bfin.S
@@ -129,23 +129,30 @@ root:/u/ffmpeg/bhead/libavcodec>
 
 #include "config_bfin.h"
 
+#ifdef __FDPIC__
 .section .l1.data.B,"aw", at progbits
+#else
+.data
+#endif
 .align 4;
 dct_coeff:
 .short 0x5a82, 0x2d41, 0x187e, 0x3b21, 0x0c7c, 0x3ec5, 0x238e, 0x3537;
 
+#ifdef __FDPIC__
 .section .l1.data.A,"aw", at progbits
+#endif
 .align 4
 vtmp:   .space 128
 
+.text
 DEFUN(fdct,mL1,
         (DCTELEM *block)):
     [--SP] = (R7:4, P5:3);          // Push the registers onto the stack.
 
     b0 = r0;
-    r0 = [P3+dct_coeff at GOT17M4];
+    RELOC(r0, P3, dct_coeff);
     b3 = r0;
-    r0 = [P3+vtmp at GOT17M4];
+    RELOC(r0, P3, vtmp);
     b2 = r0;
 
     L3 = 16;                        // L3 is set to 16 to make the coefficient
diff --git a/libavcodec/bfin/idct_bfin.S b/libavcodec/bfin/idct_bfin.S
index e40e5e0..7bb1040 100644
--- a/libavcodec/bfin/idct_bfin.S
+++ b/libavcodec/bfin/idct_bfin.S
@@ -57,7 +57,11 @@ IDCT BFINidct: 88.3 kdct/s
 
 #include "config_bfin.h"
 
+#ifdef __FDPIC__
 .section .l1.data.B,"aw", at progbits
+#else
+.data
+#endif
 
 .align 4;
 coefs:
@@ -72,7 +76,9 @@ coefs:
 .short 0x18F9;           //cos(7pi/16)
 .short 0x7D8A;           //cos(pi/16)
 
-.section .l1.data.A
+#ifdef __FDPIC__
+.section .l1.data.A,"aw", at progbits
+#endif
 
 vtmp: .space 256
 
@@ -81,6 +87,7 @@ vtmp: .space 256
 #define TMP2 FP-16
 
 
+.text
 DEFUN(idct,mL1,
         (DCTELEM *block)):
 
@@ -88,8 +95,8 @@ DEFUN(idct,mL1,
     link 16;
     [--SP] = (R7:4, P5:3);   // Push the registers onto the stack.
     B0 = R0;                 // Pointer to Input matrix
-    R1 = [P3+coefs at GOT17M4]; // Pointer to Coefficients
-    R2 = [P3+vtmp at GOT17M4];  // Pointer to Temporary matrix
+    RELOC(R1, P3, coefs);    // Pointer to Coefficients
+    RELOC(R2, P3, vtmp);     // Pointer to Temporary matrix
     B3 = R1;
     B2 = R2;
     L3 = 20;                // L3 is used for making the coefficient array
diff --git a/libavcodec/bfin/vp3_idct_bfin.S b/libavcodec/bfin/vp3_idct_bfin.S
index 1ed9209..ec8c1be 100644
--- a/libavcodec/bfin/vp3_idct_bfin.S
+++ b/libavcodec/bfin/vp3_idct_bfin.S
@@ -30,7 +30,11 @@ Registers Used  : A0, A1, R0-R7, I0-I3, B0, B2, B3, M0-M2, L0-L3, P0-P5, LC0.
 
 #include "config_bfin.h"
 
+#ifdef __FDPIC__
 .section .l1.data.B,"aw", at progbits
+#else
+.data
+#endif
 
 .align 4;
 coefs:
@@ -45,7 +49,9 @@ coefs:
 .short 0x18F9;           //cos(7pi/16)
 .short 0x7D8A;           //cos(pi/16)
 
+#ifdef __FDPIC__
 .section .l1.data.A
+#endif
 
 vtmp: .space 256
 
@@ -54,6 +60,7 @@ vtmp: .space 256
 #define TMP2 FP-16
 
 
+.text
 DEFUN(vp3_idct,mL1,
         (DCTELEM *block)):
 
@@ -61,8 +68,8 @@ DEFUN(vp3_idct,mL1,
     link 16;
     [--SP] = (R7:4, P5:3);   // Push the registers onto the stack.
     B0 = R0;                 // Pointer to Input matrix
-    R1 = [P3+coefs at GOT17M4]; // Pointer to Coefficients
-    R2 = [P3+vtmp at GOT17M4];  // Pointer to Temporary matrix
+    RELOC(R1, P3, coefs);    // Pointer to Coefficients
+    RELOC(R2, P3, vtmp);     // Pointer to Temporary matrix
     B3 = R1;
     B2 = R2;
     L3 = 20;                // L3 is used for making the coefficient array

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list