From 321bbe92b18236f2884f24e3216b078ec5e5690f Mon Sep 17 00:00:00 2001 From: Martin Stjernholm Date: Wed, 27 May 2020 21:19:09 +0100 Subject: [PATCH] Explain checkLinker errors a bit more. For an end user hitting these errors, the most likely reason is that they have mixed up linker and crtbegin_dynamic.o from different builds in their out tree. Test: Build a linux_bionic executable in a tree exhibiting b/157549171. Test: m nothing Bug: 157549171 Change-Id: I64bee0848ed61226da6654caf3bafb51cf46d923 --- cmd/host_bionic_inject/host_bionic_inject.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/host_bionic_inject/host_bionic_inject.go b/cmd/host_bionic_inject/host_bionic_inject.go index f7163d7e3..629f6cc14 100644 --- a/cmd/host_bionic_inject/host_bionic_inject.go +++ b/cmd/host_bionic_inject/host_bionic_inject.go @@ -105,7 +105,9 @@ func parseElf(r io.ReaderAt, linker *elf.File) (uint64, error) { err = checkLinker(file, linker, symbols) if err != nil { - return 0, err + return 0, fmt.Errorf("Linker executable failed verification against app embedded linker: %s\n"+ + "linker might not be in sync with crtbegin_dynamic.o.", + err) } start, err := findSymbol(symbols, "_start")