ld/Linux: determine program name in a more reliable manner What argv[0] holds can be pretty arbitrary. As long as it's used for just diagnostics, that may be pretty okay to go from, but ld also uses it to find linker scripts. For that we want to be sure we start from the real executable name. Which on Linux we can determine from the /proc/self/exe symbolic link target (provided of course procfs is mounted). While there constify program_name as well.