diff --git a/linker/linker.cpp b/linker/linker.cpp index bf7517855..ac83cae9a 100644 --- a/linker/linker.cpp +++ b/linker/linker.cpp @@ -3273,9 +3273,8 @@ bool soinfo::link_image(const SymbolLookupList& lookup_list, soinfo* local_group // Fail if app is targeting M or above. int app_target_api_level = get_application_target_sdk_version(); if (app_target_api_level >= 23) { - 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()); + DL_ERR_AND_LOG("\"%s\" has text relocations (%s#Text-Relocations-Enforced-for-API-level-23)", + get_realpath(), kBionicChangesUrl); return false; } // Make segments writable to allow text relocations to work properly. We will later call diff --git a/linker/linker.h b/linker/linker.h index 2da14041b..9b6af3be2 100644 --- a/linker/linker.h +++ b/linker/linker.h @@ -71,6 +71,10 @@ class VersionTracker { DISALLOW_COPY_AND_ASSIGN(VersionTracker); }; +static constexpr const char* kBionicChangesUrl = + "https://android.googlesource.com/platform/bionic/+/master/" + "android-changes-for-ndk-developers.md"; + soinfo* get_libdl_info(const soinfo& linker_si); soinfo* find_containing_library(const void* p); diff --git a/linker/linker_globals.cpp b/linker/linker_globals.cpp index bcc2a1e6f..31da02cfe 100644 --- a/linker/linker_globals.cpp +++ b/linker/linker_globals.cpp @@ -50,7 +50,7 @@ size_t linker_get_error_buffer_size() { return sizeof(__linker_dl_err_buf); } -void DL_WARN_documented_change(int api_level, const char* doc_link, const char* fmt, ...) { +void DL_WARN_documented_change(int api_level, const char* doc_fragment, const char* fmt, ...) { std::string result{"Warning: "}; va_list ap; @@ -60,8 +60,9 @@ void DL_WARN_documented_change(int api_level, const char* doc_link, const char* android::base::StringAppendF(&result, " and will not work when the app moves to API level %d or later " - "(https://android.googlesource.com/platform/bionic/+/master/%s) " - "(allowing for now because this app's target API level is still %d)", - api_level, doc_link, get_application_target_sdk_version()); + "(%s#%s) (allowing for now because this app's target API level is " + "still %d)", + api_level, kBionicChangesUrl, doc_fragment, + get_application_target_sdk_version()); DL_WARN("%s", result.c_str()); }