public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] powerpc/mpc8xxx failed to compile: operand out of range
       [not found] <158709369.126474.1369301672221.JavaMail.root@gnuside.com>
@ 2013-05-23  9:52 ` Jérôme Arzel
  2013-05-24 20:13   ` Scott Wood
  2013-05-31 18:20   ` Scott Wood
  0 siblings, 2 replies; 6+ messages in thread
From: Jérôme Arzel @ 2013-05-23  9:52 UTC (permalink / raw)
  To: u-boot

Hi all,

I have an issue when I compile U-Boot for my target machine (P1022DS, 36-bit).
Here is the error message:

release.S: Assembler messages:
release.S:154: Error: operand out of range (0xfffff144 is not between 0x00000000 and 0x0000ffff)
release.S:286: Error: operand out of range (0xfffff144 is not between 0x00000000 and 0x0000ffff)
release.S:311: Error: operand out of range (0xfffff140 is not between 0x00000000 and 0x0000ffff)

(release.S is located to arch/powerpc/cpu/mpc85xx/release.S)

And here is the code for the first error (line 150):

#define toreset(x) (x - __secondary_start_page + 0xfffff000)

        /* get our PIR to figure out our table entry */
        lis     r3,toreset(__spin_table_addr)@h
        ori     r3,r3,toreset(__spin_table_addr)@l

I don't really know why it doesn't work, but I think
that "ori" is inappropried, the immediate value must be a 16-bit value.

I use GCC 4.7.3, compiled in x86_64 for target powerpc-none-linux-gnuspe.
My U-Boot come from the repository, but older versions fail too.


Thanks for your help,

J?r?me

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] powerpc/mpc8xxx failed to compile: operand out of range
  2013-05-23  9:52 ` [U-Boot] powerpc/mpc8xxx failed to compile: operand out of range Jérôme Arzel
@ 2013-05-24 20:13   ` Scott Wood
  2013-05-27  9:25     ` Jérôme Arzel
  2013-05-31 18:20   ` Scott Wood
  1 sibling, 1 reply; 6+ messages in thread
From: Scott Wood @ 2013-05-24 20:13 UTC (permalink / raw)
  To: u-boot

On 05/23/2013 04:52:26 AM, J?r?me Arzel wrote:
> Hi all,
> 
> I have an issue when I compile U-Boot for my target machine (P1022DS,  
> 36-bit).
> Here is the error message:
> 
> release.S: Assembler messages:
> release.S:154: Error: operand out of range (0xfffff144 is not between  
> 0x00000000 and 0x0000ffff)
> release.S:286: Error: operand out of range (0xfffff144 is not between  
> 0x00000000 and 0x0000ffff)
> release.S:311: Error: operand out of range (0xfffff140 is not between  
> 0x00000000 and 0x0000ffff)
> 
> (release.S is located to arch/powerpc/cpu/mpc85xx/release.S)
> 
> And here is the code for the first error (line 150):
> 
> #define toreset(x) (x - __secondary_start_page + 0xfffff000)
> 
>         /* get our PIR to figure out our table entry */
>         lis     r3,toreset(__spin_table_addr)@h
>         ori     r3,r3,toreset(__spin_table_addr)@l
> 
> I don't really know why it doesn't work, but I think
> that "ori" is inappropried, the immediate value must be a 16-bit  
> value.

The @l means take the low 16 bits of the constant.  Likewise, the @h in  
the lis takes the upper 16 bits.

Could you try to see what that instruction looks like after the  
preprocessor stage (i.e. use -E rather than -c in gcc)?

> I use GCC 4.7.3, compiled in x86_64 for target  
> powerpc-none-linux-gnuspe.
> My U-Boot come from the repository, but older versions fail too.

It builds OK for me with GCC 4.7.2.

-Scott

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] powerpc/mpc8xxx failed to compile: operand out of range
  2013-05-24 20:13   ` Scott Wood
@ 2013-05-27  9:25     ` Jérôme Arzel
  2013-05-28 15:14       ` Jérôme Arzel
  0 siblings, 1 reply; 6+ messages in thread
From: Jérôme Arzel @ 2013-05-27  9:25 UTC (permalink / raw)
  To: u-boot


On 05/24/2013 10:13:55 PM, Scott Wood wrote:
> 
> On 05/23/2013 04:52:26 AM, J?r?me Arzel wrote:
> > Hi all,
> > 
> > I have an issue when I compile U-Boot for my target machine
> > (P1022DS,
> > 36-bit).
> > Here is the error message:
> > 
> > release.S: Assembler messages:
> > release.S:154: Error: operand out of range (0xfffff144 is not
> > between
> > 0x00000000 and 0x0000ffff)
> > release.S:286: Error: operand out of range (0xfffff144 is not
> > between
> > 0x00000000 and 0x0000ffff)
> > release.S:311: Error: operand out of range (0xfffff140 is not
> > between
> > 0x00000000 and 0x0000ffff)
> > 
> > (release.S is located to arch/powerpc/cpu/mpc85xx/release.S)
> > 
> > And here is the code for the first error (line 150):
> > 
> > #define toreset(x) (x - __secondary_start_page + 0xfffff000)
> > 
> >         /* get our PIR to figure out our table entry */
> >         lis     r3,toreset(__spin_table_addr)@h
> >         ori     r3,r3,toreset(__spin_table_addr)@l
> > 
> > I don't really know why it doesn't work, but I think
> > that "ori" is inappropried, the immediate value must be a 16-bit
> > value.
> 
> The @l means take the low 16 bits of the constant.  Likewise, the @h
> in
> the lis takes the upper 16 bits.
> 
> Could you try to see what that instruction looks like after the
> preprocessor stage (i.e. use -E rather than -c in gcc)?
> 

OK, I tried and unsurprisingly it's:

 lis 3,(__spin_table_addr - __secondary_start_page + 0xfffff000)@h
 ori 3,3,(__spin_table_addr - __secondary_start_page + 0xfffff000)@l
 lwz 3,0(3)

If the @l takes the low 16 bits of
(__spin_table_addr - __secondary_start_page + 0xfffff000), so
the immediate value should not be 0xfffff144, but 0xf144.
The error is maybe in GCC...


J?r?me

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] powerpc/mpc8xxx failed to compile: operand out of range
  2013-05-27  9:25     ` Jérôme Arzel
@ 2013-05-28 15:14       ` Jérôme Arzel
  0 siblings, 0 replies; 6+ messages in thread
From: Jérôme Arzel @ 2013-05-28 15:14 UTC (permalink / raw)
  To: u-boot



On 05/27/2013 11:25:17 AM, J?r?me Arzel wrote:
> 
> On 05/24/2013 10:13:55 PM, Scott Wood wrote:
> > 
> > On 05/23/2013 04:52:26 AM, J?r?me Arzel wrote:
> > > Hi all,
> > > 
> > > I have an issue when I compile U-Boot for my target machine
> > > (P1022DS,
> > > 36-bit).
> > > Here is the error message:
> > > 
> > > release.S: Assembler messages:
> > > release.S:154: Error: operand out of range (0xfffff144 is not
> > > between
> > > 0x00000000 and 0x0000ffff)
> > > release.S:286: Error: operand out of range (0xfffff144 is not
> > > between
> > > 0x00000000 and 0x0000ffff)
> > > release.S:311: Error: operand out of range (0xfffff140 is not
> > > between
> > > 0x00000000 and 0x0000ffff)
> > > 
> > > (release.S is located to arch/powerpc/cpu/mpc85xx/release.S)
> > > 
> > > And here is the code for the first error (line 150):
> > > 
> > > #define toreset(x) (x - __secondary_start_page + 0xfffff000)
> > > 
> > >         /* get our PIR to figure out our table entry */
> > >         lis     r3,toreset(__spin_table_addr)@h
> > >         ori     r3,r3,toreset(__spin_table_addr)@l
> > > 
> > > I don't really know why it doesn't work, but I think
> > > that "ori" is inappropried, the immediate value must be a 16-bit
> > > value.
> > 
> > The @l means take the low 16 bits of the constant.  Likewise, the
> > @h
> > in
> > the lis takes the upper 16 bits.
> > 
> > Could you try to see what that instruction looks like after the
> > preprocessor stage (i.e. use -E rather than -c in gcc)?
> > 
> 
> OK, I tried and unsurprisingly it's:
> 
>  lis 3,(__spin_table_addr - __secondary_start_page + 0xfffff000)@h
>  ori 3,3,(__spin_table_addr - __secondary_start_page + 0xfffff000)@l
>  lwz 3,0(3)
> 
> If the @l takes the low 16 bits of
> (__spin_table_addr - __secondary_start_page + 0xfffff000), so
> the immediate value should not be 0xfffff144, but 0xf144.
> The error is maybe in GCC...
> 
> 
> J?r?me

In fact my tests was in a virtual machine.
I restarted the compilation of GCC from scratch, directly
on my machine (x86_64) and the result is slightly different,
but almost the same:

powerpc-e500v2-linux-gnuspe-gcc   -D__ASSEMBLY__ -g  -Os   \
 -fpic -mrelocatable -ffunction-sections -fdata-sections \
 -meabi -D__KERNEL__ -DCONFIG_SYS_TEXT_BASE=0x11000000 \
 -I/home/arzel/u-boot/u-boot-git/P1022DS_SDCARD/include2 \
 -I/home/arzel/u-boot/u-boot-git/P1022DS_SDCARD/include \
 -I/home/arzel/u-boot/u-boot-git/include -fno-builtin \
 -ffreestanding -nostdinc \
 -isystem /home/arzel/cross_compile/tools/lib/gcc/powerpc-
e500v2-linux-gnuspe/4.8.0/include \
 -pipe  -DCONFIG_PPC -D__powerpc__ -ffixed-r2 -Wa,-me500 \
 -msoft-float -mno-string -mspe=yes -mno-spe   \
 -o /home/arzel/u-boot/u-boot-git/P1022DS_SDCARD/
arch/powerpc/cpu/mpc85xx/release.o release.S -c

release.S: Assembler messages:
release.S:153: Error: value of 4294963524 too large for field 
of 2 bytes at 170
release.S:154: Error: operand out of range (0xfffffffffffff144 
is not between 0x0000000000000000 and 0x000000000000ffff)
release.S:154: Error: value of 4294963524 too large for field 
of 2 bytes at 174
release.S:282: Error: value of 4294963524 too large for field 
of 2 bytes at 206
release.S:283: Error: operand out of range (0xfffffffffffff144 
is not between 0x0000000000000000 and 0x000000000000ffff)
release.S:283: Error: value of 4294963524 too large for field 
of 2 bytes at 210
release.S:307: Error: value of 4294963520 too large for field 
of 2 bytes at 278
release.S:308: Error: operand out of range (0xfffffffffffff140 
is not between 0x0000000000000000 and 0x000000000000ffff)
release.S:308: Error: value of 4294963520 too large for field 
of 2 bytes at 282

By curiosity, I tried to replace "toreset(__spin_table_addr)"
by "0xfffffffffffff144" and it works... but it's not a
solution.

I use the last version of U-Boot from the git branch 'master'.

Here is my configuration for GCC:

export PATH=/home/arzel/cross_compile/tools/bin:$PATH

Binutils (v2.23.2)

configure --target=powerpc-e500v2-linux-gnuspe \
  --prefix=/home/arzel/cross_compile/tools \
  --with-sysroot=/home/home/arzel/cross_compile/sysroot \
  --disable-nls --disable-multilib

make all
make install

GCC (v4.8.0)

configure --target=powerpc-e500v2-linux-gnuspe \
  --prefix=/home/arzel/cross_compile/tools \
  --with-sysroot=/home/arzel/cross_compile/sysroot \
  --without-headers --with-newlib --disable-shared \
  --disable-threads --enable-languages=c \
  --disable-decimal-float --disable-__cxa_atexit \
  --disable-libquadmath --disable-libssp \
  --disable-libgomp --disable-libmudflap \
  --disable-nls --disable-multilib \
  --enable-e500_double --with-long-double-128 \
  --with-cpu=8548

make all-host all-target-libgcc
make install-host install-target-libgcc

Normally, I can build U-Boot with this small GCC.

J?r?me

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] powerpc/mpc8xxx failed to compile: operand out of range
  2013-05-23  9:52 ` [U-Boot] powerpc/mpc8xxx failed to compile: operand out of range Jérôme Arzel
  2013-05-24 20:13   ` Scott Wood
@ 2013-05-31 18:20   ` Scott Wood
  2013-06-04  9:08     ` Jérôme Arzel
  1 sibling, 1 reply; 6+ messages in thread
From: Scott Wood @ 2013-05-31 18:20 UTC (permalink / raw)
  To: u-boot

On 05/23/2013 04:52:26 AM, J?r?me Arzel wrote:
> Hi all,
> 
> I have an issue when I compile U-Boot for my target machine (P1022DS,  
> 36-bit).
> Here is the error message:
> 
> release.S: Assembler messages:
> release.S:154: Error: operand out of range (0xfffff144 is not between  
> 0x00000000 and 0x0000ffff)
> release.S:286: Error: operand out of range (0xfffff144 is not between  
> 0x00000000 and 0x0000ffff)
> release.S:311: Error: operand out of range (0xfffff140 is not between  
> 0x00000000 and 0x0000ffff)
> 
> (release.S is located to arch/powerpc/cpu/mpc85xx/release.S)
> 
> And here is the code for the first error (line 150):
> 
> #define toreset(x) (x - __secondary_start_page + 0xfffff000)
> 
>         /* get our PIR to figure out our table entry */
>         lis     r3,toreset(__spin_table_addr)@h
>         ori     r3,r3,toreset(__spin_table_addr)@l
> 
> I don't really know why it doesn't work, but I think
> that "ori" is inappropried, the immediate value must be a 16-bit  
> value.
> 
> I use GCC 4.7.3, compiled in x86_64 for target  
> powerpc-none-linux-gnuspe.
> My U-Boot come from the repository, but older versions fail too.

This appears to be a binutils bug, introduced in 2.23.2.  The attached  
test program gives a similar error on 2.23.2, but 2.23.1 is OK.

I've filed it here: http://sourceware.org/bugzilla/show_bug.cgi?id=15557

-Scott
-------------- next part --------------
	ori	3,3,(y-x+0x8000)@l
x:
y:

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] powerpc/mpc8xxx failed to compile: operand out of range
  2013-05-31 18:20   ` Scott Wood
@ 2013-06-04  9:08     ` Jérôme Arzel
  0 siblings, 0 replies; 6+ messages in thread
From: Jérôme Arzel @ 2013-06-04  9:08 UTC (permalink / raw)
  To: u-boot

Binutils 2.23.1 and the patch(es) for 2.23.2 work well.
Thank you for your help.

J?r?me

On 05/31/2013 08:20:00 PM, Scott Wood wrote:
> 
> On 05/23/2013 04:52:26 AM, J?r?me Arzel wrote:
> > Hi all,
> > 
> > I have an issue when I compile U-Boot for my target machine
> > (P1022DS,
> > 36-bit).
> > Here is the error message:
> > 
> > release.S: Assembler messages:
> > release.S:154: Error: operand out of range (0xfffff144 is not
> > between
> > 0x00000000 and 0x0000ffff)
> > release.S:286: Error: operand out of range (0xfffff144 is not
> > between
> > 0x00000000 and 0x0000ffff)
> > release.S:311: Error: operand out of range (0xfffff140 is not
> > between
> > 0x00000000 and 0x0000ffff)
> > 
> > (release.S is located to arch/powerpc/cpu/mpc85xx/release.S)
> > 
> > And here is the code for the first error (line 150):
> > 
> > #define toreset(x) (x - __secondary_start_page + 0xfffff000)
> > 
> >         /* get our PIR to figure out our table entry */
> >         lis     r3,toreset(__spin_table_addr)@h
> >         ori     r3,r3,toreset(__spin_table_addr)@l
> > 
> > I don't really know why it doesn't work, but I think
> > that "ori" is inappropried, the immediate value must be a 16-bit
> > value.
> > 
> > I use GCC 4.7.3, compiled in x86_64 for target
> > powerpc-none-linux-gnuspe.
> > My U-Boot come from the repository, but older versions fail too.
> 
> This appears to be a binutils bug, introduced in 2.23.2.  The
> attached
> test program gives a similar error on 2.23.2, but 2.23.1 is OK.
> 
> I've filed it here:
> http://sourceware.org/bugzilla/show_bug.cgi?id=15557
> 
> -Scott

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-06-04  9:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <158709369.126474.1369301672221.JavaMail.root@gnuside.com>
2013-05-23  9:52 ` [U-Boot] powerpc/mpc8xxx failed to compile: operand out of range Jérôme Arzel
2013-05-24 20:13   ` Scott Wood
2013-05-27  9:25     ` Jérôme Arzel
2013-05-28 15:14       ` Jérôme Arzel
2013-05-31 18:20   ` Scott Wood
2013-06-04  9:08     ` Jérôme Arzel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox