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.

undefined symbol __STACK_END

Hi.  I am trying to hack-out system.lib from starterware (on the beaglebone).  

I do this by taking a simple working program, create a new project with it and

physically copy the .asm .c and .h dependencies to the working directory as needed.  

I got it to compile but there is an unresolved symbol.  Here is a piece of the .map:  

UNDEFED SHT$$INIT_ARRAY$$Base     <<< no big deal
UNDEFED SHT$$INIT_ARRAY$$Limit     <<< no big deal
800012b8 SVC_Handler
80001390 UndefInstHandler
UNDEFED __STACK_END

__STACK_END is referenced in init.asm and it is defined by the linker (supposedly).  

According to the spnu118m manual:

The following symbols are defined only for C/C++ support when the --ram_model or --rom_model option is used...

(I am using the --rom_model option)

It may be that the source file is .asm (not C) that the linker does not define __STACK_END?

Is there a way to tell the linker to define it in the .cmd file or something?

thanks................dd

  • I presume you build with the TI ARM compiler, and that you use EABI, and not the older COFF ABI.  In that case, the symbol __TI_STACK_END is automatically defined as the end of the .stack section.  If there is no .stack section, then __TI_STACK_END is not defined.  The .stack section is normally defined in the RTS library module boot.obj (which is built from boot.asm).   The .stack section may be defined in the system.lib you mention, but I don't know that.

    Thanks and regards,

    -George

  • You got it George!  I did not copy over boot.asm, it looked redundant.  

    My little program compiled, linked, loaded and ran without any linked libraries or includes whatsoever!  

    We are rocking!  Absolute bare metal on the bone is doable!  

    thanks................dd