Hi,
I'm working on an embedded project at home using GNU gcc & ld. I need to burn a function into a particular flash rom address. My attempt will be to place the function in its own file and define a section like:
SECTIONS { MySection 0x10000: { MyFile.o } _MySectionEnd = . ; }
Then, in my app, I should be able to refer to _MySectionEnd to get the end address of the function. I'm pretty sure this, or a variant will work (my syntax might not be 100% as I'm an ld newbie).
But, is there a better way? Also, while this is OK for one, or a few functions, it would be a pain if I ever had to do a lot of 'em. I know there's a "section" attribute for gnu C, so I was wondering if I can create one or more MySection1 and _MySection1End symbol pairs in a linker script and somehow place each function at the desired section while all functions reside in one file?
Thanks for the ideas!
Jim