GCC can hide a build path by splitting its string constant
Harmen Stoppels demonstrates why searching compiled binaries for absolute build paths can miss real dependencies. In an optimized C++ example, GCC stores a path as overlapping vector-sized pieces and reconstructs it at runtime. Repeated pieces may also be deduplicated. The complete path therefore need not appear in strings output, even though the program still prints and uses it.
Harmen Stoppels · Nov 12, 2026
Why it matters
A successful text scan is weaker evidence of relocatability than executing or rebuilding under changed conditions.
More context
The examples target GCC on x86-64 and compare generated assembly with Clang. Package maintainers can inspect the demonstrated transformation and test relocation independently. The post also explains why prefix-patching approaches depend on paths remaining contiguous in the binary.
Keep in mind
The examples establish a concrete blind spot, not that every compiler or string literal behaves this way. Changing optimization flags alone does not establish a generally reliable path-auditing method.
Original read