Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 21 Mar 2009 12:17:52 -0700
From:      Marcel Moolenaar <xcllnt@mac.com>
To:        gerald@freebsd.org
Cc:        multimedia@freebsd.org
Subject:   [PATCH] devel/liboil: non-PIC relocations on PowerPC
Message-ID:  <F97EC20C-8240-4B29-8CF3-7FDCAD9094B1@mac.com>

next in thread | raw e-mail | index | archive | help

--Boundary_(ID_+cSDf8Uie3Dos32b+6DQxg)
Content-type: text/plain; charset=US-ASCII; format=flowed
Content-transfer-encoding: 7BIT

Gerald,

Attached 2 diff files that
1)  fix a non-PIC call, and
2)  properly define the global symbols as functions with a
     non-zero size.

With at least the first, gstreamer works. It would otherwise fail
to load some plugins because rtld would complain about non-PIC
relocations.

If you want I can file a PR. Or if you're ok with it, I can do
the commit myself.

FYI,

-- 
Marcel Moolenaar
xcllnt@mac.com



--Boundary_(ID_+cSDf8Uie3Dos32b+6DQxg)
Content-type: application/octet-stream; x-unix-mode=0700;
	name=patch-vec_memcpy.diff
Content-transfer-encoding: 7bit
Content-disposition: attachment; filename=patch-vec_memcpy.diff

--- liboil/motovec/vec_memcpy.S	2007-11-15 18:53:47.000000000 -0800
+++ liboil/motovec/vec_memcpy.S	2009-03-20 20:07:55.000000000 -0700
@@ -249,9 +249,11 @@
 memcpy:
 #else
 	.globl	vec_memmove     
+	.type	vec_memmove, @function
 vec_memmove:
 	nop			// IU1 Only way I know to preserve both labels
 	.globl	_vec_memcpy     
+	.type	_vec_memcpy, @function
 _vec_memcpy:
 #endif
 	subf.	DMS,SRC,DST	// IU1 Compute dst-src difference
@@ -291,7 +293,9 @@
 	stbu	Rt,-1(DBC)	// LSU Store it
 	bdnz	Byte_cpy_bwd
 	blr
-	
+	.size	vec_memmove, . - vec_memmove
+	.size	_vec_memcpy, . - _vec_memcpy
+
 #ifdef __MWERKS__
 	.align	16
 #else
@@ -863,6 +867,7 @@
 bcopy:
 #else
 	.globl	vec_bcopy     
+	.type	vec_bcopy, @function
 vec_bcopy:
 #endif
 	mr	Rt,DST		// temp storage for what is really source address (r3)
@@ -871,6 +876,7 @@
 #ifdef LIBMOTOVEC
 	b	memcpy		// b to memcpy with correct args in r3 and r4	
 #else
-	b	_vec_memcpy	// b to vec_memcpy with correct args in r3 and r4	
+	b	_vec_memcpy@plt	// b to vec_memcpy with correct args in r3 and r4	
 #endif
+	.size	vec_bcopy, . - vec_bcopy
 // End of bcopy in AltiVec

--Boundary_(ID_+cSDf8Uie3Dos32b+6DQxg)
Content-type: application/octet-stream; x-unix-mode=0700;
	name=patch-vec_memset.diff
Content-transfer-encoding: 7bit
Content-disposition: attachment; filename=patch-vec_memset.diff

--- liboil/motovec/vec_memset.S	2007-11-15 18:53:47.000000000 -0800
+++ liboil/motovec/vec_memset.S	2009-03-20 20:10:56.000000000 -0700
@@ -142,6 +142,7 @@
 memset:
 #else
 	.globl	_vec_memset     
+	.type	_vec_memset, @function
 _vec_memset:
 #endif
 
@@ -161,6 +162,7 @@
 	bdnz	Byte_set
 
 	blr
+	.size	_vec_memset, . - _vec_memset
 
 v_memset:
 // Byte count < MIN_VEC bytes will have been set by scalar code above,
@@ -347,6 +349,7 @@
 bzero:
 #else
 	.globl	vec_bzero     
+	.type	vec_bzero, @function
 vec_bzero:
 #endif
 
@@ -355,8 +358,9 @@
 #ifdef LIBMOTOVEC
 	b	memset     
 #else
-	b	_vec_memset     
+	b	_vec_memset@plt
 #endif
+	.size	vec_bzero, . - vec_bzero
 
 // cacheable_memzero will employ dcbz to clear 32 bytes at a time
 // of cacheable memory. Like bzero, second entering argument will be BC.

--Boundary_(ID_+cSDf8Uie3Dos32b+6DQxg)--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?F97EC20C-8240-4B29-8CF3-7FDCAD9094B1>