[Linux-Xtensa] gas problem with large function

linux-xtensa at linux-xtensa.org linux-xtensa at linux-xtensa.org
Tue Sep 2 08:43:15 PDT 2008

Hello again,

On Mon, Sep 01, 2008 at 13:08:45 +0200, linux-xtensa at linux-xtensa.org wrote:
> for test purpose, we fed into the xtensa GNU
> cross toolchain a source file which generates
> a very large function. The error message we see
> is:
> bash-3.00# xtensa-linux-gcc  -Os -o runtime runtime.c
> /tmp/ccwNQD70.s: Assembler messages:
> /tmp/ccwNQD70.s:12987: Error: operand 1 of 'j' has out of range value '156859'
> Checking the assembler output, we see there is
> an instruction "bltu" with its label far off.
> We currently use binutils .
> Down in xtensa-relax.c, there widening instructions
> to replace "bltu L" with "bgeu X ; j L ; X:", but
> the "j" jump is still limited to 128K offset to the PC.
> I guess, to fix the problem, we would need to add an
> relaxation like:
>   "j L" --> "literal X:L ; l32r a?,X ; jx a?"

I tried:

{"j %label", "LITERAL %label; l32r %ax,%LITERAL; jx %ax"},

but it complains about %ax not being resolvable. Of course.
Is there a way to acquire a register here, anyway?

thanks a lot,
oskar schirmer, emlix gmbh, http://www.emlix.com
fon +49 551 30664-0, fax -11, bahnhofsallee 1b, 37081 göttingen, germany
geschäftsführung: dr. uwe kracke, dr. cord seele, ust-idnr.: de 205 198 055
sitz der gesellschaft: göttingen, amtsgericht göttingen hr b 3160

emlix - your embedded linux partner

More information about the linux-xtensa mailing list