The intel-HEX format was specifically developed for software PROM, EPROMS, or processors with internal EPROM and is commonly used with programmers for these devices. Addresses at the beginning of entries have nothing to do with program code. They indicate at which PROM address the data will be written. Remember also that PROM can be displayed anywhere in the address space of the processor, so the final address can change in any case.
Until you want to program the PROM, you must delete anything other than the data from the records. (Do not forget the checksum at the end ;-)
Since I understand the intel-HEX format, records should not be contiguous, there may be gaps between them.
Some notes:
The -f PIC option is not responsible for the intel-HEX format. I think somewhere in your command lines you will find -O ihex. If you want to have a file that can be executed, objcopy provides more suitable output formats.
As long as you do not write the earlier steps of the boot process yourself, you do not load the bootloader - it will be downloaded for you. The address at which this happens is usually fixed and does not change. Therefore, there is no need for a position-independent code, but that won't hurt either.
Kitana
source share