Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit b7c2f61

Browse files
enh-googleGerrit Code Review
authored andcommitted
Merge "linker: use a string constant for the default PT_INTERP." into main
2 parents 83bbbf6 + 03eda27 commit b7c2f61

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

linker/linker_main.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -250,12 +250,6 @@ static ExecutableInfo get_executable_info(const char* arg_path) {
250250
return result;
251251
}
252252

253-
#if defined(__LP64__)
254-
static char kFallbackLinkerPath[] = "/system/bin/linker64";
255-
#else
256-
static char kFallbackLinkerPath[] = "/system/bin/linker";
257-
#endif
258-
259253
// Load an executable. Normally the kernel has already loaded the executable when the linker
260254
// starts. The linker can be invoked directly on an executable, though, and then the linker must
261255
// load it. This function doesn't load dependencies or resolve relocations.
@@ -380,7 +374,12 @@ static ElfW(Addr) linker_main(KernelArgumentBlock& args, const char* exe_to_load
380374
if (interp == nullptr) {
381375
// This case can happen if the linker attempts to execute itself
382376
// (e.g. "linker64 /system/bin/linker64").
383-
interp = kFallbackLinkerPath;
377+
#if defined(__LP64__)
378+
#define DEFAULT_INTERP "/system/bin/linker64"
379+
#else
380+
#define DEFAULT_INTERP "/system/bin/linker"
381+
#endif
382+
interp = DEFAULT_INTERP;
384383
}
385384
solinker->set_realpath(interp);
386385
init_link_map_head(*solinker);

0 commit comments

Comments
 (0)