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.
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

View file

@ -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);

View file

@ -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());
}