fpic related error

Ian Lance Taylor iant@google.com
Mon Apr 18 18:56:00 GMT 2011


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



More information about the Gcc-help mailing list