To reduce the ram usage I'm trying to use the UNION statement in the linker script to overlay the globals in remote_update.c with the globals used in the reset of the firmware. The following works, but I'm not happy with it. How can I tell the linker to overlay the globals from remote_update.c with ALL other globals, not just the ones from link.c?
UNION:
{
.bss:p1: : { link.obj(.bss) }
.bss:p2: : { remote_update.obj(.bss) }
} > RAM
.bss : {} > RAM /* Global & static vars */