For an embedded system I need to place a few data structures at fixed addresses, so that a separate control CPU can access them at a known location. I'm using linker scripts for the embedded target to accomplish this, plus #defines of those same addresses for the control CPU.
It bothers me that these address constants are therefore defined in two places, the linker script and a header file. I'd like to have just one. The best solution I've come up with so far is to have the Makefile run cpp on the linker script, allowing it to #include the same header.
Is there a better way to accomplish this? Is there some little-known option to ld or a naming convention for the linker script which will automatically run it through cpp?