Skip to content

Commit 2cbbf26

Browse files
committed
linker: update non-PIE error message.
Also remove the commentary, which isn't really relevant in 2024. Change-Id: I9d17159daddc6717a2255d956c9a90820fe4d17a
1 parent 590a959 commit 2cbbf26

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

linker/linker_main.cpp

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -422,20 +422,11 @@ static ElfW(Addr) linker_main(KernelArgumentBlock& args, const char* exe_to_load
422422

423423
ElfW(Ehdr)* elf_hdr = reinterpret_cast<ElfW(Ehdr)*>(si->base);
424424

425-
// We haven't supported non-PIE since Lollipop for security reasons.
425+
// For security reasons we dropped non-PIE support in API level 21,
426+
// and the NDK no longer supports earlier API levels.
426427
if (elf_hdr->e_type != ET_DYN) {
427-
// We don't use async_safe_fatal here because we don't want a tombstone:
428-
// even after several years we still find ourselves on app compatibility
429-
// investigations because some app's trying to launch an executable that
430-
// hasn't worked in at least three years, and we've "helpfully" dropped a
431-
// tombstone for them. The tombstone never provided any detail relevant to
432-
// fixing the problem anyway, and the utility of drawing extra attention
433-
// to the problem is non-existent at this late date.
434-
async_safe_format_fd(STDERR_FILENO,
435-
"\"%s\": error: Android 5.0 and later only support "
436-
"position-independent executables (-fPIE).\n",
437-
g_argv[0]);
438-
_exit(EXIT_FAILURE);
428+
__linker_error("error: %s: Android only supports position-independent "
429+
"executables (-fPIE)\n", exe_info.path.c_str());
439430
}
440431

441432
// Use LD_LIBRARY_PATH and LD_PRELOAD (but only if we aren't setuid/setgid).

0 commit comments

Comments
 (0)