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: Heap memory creation in linker command file

Part Number: TMS570LC4357


Tool/software: TI C/C++ Compiler

Hi Ti Experts,

I am trying to create Heap memory, until unless i create .sysmem section followed by alocation of that much memory, i am not seeing .sysmem creation.

Can you please help me if there is a way to directly creating .sysmem from the linker command file.

Below is the one which i have now. Though i updated my linker command file to define the heap size with out the below part i am not able to create .sysmem.

typedef struct heap_pack
{
size_t packet_size; /* number of bytes */
struct pack *size_ptr; /* next elem in free list */
} PACKET;
#pragma DATA_SECTION(_sys_memory, ".sysmem")
PACKET _sys_memory[1];

Regards,

Somesh

  • Hello Somesh,

    I will take a look and come back to you soon.

  • Hello Somesh,

    The C/C++ compiler uses an uninitialized section .sysmem for the C run-time memory pool used by malloc(). The size of this memory pool is set at link time by using the --heap_size option.

    The linker creates the .sysmem section only if there is a .sysmem section in an input file.

    If you add one of those functions in your c/c++ files (malloc, calloc, realloc, etc), the compiler will create the .sysmem section.