Send developers straight to the text relocation docs.

It's been years since we allowed text relocations, but I had a developer
ask me how to fix them at last week's O Developer Day. They'd never seen
our docs, so let's try to fix that for anyone else who's still confused...

Bug: N/A
Test: builds
Change-Id: I9202a7b0a3f024041b646c43c87585f4fab22d09
This commit is contained in:
Elliott Hughes 2017-04-10 09:52:33 -07:00
parent 2d389ffee9
commit 763f6e108a

View file

@ -3251,13 +3251,16 @@ bool soinfo::link_image(const soinfo_list_t& global_group, const soinfo_list_t&
if (has_text_relocations) {
// Fail if app is targeting M or above.
if (get_application_target_sdk_version() >= __ANDROID_API_M__) {
DL_ERR_AND_LOG("\"%s\" has text relocations", get_realpath());
DL_ERR_AND_LOG("\"%s\" has text relocations (https://android.googlesource.com/platform/"
"bionic/+/master/android-changes-for-ndk-developers.md#Text-Relocations-"
"Enforced-for-API-level-23)", get_realpath());
return false;
}
// Make segments writable to allow text relocations to work properly. We will later call
// phdr_table_protect_segments() after all of them are applied.
DL_WARN("\"%s\" has text relocations. This is wasting memory and prevents "
"security hardening. Please fix.", get_realpath());
DL_WARN("\"%s\" has text relocations (https://android.googlesource.com/platform/"
"bionic/+/master/android-changes-for-ndk-developers.md#Text-Relocations-Enforced-"
"for-API-level-23)", get_realpath());
add_dlwarning(get_realpath(), "text relocations");
if (phdr_table_unprotect_segments(phdr, phnum, load_bias) < 0) {
DL_ERR("can't unprotect loadable segments for \"%s\": %s",