• Resolved

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
b no_cross
b cross
.export cross
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
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,


    TI C/C++ Compiler Forum Moderator
    Please click This Resolved My Issue on the best reply to your question
    The CCS Youtube Channel
     has short how-to videos
    Compiler Wiki answers most common questions
    Track an issue with SDOWP. Enter your bug id in the Search box.

  • 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.
  • In reply to Archaeologist:

    Ok, I'll change my code ...