In my embedded projects, there is a step after the process that replaces the value in the flash CRC executable (some sections). This step can only be done after the link, as this is the first opportunity for CRC images. In the past, the file format was COFF, and I created a special fix tool.
The development tool has switched to ELF, so I need to re-implement the CRC patcher. Before I did this, it seemed to me that I was looking for an existing tool for this. The compiler is gcc-based, but I don't see any combination of ld and nm and readelf that can do the job. A Google search was not fruitful.
My current tool uses nm to find the address to fix, and calls the patcher with the address, the expected value (to prevent overwriting the wrong data) and the new CRC value. CRC is calculated in the "hexadecimal" format of the executable file (which I also fix), so, fortunately, I do not need to repeat this part.
I can implement this with libelf and custom code again, but before I do this, does it already exist?
Is there a better way to accomplish my task of putting the CRC of an executable in an executable so that it is accessible to the application?
c embedded
Doug currie
source share