I would like to have the option of relocating my vector table to RAM at runtime, in a library (ie if the code doesn't need to do this, it doesn't, and the RAM isn't allocated or is eliminated by section garbage collection during link.)The actual relcation seems simple enough, but I'm having trouble figuring out how to get the most efficiently allocated chunk of RAM needed, because of the alignment requirements.
Any suggestions?(using the ARM gcc distribution, and mostly interested in Microchip SAMD2x and SAMD5x chips. But more general would be better! The actual goal is to be able to redefine the handlers for those multi-function SERCOM peripherals (and similar), depending on their desired function. I would prefer not to add an additional level of indirection.)
But if the vector table is in RAM you can modify it on depending on the current needs. What is the problem with having those 180 bytes at the beginning. If you are running out of memory already, you should consider a different SoC.