linux-mips
[Top] [All Lists]

Re: GCC 4.4.2(mips) with -mplt option

To: YD <ydgoo9@gmail.com>
Subject: Re: GCC 4.4.2(mips) with -mplt option
From: Zhang Le <r0bertz@gentoo.org>
Date: Fri, 29 Jan 2010 15:53:03 +0000
Cc: linux-mips <linux-mips@linux-mips.org>
In-reply-to: <38dc7fce1001290227v746c0a3dp4b3d81a58e73cf83@mail.gmail.com>
Mail-followup-to: YD <ydgoo9@gmail.com>, linux-mips <linux-mips@linux-mips.org>
References: <38dc7fce1001290227v746c0a3dp4b3d81a58e73cf83@mail.gmail.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.16 (2007-06-09)
On 19:27 Fri 29 Jan     , YD wrote:
> Hello,
> 
> I have built the toolchain using the buildroot ( GCC 4.4.2 with
> uClibc-0.9.30.1 )

I think you need to check if uClibc supports this feature.
-mplt need support from libc, specifically dynamic loader, ld.so.

> 
> Everything works well but when I compiled with -mplt option, always it
> fails with Segmentation fault.
> 
> I read some articles that with -mplt option, preformance will be 10%
> highter than without plt option.
> 
> I don't know why this fails everytime. please help me...
> 
> #include <stdio.h>
> int main()
> {
>  printf("Hello world \n"); return 0;
> }
> 
> #mipsel-linux-gcc  -o a a.c
>  Hello world
> #mipsel-linux-gcc -mplt -o a a.c
>  Segmentation fault
> #mipsel-linux-gcc -mplt -no-shared -o a a.c
>  Segmentation fault
> #mipsel-linux-gcc -mplt -no-shared -mabicalls -o a a.c
>  Segmentation fault

And -no-shared is actually not needed
http://gcc.gnu.org/ml/gcc/2008-12/msg00010.html

You should be able to verify this by 'mipsel-linux-gcc -v'

Zhang, Le

<Prev in Thread] Current Thread [Next in Thread>