Re: Variable location conflict: address() attribute vs small data section (-G num)
Attributes can affect how the variable needs to get accessed. And if another compile unit (C file) is accessing that variable, it needs to know how to do that, and it only has the declaration to get that information. And of course everywhere you should have the same information.
The easy way is to copy the whole variable definition from the .c file (except initialization of course), add an "extern" in front, and that's the declaration for your .h file. Simple and safe.
Also it helps to place a comment next to the definition, which tells you this is an extern used variable. In case you change it later, it is less likely that you forget to change the declaration accordingly.