In C, I believe the only guarantee about a string literal is that it will evaluate to a pointer to a readable area of memory that will, assuming a program does not engage in Undefined Behavior, always contain the indicated characters followed by a zero byte. The compiler and linker are allowed to work together in any fashion they see fit to make that happen. While I don't know of any compiler/linker systems that do this, it would be perfectly legitimate for a compiler to put each string literal in its own constant section, and for a linker to place such sections in reverse order of length, and check before placing each one whether the appropriate sequence of bytes had already been placed somewhere. Note that the sequence of bytes wouldn't even have to be a string literal or defined constant; if the linker is trying to place the string "Hi!"
and it notices that machine code contains the sequence of bytes [0x48, 0x69, 0x21, 0x00], the literal could evaluate to a pointer to the first of those.
Note that writing to the memory pointed to by a string literal is Undefined Behavior. On various system a write may trap, do nothing, or affect only the literal written, but it could also have totally unpredictable consequences [e.g. if the literal evaluated to a pointer into some machine code].