Hi,
I've created a custom firmware update process on a TI TM4c1294NCPDT (Arm Cortex-m4f) and have divided the flash into 2 partitions. I'd like to be able to build one image that will work in either of the partitions but so far haven't figured out how to do this. I tried the -fPIC compiler flag but that didn't work. So far I have to create 2 separate images, 1 for each partition. For each of the 2 images I have to specify the location in memory in the linker script. Any suggestions on how it's possible to build a position independent image?
Thanks,Doug Burrell
AFAIK, the C library included with the gcc toolchain is "newlib nano" in .../src/newlib; there is also libgcc which is at .../src/gcc/libgcc (both paths from the Source tar file you get from launchpad.net, next to the binaries...)
It might be quicker to compile with "-nostdlib" and add or replace code as needed than starting by trying to recompile the existing libraries.I should qualify that I don't have any actual experience with ARM PIC. I wouldn't be surprised if it is an ARM-32 option that doesn't even work on thumb-only chips like the Tiva :-( From your description, and the documentation on the ARM page, you want "Read Only Position Independence" - you want to put the code anywhere, but it's OK for RAM/Data accesses to be absolute, since only one of your images will run at a time...