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.

TM4C123GH6PM vtable without SECTIONS

Other Parts Discussed in Thread: TM4C123GH6PM

Hello everybody,

I'm using the TM4C123GH6PM together with TivaWare code and I'm getting a strange linker warning:

Description Resource Path Location Type
#10247-D creating output section "vtable" without a SECTIONS My_stack_project C/C++ Problem

I find this weird because I have my lm4f230h5qr.cmd in the project and it's also selected in the project properties. The contents of the lm4f230h5qr.cmd file is this:

 

/******************************************************************************
*
* Default Linker Command file for the Texas Instruments LM4F230H5QR
*
* This is part of revision 9385 of the Stellaris Peripheral Driver Library.
*
*****************************************************************************/

--retain=g_pfnVectors

MEMORY
{
FLASH (RX) : origin = 0x00000000, length = 0x00040000
SRAM (RWX) : origin = 0x20000000, length = 0x00008000
}

/* The following command line options are set as part of the CCS project. */
/* If you are building using the command line, or for some reason want to */
/* define them here, you can uncomment and modify these lines as needed. */
/* If you are using CCS for building, it is probably better to make any such */
/* modifications in your CCS project and leave this file alone. */
/* */
/* --heap_size=0 */
/* --stack_size=256 */
/* --library=rtsv7M4_T_le_eabi.lib */

/* Section allocation in memory */

SECTIONS
{
.intvecs: > 0x00000000
.text : > FLASH
.const : > FLASH
.cinit : > FLASH
.pinit : > FLASH

.vtable : > 0x20000000
.data : > SRAM
.bss : > SRAM
.sysmem : > SRAM
.stack : > SRAM
}

__STACK_TOP = __stack + 256;

 

Any idea how might I get rid of this warning? Thanks

  • Hello Martin,

    The .cmd file name in TivaWare is of the format "<example>_ccs.cmd", different from the one you are using. I compared the .cmd file that you posted to the one from the TivaWare build and found the line ".init_array : > FLASH" is missing. It should be present after ".pinit  :   > FLASH" in the .cmd that you posted. Please refer to a CCS project from TivaWare build to avoid such problems.

    Regards,
    Sai
  • Hello Sai,

    thanks for your response. I've tried copying the contents of several of the "<example>_ccs.cmd" files into my .cmd file, however the problem persists with all of them. My .cmd content is now:


    --retain=g_pfnVectors

    /* The starting address of the application. Normally the interrupt vectors */
    /* must be located at the beginning of the application. */
    #define APP_BASE 0x00000000
    #define RAM_BASE 0x20000000

    /* System memory map */

    MEMORY
    {
    /* Application stored in and executes from internal flash */
    FLASH (RX) : origin = APP_BASE, length = 0x00040000
    /* Application uses internal RAM for data */
    SRAM (RWX) : origin = 0x20000000, length = 0x00008000
    }

    /* Section allocation in memory */

    SECTIONS
    {
    .intvecs: > APP_BASE
    .text : > FLASH
    .const : > FLASH
    .cinit : > FLASH
    .pinit : > FLASH
    .init_array : > FLASH

    .vtable : > RAM_BASE
    .data : > SRAM
    .bss : > SRAM
    .sysmem : > SRAM
    .stack : > SRAM
    }

    __STACK_TOP = __stack + 512;

    One thing also seems a little weird. All the other lines like .text, .const, .pinit etc... are highlighted but .init_array and .vtable are not. Any ideas? Thanks

     

  • So I finally managed to get rid of the warning. The problem wasn't in the .cmd file but in my interrupt.c source file. There was a conditional compilation block with 

    #elif defined(ccs) || defined(DOXYGEN)
    #pragma DATA_ALIGN(g_pfnRAMVectors, 1024)
    #pragma DATA_SECTION(g_pfnRAMVectors, ".vtable")
    void (*g_pfnRAMVectors[NUM_INTERRUPTS])(void);

    and for some reason the compiler even though I'm using CCS didn't consider ccs as defined so 

    #else
    static __attribute__((section("vtable")))
    void (*g_pfnRAMVectors[NUM_INTERRUPTS])(void) __attribute__ ((aligned(1024)));
    #endif

    got compiled instead. I changed the ccs to something that I know is defined.

    Hope that helps.

    Martin

     

  • I am glad you were able to solve the issue. I would like to suggest that it would be easier to use an existing project from the TivaWare build and add or remove files as needed. This would have the project environment setup as needed by the different libraries.

    Regards,
    Sai