TU A contains (only) the definition of a . Thus, a really is a non-constant object, and it can be accessed as such from function in without problems.
I am sure that TU B causes undefined behavior, since its declaration a not consistent with the definition. The best quote I have found so far to confirm that this is UB 6.7.5 / 2:
Each declarator declares one identifier and states that when an operand of the same form as the declarator appears in the expression, it denotes a function or object with the volume, duration of storage, and the type indicated by the specification of the declaration.
[Edit: since the questionnaire found the correct link in the standard, see the question.]
Here the declaration in B claims that a is of type volatile const int . In fact, the object does not have a (qualified) type volatile const int , it has a (qualified) type int . Violation of semantics - UB.
In practice, all that happens is that TU A will be compiled as if a not const. TU B will compile as if a were volatile const int , which means that it will not cache the value of a at all. Thus, I expect it to work if the linker does not notice and does not mind the inappropriate types, because I do not immediately see how TU B can emit code that goes wrong. However, my lack of imagination is not the same as guaranteed behavior.
AFAIK, there is nothing in the standard to say that volatile objects in a file area cannot be stored in a completely different memory bank from other objects, which provides different instructions for reading them. An implementation should still be able to read a normal object using, say, a volatile pointer, so suppose, for example, that a "normal" load command works on "special" objects, and it uses this when reading through a pointer to an unstable type. But if (as an optimization) the implementation has issued a special instruction for special objects, and a special instruction did not work on ordinary objects, then an arrow. And I think the programmer’s mistake, although I admit that I only invented this implementation 2 minutes ago, so I can’t be completely sure that it matches.