Bug 41151 - Gas fails to consume the assembly Error: offset too big
Summary: Gas fails to consume the assembly Error: offset too big
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.4.1
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-24 06:23 UTC by Khem Raj
Modified: 2009-12-11 18:10 UTC (History)
1 user (show)

See Also:
Host: x86_64-linux
Target: arm-none-linux-gnueabi
Build: x86_64-linux
Known to work:
Known to fail:
Last reconfirmed:


Attachments
preprocessed testcase (27.68 KB, text/plain)
2009-08-24 06:24 UTC, Khem Raj
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Khem Raj 2009-08-24 06:23:27 UTC
When compiling the test program 

arm-none-linux-gnueabi-gcc -march=armv7-a -O2 -c -o ltest.o ltest.i

Assembler fails to assemble it and emits the error 

Error: offset too big

If I do not use -march=armv7-a it works ok and also if I dont use O2 it compiles fine.
Comment 1 Khem Raj 2009-08-24 06:24:38 UTC
Created attachment 18417 [details]
preprocessed testcase
Comment 2 Ramana Radhakrishnan 2009-08-24 08:44:12 UTC
Using binutils trunk as well as r150986 I can't reproduce this with -O2 and -march=armv7-a. 


Comment 3 Khem Raj 2009-08-24 21:17:51 UTC
(In reply to comment #2)
> Using binutils trunk as well as r150986 I can't reproduce this with -O2 and
> -march=armv7-a. 
> 

I was using 2.18. I haven't tried 2.19 but it works ok with binutils from cvs(updated from today)
Comment 4 Thiago Macieira 2009-11-23 14:32:03 UTC
My experience:
gcc 4.4 + binutils 2.18.50.20070820 + no -march: ok
gcc 4.4 + binutils 2.18.50.20070820 + -march=armv7-a: error
gcc 4.4 + binutils 2.19.51.0.2.20090204: ok in both cases

The instruction I had problems with was:
        movw    r1, #:lower16:_ZL18qt_resource_struct

My guess is that gcc started generating these instructions for newer ARM models, but binutils 2.18 couldn't consume them properly. But since it works with a newer binutils, my guess is that the problem is fixed.
Comment 5 Ramana Radhakrishnan 2009-12-11 18:10:23 UTC
Needed an update to a newer version of binutils. Invalid.