This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

PATCH: Fix shared library for Linux/PPC.


On Sat, Nov 03, 2001 at 11:09:51PM -0800, H . J . Lu wrote:
> > I tried to compile binutils 2.11.92.0.10 and gcc 3.0 branch from CVS.
> > "make check" is still running. But so far, it doesn't look right at
> > all. My source dir is ~hjl/src/tools/tools and my build dir is
> > ~hjl/build/tools. They are crashing. I am getting messages like
> > 
> > ./header_cstdarg: error while loading shared libraries: /home/hjl/build/tools/build-ppc-linux/gcc/libgcc_s.so.1: R_PPC_REL24 relocation at 0x0f55a904 for symbol `~C#xA¢ÿÌ~AF' out of range
> > 
> 
> It looks like gcc 3.0 branch doesn't support shared library on
> Linux/PPC. Franz, do you have a patch? I will try to fix it myself.
> 
> 

All .o files used to build shared library on Linux/PPC have to be
compiled with PIC. But tramp.asm doesn't support PIC even if -fPIC
is used. This patch seems to work for me.


H.J.
----
2001-11-03  H.J. Lu <hjl@gnu.org>

	* config/rs6000/tramp.asm: Branch to abort via plt if __PIC__
	or __pic__ is defined.

--- gcc/config/rs6000/tramp.asm.pic	Wed Mar 15 20:16:41 2000
+++ gcc/config/rs6000/tramp.asm	Sun Nov  4 00:29:33 2001
@@ -104,6 +104,10 @@ FUNC_START(__trampoline_setup)
 	blr
 
 .Labort:
+#if defined (__PIC__) || defined (__pic__)
+	bl	FUNC_NAME(abort@plt)
+#else
 	bl	FUNC_NAME(abort)
+#endif
 FUNC_END(__trampoline_setup)
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]