Reputation: 87
I'm compiling a C program for an embedded application using eclipse, but I need the code to know (at runtime) where exactly it ends in flash. What is the simplest way of doing this? Thanks
Upvotes: 1
Views: 377
Reputation: 46
You will need to go into the linker command file and create some labels that mark the start and end of the .text section in memory then in the code take the difference.
Upvotes: 2
Reputation: 399753
You're probably going to have to involve the linker, to do this.
Read up on the tools you're using, and see if (and how) to make the linker set the value of symbols owned by the program.
For the GNU linker, the relevant manual section is Section Data Expressions.
Upvotes: 0