Bug 9785 - frv: whether code is accepted depends on whether the *host* is 32bit or 64bit
Summary: frv: whether code is accepted depends on whether the *host* is 32bit or 64bit
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: gas (show other bugs)
Version: 2.19
: P2 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-25 00:12 UTC by Adrian Bunk
Modified: 2015-11-23 20:28 UTC (History)
4 users (show)

See Also:
Host: x86_64-unknown-linux-gnu
Target: frv-unknown-linux-gnu
Build: x86_64-unknown-linux-gnu
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adrian Bunk 2009-01-25 00:12:01 UTC
Trying to compile a Linux kernel from an x86 host works with a 32bit host
userspace, but fails with the following error with a 64bit host userspace:

<--  snip  -->

...
  AS      arch/frv/kernel/break.o
arch/frv/kernel/break.S: Assembler messages:
arch/frv/kernel/break.S:219: Error: operand out of range (4294959104 not between
-32768 and 32767) `setlos #0xffffe000,gr3'
make[2]: *** [arch/frv/kernel/break.o] Error 1

<--  snip  -->


I do not know whether the assembler code in question should be accepted or
rejected, but the fact that depending on whether the *host* is 32bit or 64bit
the code is either accepted or not is clearly a bug in binutils.
Comment 1 H.J. Lu 2009-01-25 20:13:32 UTC
Please provide a small testcase.
Comment 2 Adrian Bunk 2009-01-25 20:23:35 UTC
$ cat test.S
        setlos          #0xffffe000,gr3
$ /path/to/32bit-binutils/bin/frv-linux-as  test.S 
$ /path/to/64bit-binutils/bin/frv-linux-as  test.S 
test.S: Assembler messages:
test.S:1: Error: operand out of range (4294959104 not between -32768 and 32767)
`setlos #0xffffe000,gr3'
$ cat test.S
Comment 3 H.J. Lu 2009-01-25 20:45:12 UTC
Is this a regression? What is the last working binutils?
Comment 4 Adrian Bunk 2009-01-25 20:51:21 UTC
As far as I know it is not a regression.

I recently switched my host from 32bit to 64bit, and after rebuilding my cross
toolchains I ran into this issue.
Comment 5 H.J. Lu 2009-01-25 21:07:51 UTC
FRV doesn't support 64bit host
Comment 6 Alexandre Oliva 2009-01-26 18:18:03 UTC
"Doesn't support" is quite strong.  It was mostly developed on 64-bit hosts.

Anyhow, I'll have a look as soon as I get a chance.  Wouldn't mind if someone
beat me to it.  I remember having fixed a bunch of these truncation issues back
when I started, it shouldn't be too hard to locate this one.
Comment 7 Adrian Bunk 2009-02-01 15:41:29 UTC
(In reply to comment #6)
> "Doesn't support" is quite strong.  It was mostly developed on 64-bit hosts.
>...

Changing the Subject back to what I did set in the beginning.
Comment 8 wbx 2015-11-23 20:27:17 UTC
Seems to be working with 2.25.1:

wbx@chrom:~/frv $ ./toolchain_sim-frv_uclibc-ng_frv_nommu/usr/bin/frv-openadk-linux-uclibc-as -v                                     
GNU assembler version 2.25.1 (frv-openadk-linux-uclibc) using BFD version (GNU Binutils) 2.25.1
^C
130|wbx@chrom:~/frv $ ./toolchain_sim-frv_uclibc-ng_frv_nommu/usr/bin/frv-openadk-linux-uclibc-as test.S
Comment 9 wbx 2015-11-23 20:28:38 UTC
The host is 64 bit, sorry forget to tell.
uname -a                                                                                                           
Linux chrom 3.2.0-4-amd64 #1 SMP Debian 3.2.68-1+deb7u4 x86_64 GNU/Linux