'Can patching a version string literal in an ELF binary break the program?

My application ships with lots of console helper programs. When making a new release, I'd like to update the version number in those console helper programs to reflect the version number of the main program. The helper programs are all written in C and compiled using gcc. The version string is stored in a const char* string literal and all the program does with that version string is printf() it.

Now I know that hacking binaries certainly is no good practice at all and should be avoided. Still, I'm curious whether from a technical point of view this would be possible without causing any harm, i.e. breaking the binary or the binary getting marked as having been tampered with etc. That's of course something I'd like to avoid.

The binaries aren't codesigned or anything. They're plain console programs written in C and compiled using gcc. A test has shown that this indeed seems to work fine but still I'd like to know if it's maybe just luck that it works or if this is guaranteed to work.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source