Many Linux distributions and package managers audit just-built binaries for non-relocatable absolute paths. But with GCC on x86-64, string constants don't always end up literally in the binary.
Linux distributions audit binaries for absolute paths that may not work on user machines. GCC may optimize string constants, making them appear as prefixes accidentally.
Linux distributions check binaries for non-relocatable paths.
GCC may optimize std::string, making prefixes appear coincidentally.
Absolute paths in binaries may not work on end-user machines.
Summarised automatically by AI from the original article by Hacker News. AI can make mistakes, so check the original for details.
Many[1][2][3][4][5][6][7][8][9] Linux distributions and package managers audit just-built binaries for non-relocatable absolute paths. If a binary contains a path /path/from/build/machine, it might not run on the end-user's machine.
The answer is no, at least when using GCC and targeting x86-64: you should not assume that string constants end up literally in the binary.
The answer is that GCC optimizes our std::string{PREFIX}. The fact that we see something that looks like the prefix is merely a coincidence.
Read the full story on Hacker NewsThat's the opening of the story. The full piece is published by Hacker News.
Hey HN! We're Alireza and Majid building Leeroo (https://leeroo.com/). Previously we’ve built AI systems for products with millions of users, including at LinkedIn and Meta…
AI summary AI models fail to address Women, Peace and Security principles, creating a competence gap in their understanding of global issues affecting women.
We used WordPress ourselves but struggled with ongoing maintenance. So we built an internal alternative CMS that met our needs. After two years of development, we decided to make…
The Cybertruck is heading to that shiny cyber-dumpster in the sky, leaving the folks who built online identities around Elon Musk's polarizing pickup feeling bereft. Usually…