[Android] Fix runtime loading of DSOs for 64-bit processes (#14577)
commit72eb2ee84a4f397c5887159e288894778ea316a9
authormonojenkins <jo.shields+jenkins@xamarin.com>
Thu, 23 May 2019 14:56:37 +0000 (23 10:56 -0400)
committerGitHub <noreply@github.com>
Thu, 23 May 2019 14:56:37 +0000 (23 10:56 -0400)
tree2ee8c969d1f22c7aef0665ed9213bc1d7d7ab462
parentfa3b4812d7fd61deee1b36abdb313af2e036b65c
[Android] Fix runtime loading of DSOs for 64-bit processes (#14577)

[Android] Fix runtime loading of DSOs for 64-bit processes

Context: https://github.com/xamarin/xamarin-android/issues/2780

On Android the executable for the application is going to be
`/system/bin/app_process{32,64}` depending on the application's architecture.
However, libraries for the different architectures live in different
subdirectories of `/system`: `lib` for 32-bit apps and `lib64` for 64-bit ones.
Thus appending `/lib` below will fail to load the DSO for a 64-bit app, even if
it exists there, because it will have a different architecture. The quickest fix
is to use `lib64` explicitly for 64-bit Android apps.

<!--
Thank you for your Pull Request!

If you are new to contributing to Mono, please try to do your best at conforming to our coding guidelines http://www.mono-project.com/community/contributing/coding-guidelines/ but don't worry if you get something wrong. One of the project members will help you to get things landed.

Does your pull request fix any of the existing issues? Please use the following format: Fixes #issue-number
-->

Backport of #13281.

/cc @lambdageek @grendello
mono/metadata/loader.c