I have a very specific question about the gcc linker description file. I have an embedded project and have to make sure, that the main symbol or the address of the main symb
If you already have a linker control file (I assume you are using a gcc toolchain), then you just need to put your object file containing your main() function into the very first section (and leave it out of the Makefile).
Here is an example:
MEMORY
{
rom (RX) : ORIGIN = START_ADDRESS, LENGTH = 0x0010000
}
SECTIONS
{
.text :
{
main.o (.text) /* this is the program entry point */
*(.text)
}
.data :
{
. = ALIGN(4);
*(.data)
}
}
(this is simplified a bit, but I think you get the point). The .text section begins at START_ADDRESS and as long as you make sure your main.o is located there (and main() is the first function in it), you are set.