Fix DL_WARN_documented_change URL

The doc_link argument is really a URL fragment within the
android-changes-for-ndk-developers.md document, not a filename at the
root of the bionic repository.

Test: manual
Bug: none
Change-Id: I1b542e47aca132ce43ba1d50d83db1bf3c7b10c6
This commit is contained in:
Ryan Prichard 2020-03-26 19:55:05 -07:00
parent 323d7dfe90
commit 146620b644
3 changed files with 11 additions and 7 deletions

View file

@ -3273,9 +3273,8 @@ bool soinfo::link_image(const SymbolLookupList& lookup_list, soinfo* local_group
// Fail if app is targeting M or above. // Fail if app is targeting M or above.
int app_target_api_level = get_application_target_sdk_version(); int app_target_api_level = get_application_target_sdk_version();
if (app_target_api_level >= 23) { if (app_target_api_level >= 23) {
DL_ERR_AND_LOG("\"%s\" has text relocations (https://android.googlesource.com/platform/" DL_ERR_AND_LOG("\"%s\" has text relocations (%s#Text-Relocations-Enforced-for-API-level-23)",
"bionic/+/master/android-changes-for-ndk-developers.md#Text-Relocations-" get_realpath(), kBionicChangesUrl);
"Enforced-for-API-level-23)", get_realpath());
return false; return false;
} }
// Make segments writable to allow text relocations to work properly. We will later call // Make segments writable to allow text relocations to work properly. We will later call

View file

@ -71,6 +71,10 @@ class VersionTracker {
DISALLOW_COPY_AND_ASSIGN(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* get_libdl_info(const soinfo& linker_si);
soinfo* find_containing_library(const void* p); soinfo* find_containing_library(const void* p);

View file

@ -50,7 +50,7 @@ size_t linker_get_error_buffer_size() {
return sizeof(__linker_dl_err_buf); 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: "}; std::string result{"Warning: "};
va_list ap; 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, android::base::StringAppendF(&result,
" and will not work when the app moves to API level %d or later " " and will not work when the app moves to API level %d or later "
"(https://android.googlesource.com/platform/bionic/+/master/%s) " "(%s#%s) (allowing for now because this app's target API level is "
"(allowing for now because this app's target API level is still %d)", "still %d)",
api_level, doc_link, get_application_target_sdk_version()); api_level, kBionicChangesUrl, doc_fragment,
get_application_target_sdk_version());
DL_WARN("%s", result.c_str()); DL_WARN("%s", result.c_str());
} }