public inbox for gentoo-hardened@lists.gentoo.org
 help / color / mirror / Atom feed
From: Ned Ludd <solar@gentoo.org>
To: gentoo-hardened@lists.gentoo.org
Subject: Re: [gentoo-hardened] removing .text relocations from mplayer and xine-lib
Date: Sun, 29 May 2005 13:24:50 -0400	[thread overview]
Message-ID: <1117387490.8036.18.camel@localhost> (raw)
In-Reply-To: <35572ca8050529082739b7c9f5@mail.gmail.com>

[-- 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"

  reply	other threads:[~2005-05-29 17:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2005-05-30 16:49   ` René Rhéaume
2005-06-02 12:42     ` Peter S. Mazinger
2005-06-04 15:31       ` René Rhéaume
2005-06-09 12:43         ` Peter S. Mazinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1117387490.8036.18.camel@localhost \
    --to=solar@gentoo.org \
    --cc=gentoo-hardened@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox