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.

unresolved symbol L_LSL_24 ?

Other Parts Discussed in Thread: MSP430F2274

I'm trying to compile (well, link at this point) a program for MSP430, CCSv4 (4.2.4) with Grace stuff in there, and get this odd one:

unresolved symbol L_LSL_24, first referenced in ./main.obj timeTotalizer line 0

when I look at the map file, I see a pile of similar looking symbols, here's a few lines:

but I can't find where these come from (not my program), or why this extra one is in there (they progress from 1 to 15....)

00008742   L_LSL_13

0000873e   L_LSL_14

0000873a   L_LSL_15

0000876e   L_LSL_2

UNDEFED    L_LSL_24

0000876a   L_LSL_3

00008766   L_LSL_4

00008762   L_LSL_5

any clues?

  • These labels come from optimization.

    When you do a shift by n bits, the compiler could generate a loop that shifts the value n times by one bit (the MSP, at least the standard CPU core) does not have a command for multiple shifts.
    A shift by 8 or 16 bits is usually simply a byte swap or word offset, but for all other numbers, a lot of code needs to be generated. To shrink this, the compiler generates a row of shift commands wher eeach one has a label attached. Then the compiler makes a function call to the desired label, the CPU executes the number of shifts depending on where it jumped into the list, then returns. This is a bit slower but much smaller than having a number of shifts inlined into the code on each shift operation.

    However, the mssing label surprises me, as  a shift by 24 bit is soemthign that can be done by moving the source byte into the highest byte of the target long, and requires no shift operation at all (as you can see, there is no L_LSL_16 ot L_LSL_8 label too, fo the same reason)

    My first guess is a comiler bug, since shifts above 15 should be a move to the upper word with a shift below 16 there.
    (actually, a shift up to 19 bit could be useful, when using the 20bit register extensions for large code/data model, but that's a different thing)

  • thanks for the info...

    i can send you the project (privately, sorry about that) if you need to investigate.  in the meantime how do I cure it?

    looks like the msp430f2274 doesn't have a hardware multiplier...

  • bowerymarc said:
    looks like the msp430f2274 doesn't have a hardware multiplier

    The problem is not related to the hardware multiplier.
    The compiler should simply never generate code that references a 24 bit shift. I don't know what's wrong, maybe you shoudl ask the same quesiton in the compiler forum.

    bowerymarc said:
    i can send you the project (privately, sorry about that) if you need to investigate.

    a private sendign wouldn't be a problem, but would be futile, since I user MSPGCC and do not have CCS or IAR installed at all. And since this is a compiler-specific issue... I'm not the right person for investigating this.

  • Jens-Michael Gross said:
    I'm not the right person for investigating this.

    agreed.

**Attention** This is a public forum