* Re: [gentoo-hardened] removing .text relocations from mplayer and xine-lib
2005-05-29 15:27 [gentoo-hardened] removing .text relocations from mplayer and xine-lib René Rhéaume
@ 2005-05-29 17:24 ` Ned Ludd
2005-05-30 16:49 ` René Rhéaume
0 siblings, 1 reply; 6+ messages in thread
From: Ned Ludd @ 2005-05-29 17:24 UTC (permalink / raw
To: gentoo-hardened
[-- Attachment #1: Type: text/plain, Size: 966 bytes --]
On Sun, 2005-05-29 at 11:27 -0400, René Rhéaume wrote:
> Where is the patch that removes .text relocations from mplayer and
> xine-lib? Solar said on IRC that was one lying around somewhere. I
> searched on Gentoo Bugzilla and on the Web with Google and I did not
> find it.
I could not find where I put it and your the second person to
ask/request it today so I did another.
See attached untested patch for mplayer..
It may be easier to just have them do
#if (defined (__PIC__) && !defined(PIC))
# define PIC __PIC__
#endif
> Why? This is what I get from /usr/bin/xine (part of xine-ui)
> This is xine (X11 gui) - a free video player v0.99.3.
> (c) 2000-2004 The xine Team.
> Can't modify /usr/lib/xine/plugins/1.0.0/post/xineplug_post_planar.so's
> text section. Use GCC option -fPIC for shared objects, please.
>
> Hmm, there is already a PIC patch applied to xine-lib.
It's probably not complete like mplayer was not.
--
Ned Ludd <solar@gentoo.org>
[-- Attachment #2: MPlayer-1.0pre7-more-pic-updates.patch --]
[-- Type: text/x-patch, Size: 7885 bytes --]
diff -Nrup MPlayer-1.0pre7.unpacked/libavcodec/common.h MPlayer-1.0pre7/libavcodec/common.h
--- MPlayer-1.0pre7.unpacked/libavcodec/common.h 2005-04-16 16:41:13.000000000 -0400
+++ MPlayer-1.0pre7/libavcodec/common.h 2005-05-29 13:05:40.000000000 -0400
@@ -219,13 +219,13 @@ static inline float floorf(float f) {
// Use rip-relative addressing if compiling PIC code on x86-64.
# if defined(__MINGW32__) || defined(__CYGWIN__) || \
defined(__OS2__) || (defined (__OpenBSD__) && !defined(__ELF__))
-# if defined(ARCH_X86_64) && defined(PIC)
+# if defined(ARCH_X86_64) && defined(__PIC__)
# define MANGLE(a) "_" #a"(%%rip)"
# else
# define MANGLE(a) "_" #a
# endif
# else
-# if defined(ARCH_X86_64) && defined(PIC)
+# if defined(ARCH_X86_64) && defined(__PIC__)
# define MANGLE(a) #a"(%%rip)"
# else
# define MANGLE(a) #a
diff -Nrup MPlayer-1.0pre7.unpacked/libavcodec/i386/dsputil_mmx.c MPlayer-1.0pre7/libavcodec/i386/dsputil_mmx.c
--- MPlayer-1.0pre7.unpacked/libavcodec/i386/dsputil_mmx.c 2005-04-16 16:41:13.000000000 -0400
+++ MPlayer-1.0pre7/libavcodec/i386/dsputil_mmx.c 2005-05-29 13:01:39.000000000 -0400
@@ -59,7 +59,7 @@ static const uint64_t ff_pb_FC attribute
"pcmpeqd %%" #regd ", %%" #regd " \n\t"\
"paddb %%" #regd ", %%" #regd " \n\t" ::)
-#ifndef PIC
+#ifndef __PIC__
#define MOVQ_BONE(regd) __asm __volatile ("movq %0, %%" #regd " \n\t" ::"m"(mm_bone))
#define MOVQ_WTWO(regd) __asm __volatile ("movq %0, %%" #regd " \n\t" ::"m"(mm_wtwo))
#else
diff -Nrup MPlayer-1.0pre7.unpacked/libavcodec/i386/dsputil_mmx_avg.h MPlayer-1.0pre7/libavcodec/i386/dsputil_mmx_avg.h
--- MPlayer-1.0pre7.unpacked/libavcodec/i386/dsputil_mmx_avg.h 2005-04-16 16:41:13.000000000 -0400
+++ MPlayer-1.0pre7/libavcodec/i386/dsputil_mmx_avg.h 2005-05-29 13:15:32.000000000 -0400
@@ -90,7 +90,7 @@ static void DEF(put_pixels4_l2)(uint8_t
"add $16, %2 \n\t"
"subl $4, %0 \n\t"
"jnz 1b \n\t"
-#ifdef PIC //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
+#ifdef __PIC__ //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
:"+m"(h), "+a"(src1), "+c"(src2), "+d"(dst)
#else
:"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
@@ -137,7 +137,7 @@ static void DEF(put_pixels8_l2)(uint8_t
"add $32, %2 \n\t"
"subl $4, %0 \n\t"
"jnz 1b \n\t"
-#ifdef PIC //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
+#ifdef __PIC__ //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
:"+m"(h), "+a"(src1), "+c"(src2), "+d"(dst)
#else
:"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
@@ -207,7 +207,7 @@ static void DEF(put_no_rnd_pixels8_l2)(u
"add $32, %2 \n\t"
"subl $4, %0 \n\t"
"jnz 1b \n\t"
-#ifdef PIC //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
+#ifdef __PIC__ //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
:"+m"(h), "+a"(src1), "+c"(src2), "+d"(dst)
#else
:"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
@@ -262,7 +262,7 @@ static void DEF(avg_pixels4_l2)(uint8_t
"add $16, %2 \n\t"
"subl $4, %0 \n\t"
"jnz 1b \n\t"
-#ifdef PIC //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
+#ifdef __PIC__ //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
:"+m"(h), "+a"(src1), "+c"(src2), "+d"(dst)
#else
:"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
@@ -314,7 +314,7 @@ static void DEF(avg_pixels8_l2)(uint8_t
"add $32, %2 \n\t"
"subl $4, %0 \n\t"
"jnz 1b \n\t"
-#ifdef PIC //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
+#ifdef __PIC__ //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
:"+m"(h), "+a"(src1), "+c"(src2), "+d"(dst)
#else
:"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
@@ -402,7 +402,7 @@ static void DEF(put_pixels16_l2)(uint8_t
"add $32, %2 \n\t"
"subl $2, %0 \n\t"
"jnz 1b \n\t"
-#ifdef PIC //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
+#ifdef __PIC__ //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
:"+m"(h), "+a"(src1), "+c"(src2), "+d"(dst)
#else
:"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
@@ -456,7 +456,7 @@ static void DEF(avg_pixels16_l2)(uint8_t
"add $32, %2 \n\t"
"subl $2, %0 \n\t"
"jnz 1b \n\t"
-#ifdef PIC //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
+#ifdef __PIC__ //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
:"+m"(h), "+a"(src1), "+c"(src2), "+d"(dst)
#else
:"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
@@ -529,7 +529,7 @@ static void DEF(put_no_rnd_pixels16_l2)(
"add $32, %2 \n\t"
"subl $2, %0 \n\t"
"jnz 1b \n\t"
-#ifdef PIC //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
+#ifdef __PIC__ //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
:"+m"(h), "+a"(src1), "+c"(src2), "+d"(dst)
#else
:"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
diff -Nrup MPlayer-1.0pre7.unpacked/libavcodec/i386/dsputil_mmx_rnd.h MPlayer-1.0pre7/libavcodec/i386/dsputil_mmx_rnd.h
--- MPlayer-1.0pre7.unpacked/libavcodec/i386/dsputil_mmx_rnd.h 2005-04-16 16:41:13.000000000 -0400
+++ MPlayer-1.0pre7/libavcodec/i386/dsputil_mmx_rnd.h 2005-05-29 13:01:00.000000000 -0400
@@ -96,7 +96,7 @@ static void DEF(put, pixels8_l2)(uint8_t
"add %5, %3 \n\t"
"subl $4, %0 \n\t"
"jnz 1b \n\t"
-#ifdef PIC //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
+#ifdef __PIC__ //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
:"+m"(h), "+a"(src1), "+c"(src2), "+d"(dst)
#else
:"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
@@ -191,7 +191,7 @@ static void DEF(put, pixels16_l2)(uint8_
"add $32, %2 \n\t"
"subl $2, %0 \n\t"
"jnz 1b \n\t"
-#ifdef PIC //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
+#ifdef __PIC__ //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
:"+m"(h), "+a"(src1), "+c"(src2), "+d"(dst)
#else
:"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
diff -Nrup MPlayer-1.0pre7.unpacked/libavcodec/libpostproc/mangle.h MPlayer-1.0pre7/libavcodec/libpostproc/mangle.h
--- MPlayer-1.0pre7.unpacked/libavcodec/libpostproc/mangle.h 2005-04-16 16:41:13.000000000 -0400
+++ MPlayer-1.0pre7/libavcodec/libpostproc/mangle.h 2005-05-29 13:05:40.000000000 -0400
@@ -11,13 +11,13 @@
/* Use rip-relative addressing if compiling PIC code on x86-64. */
#if defined(__CYGWIN__) || defined(__MINGW32__) || defined(__OS2__) || \
(defined(__OpenBSD__) && !defined(__ELF__))
-#if defined(ARCH_X86_64) && defined(PIC)
+#if defined(ARCH_X86_64) && defined(__PIC__)
#define MANGLE(a) "_" #a"(%%rip)"
#else
#define MANGLE(a) "_" #a
#endif
#else
-#if defined(ARCH_X86_64) && defined(PIC)
+#if defined(ARCH_X86_64) && defined(__PIC__)
#define MANGLE(a) #a"(%%rip)"
#else
#define MANGLE(a) #a
diff -Nrup MPlayer-1.0pre7.unpacked/libavcodec/msmpeg4.c MPlayer-1.0pre7/libavcodec/msmpeg4.c
--- MPlayer-1.0pre7.unpacked/libavcodec/msmpeg4.c 2005-04-16 16:41:13.000000000 -0400
+++ MPlayer-1.0pre7/libavcodec/msmpeg4.c 2005-05-29 12:55:56.000000000 -0400
@@ -723,7 +723,7 @@ static inline int msmpeg4_pred_dc(MpegEn
necessitate to modify mpegvideo.c. The problem comes from the
fact they decided to store the quantized DC (which would lead
to problems if Q could vary !) */
-#if (defined(ARCH_X86) || defined(ARCH_X86_64)) && !defined PIC
+#if (defined(ARCH_X86) || defined(ARCH_X86_64)) && !defined __PIC__
asm volatile(
"movl %3, %%eax \n\t"
"shrl $1, %%eax \n\t"
^ permalink raw reply [flat|nested] 6+ messages in thread