This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Assembler message: "unsupported relocation type" with MPC555 crosscompiler


On Wed, Jul 24, 2002 at 04:25:26PM +0200, Matthias Fertig wrote:
> i ran powerpc-eabi-gcc
> 
> 	powerpc-eabi-gcc -g -S -mcpu=555 -I../../mpc555/include main.c
> 
> and looked into main.s
> 
> 
> #231:	.LM18:
> #232:		 mtspr EIE, r3 
> #233:	.stabn 68,0,44,.LM19-main
> 
> the "move to special purpose register" looks good, for my opinion.

What is EIE defined as?  I don't do much PPC assembly these days, but I
seem to remember that PPC SPR numbers are of a small and oddball bit
width (was it ten bits wide?).  It's possible this error could arise if
EIE were defined to be a quantity too large to fit in this field.  If
my ten bits guess is correct, then double-check that EIE <= 0x3ff, for
example.

> i don't understand the reason of the error? what does it mean, if there
> is a problem with an allocaion type?

It's an error generally given with branch/jump instructions.  In that
scenario, it means that the address you're trying to jump to cannot be
represented in the instruction you're trying to jump with from the address
you're trying to jump from.  Example: perhaps you're trying to use a
PC-relative branch with only 8 bits of offset and your branch target is
more than +/- 128 away.

It might also mean that the particular flavor of branch instruction that
either you've asked for, or that is required to reach the branch target,
is not supported by the particular revision of CPU gcc thinks you're
compiling for.  Example: say you're using a CPU architecture called FARM
(yes, I'm making this up) that has PC-relative branches.  FARM3 only had
PCrel branches with 8 bit offsets, but FARM4 added a version with a 12-bit
offset.  If GCC sees that the 12-bit variant is required to reach your
branch target, but you've told it (-mcpu= option to either configure or
GCC itself) that you're compiling specifically for FARM3, it may throw an
error complaining about the relocation type.

I've never seen this type of error thrown for a PPC mtspr instruction,
but based on what it means for branches, I've gotta guess it's complaining
that whatever EIE is, it will not fit in the SPRN field of the mtspr
instruction.

Good luck!


                         Carl Miller


> "William A. Gatliff" schrieb:
> > 
> > Matthias:
> > 
> > >       powerpc-eabi-gcc -g -c -mcpu=555 -I$(INCLUDES) -o main.o main.c
> > >       /tmp/cckZyIqV.s: Assembler messages:
> > >       /tmp/cckZyIqV.s:232: Error: unsupported relocation type
> > >       /tmp/cckZyIqV.s:232: Error: unsupported relocation type
> > >       make: *** [main.o] Fehler 1
> > 
> > Run the source file through gcc with -g -S, and have a look at line
> > 232.  This could be a gcc or assembler problem, knowing what the
> > offending instruction is would help.

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


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