The pointer is interpreted differently depending on the "const" specified location.
To assign the const section to the zconst section, specify #pragma section zconst. To assign the const section to the zconst23 section, specify #pragma section zconst23.
This indicates that the object (*p) indicated by the pointer cannot be rewritten.
The pointer itself (p) can be rewritten.
Therefore the state becomes as follows and the pointer itself is allocated to RAM (.data etc.).
This indicates that the pointer itself (p) cannot be rewritten.
The object (*p) indicated by the pointer can be rewritten.
Therefore the state becomes as follows and the pointer itself is allocated to ROM (.const/.zconst/.zconst23).
This indicates that neither the pointer itself(p) nor the object (*p) indicated by the pointer can be rewritten.
Therefore the state becomes as follows and the pointer itself is allocated to ROM (.const/.zconst/.zconst23).