State clearly that an ELF file has the wrong architecture.
Before: "libx.so" has unexpected e_machine: 40 (EM_ARM) After: "libx.so" is for EM_X86_64 (62) instead of EM_AARCH64 (183) Bug: N/A Test: `LD_PRELOAD=/system/lib64/libm-x86_64.so date` on arm64 Change-Id: I5bb40c435bd22b4e11fe802615925e10db7fb631
This commit is contained in:
parent
8b527f2857
commit
d16cface55
1 changed files with 4 additions and 2 deletions
|
@ -257,8 +257,10 @@ bool ElfReader::VerifyElfHeader() {
|
|||
}
|
||||
|
||||
if (header_.e_machine != GetTargetElfMachine()) {
|
||||
DL_ERR("\"%s\" has unexpected e_machine: %d (%s)", name_.c_str(), header_.e_machine,
|
||||
EM_to_string(header_.e_machine));
|
||||
DL_ERR("\"%s\" is for %s (%d) instead of %s (%d)",
|
||||
name_.c_str(),
|
||||
EM_to_string(header_.e_machine), header_.e_machine,
|
||||
EM_to_string(GetTargetElfMachine()), GetTargetElfMachine());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue