Tool/software: TI C/C++ Compiler
Usually linkers provide the symbols etext, edata and end to indicate the one-past-the-last address of sections text, data and bss, respectively, so a programmer can use those symbols in a C program.
I'd like to have access to those symbols to be able to know what is the address of ram memory that corresponds to the first address of free memory, so I can use end as the start of heap.
Is there a flag that makes the linker provide those symbols to a C program? Is there an easier way of knowing what is the free memory region?
P.S.: I know the compiler libraries probably implement basic memory management and I could just use the standard C functions for dynamic memory allocation. But I want to implement it on my own for two reasons:
- I want to learn how to do it;
- I'm writing an OS and I want the OS to manage the memory.