[Linux-Xtensa] gas problem with large function

linux-xtensa at linux-xtensa.org linux-xtensa at linux-xtensa.org
Mon Sep 1 04:08:45 PDT 2008


Hello,

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 2.18.50.0.3 .
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?"

- is that correct?

- how should the widening instruction look like exactly?

- at which position to insert this into the existing table?


on request, we can send You the source files that
caused the problems, off course. They are some 200K,
that's why I didn't attach them here.

thanks a lot,
  Oskar
-- 
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