This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: fpic related error
- From: Ian Lance Taylor <iant at google dot com>
- To: naga raj <gnuuser dot raj at gmail dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Mon, 18 Apr 2011 11:53:18 -0700
- Subject: Re: fpic related error
- References: <BANLkTi=93iRmhtoP-0trpBBEQQN0EpVO9Q@mail.gmail.com>
naga raj <gnuuser.raj@gmail.com> writes:
> Â Can any one please help in resolving the following issue.
>
>
> Â I am using a Gcc-4.6 for an embedded target..
>
> ÂWhen I am running dejagnu tests. There are more than 100 failures
> which are related to -fpic
>
>
> Âbash-4.0$ /proj/epdsw1/gnu/lin/bin/zz-gcc
> /proj/epdsw1/gcc/gcc/testsuite/gcc.dg/20001012-2.c  -O2 -fpic
> -mno-xl-soft-mul -mxl-barrel-shift -mcpu=v7.30.b
> /tmp/ccPlsYVr.o: could not read symbols: File format not recognized
> collect2: ld returned 1 exit status
>
> ÂIf I remove -fpic option it is compiling without any errors...
>
> ÂWhen I run small program with -fpic option then it is working fine.
>
> ÂCan anyone please help me out of this
That error is coming from the linker. The question you have to figure
out is why the linker is rejecting a file compiled with -fpic. This is
going to be an issue with your assembler and linker. You neglected to
tell us the target, so it's pretty hard to say anything else.
Note that -fpic is only useful when running an ELF based operating
system. It's not useful for an embedded system that is not running a
conventional operating system.
Ian