This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Compiler/TMS570LC4357: Assembler Bug in ARM CGT 16.9.1_LTS and 16.9.3_LTS

Part Number: TMS570LC4357

Tool/software: TI C/C++ Compiler

The assembler of above versions issues an error if branch destination is a exported label. Following code compiles fine and correct with previous versions:
.sect ".text"
.export func
func:
b no_cross
b cross
nop
no_cross:
nop
.export cross
cross:
nop
.end
Compile with:
armcl -mt -mv7r4 -c t.asm
It issues following error:
"t.asm", ERROR! at line 5: [E0001] Address must be defined in the current
section
b cross
  • Thank you for notifying us about this problem, and submitting a concise test case.  I can reproduce it.  I filed CODEGEN-2250 in the SDOWP system to have this investigated.  You are welcome to follow it with the SDOWP link below in my signature.

    Thanks and regards,

    -George

  • This is not a bug. You must use ".global", not ".export" in this case.

    ".export" is for dynamic linking, and means that the symbol may be pre-emptable. Because it may be pre-emptable, we must use a relocation. However, because this is a PC-relative "short" branch in Thumb mode, it does not allow a relocation. If you really want a relocatable branch there, use a long branch ("BL").

    Older versions of the assembler failed to detect this problem, and would fail to reject the code.

    Incidentally, I note that .export is not documented in the ALT. I'll submit a defect report against the documentation for it.
  • Ok, I'll change my code ...