diff --git a/mozglue/android/APKOpen.cpp b/mozglue/android/APKOpen.cpp index c009f2ff3855..04d35770295c 100644 --- a/mozglue/android/APKOpen.cpp +++ b/mozglue/android/APKOpen.cpp @@ -67,13 +67,6 @@ enum StartupEvent { using namespace mozilla; -static const int MAX_MAPPING_INFO = 32; -static mapping_info lib_mapping[MAX_MAPPING_INFO]; - -APKOPEN_EXPORT const struct mapping_info* getLibraryMapping() { - return lib_mapping; -} - void JNI_Throw(JNIEnv* jenv, const char* classname, const char* msg) { __android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "Throw\n"); jclass cls = jenv->FindClass(classname); @@ -148,32 +141,6 @@ static void* plc_handle = nullptr; #endif static void* nss_handle = nullptr; -static int mapping_count = 0; - -extern "C" void report_mapping(char* name, void* base, uint32_t len, - uint32_t offset) { - if (mapping_count >= MAX_MAPPING_INFO) return; - - struct mapping_info* info = &lib_mapping[mapping_count++]; - info->name = strdup(name); - info->base = (uintptr_t)base; - info->len = len; - info->offset = offset; -} - -extern "C" void delete_mapping(const char* name) { - for (int pos = 0; pos < mapping_count; ++pos) { - struct mapping_info* info = &lib_mapping[pos]; - if (!strcmp(info->name, name)) { - struct mapping_info* last = &lib_mapping[mapping_count - 1]; - free(info->name); - *info = *last; - --mapping_count; - break; - } - } -} - static UniquePtr getUnpackedLibraryName(const char* libraryName) { static const char* libdir = getenv("MOZ_ANDROID_LIBDIR"); diff --git a/mozglue/android/APKOpen.h b/mozglue/android/APKOpen.h index 10a092d8d8f9..f3666bf02885 100644 --- a/mozglue/android/APKOpen.h +++ b/mozglue/android/APKOpen.h @@ -11,14 +11,6 @@ # define APKOPEN_EXPORT __attribute__((visibility("default"))) #endif -struct mapping_info { - char* name; - uintptr_t base; - size_t len; - size_t offset; -}; - -APKOPEN_EXPORT const struct mapping_info* getLibraryMapping(); APKOPEN_EXPORT void abortThroughJava(const char* msg); static const int SUCCESS = 0; diff --git a/toolkit/crashreporter/nsExceptionHandler.cpp b/toolkit/crashreporter/nsExceptionHandler.cpp index 16c541d9b880..55c4dc06d38c 100644 --- a/toolkit/crashreporter/nsExceptionHandler.cpp +++ b/toolkit/crashreporter/nsExceptionHandler.cpp @@ -382,35 +382,6 @@ static const SIZE_T kReserveSize = 0x5000000; // 80 MB static void* gBreakpadReservedVM; #endif -#if defined(MOZ_WIDGET_ANDROID) -// Android builds use a custom library loader, -// so the embedding will provide a list of shared -// libraries that are mapped into anonymous mappings. -typedef struct { - std::string name; - uintptr_t start_address; - size_t length; - size_t file_offset; -} mapping_info; -static std::vector gLibraryMappings; - -static void AddMappingInfoToExceptionHandler(const mapping_info& aInfo) { - PageAllocator allocator; - auto_wasteful_vector guid(&allocator); - FileID::ElfFileIdentifierFromMappedFile( - reinterpret_cast(aInfo.start_address), guid); - gExceptionHandler->AddMappingInfo(aInfo.name, guid, aInfo.start_address, - aInfo.length, aInfo.file_offset); -} - -static void AddAndroidMappingInfo() { - for (auto info : gLibraryMappings) { - AddMappingInfoToExceptionHandler(info); - } -} - -#endif // defined(MOZ_WIDGET_ANDROID) - #ifdef XP_LINUX static inline void my_inttostring(intmax_t t, char* buffer, size_t buffer_length) { @@ -2116,10 +2087,6 @@ nsresult SetExceptionHandler(nsIFile* aXREDirectory, bool force /*=false*/) { if (keyExistsAndHasValidFormat) showOSCrashReporter = prefValue; #endif -#if defined(MOZ_WIDGET_ANDROID) - AddAndroidMappingInfo(); -#endif // defined(MOZ_WIDGET_ANDROID) - mozalloc_set_oom_abort_handler(AnnotateOOMAllocationSize); oldTerminateHandler = std::set_terminate(&TerminateHandler); @@ -3904,20 +3871,6 @@ void SetNotificationPipeForChild(int childCrashFd) { void SetCrashAnnotationPipeForChild(int childCrashAnnotationFd) { gChildCrashAnnotationReportFd = childCrashAnnotationFd; } - -void AddLibraryMapping(const char* library_name, uintptr_t start_address, - size_t mapping_length, size_t file_offset) { - mapping_info info; - if (!gExceptionHandler) { - info.name = library_name; - info.start_address = start_address; - info.length = mapping_length; - info.file_offset = file_offset; - gLibraryMappings.push_back(info); - } else { - AddMappingInfoToExceptionHandler(info); - } -} #endif } // namespace CrashReporter diff --git a/toolkit/crashreporter/nsExceptionHandler.h b/toolkit/crashreporter/nsExceptionHandler.h index 6a2abf218dad..e95ddb95aec9 100644 --- a/toolkit/crashreporter/nsExceptionHandler.h +++ b/toolkit/crashreporter/nsExceptionHandler.h @@ -323,15 +323,6 @@ bool UnsetRemoteExceptionHandler(); // the handle for the pipe since it can't get remapped to a default value. void SetNotificationPipeForChild(int childCrashFd); void SetCrashAnnotationPipeForChild(int childCrashAnnotationFd); - -// Android builds use a custom library loader, so /proc//maps -// will just show anonymous mappings for all the non-system -// shared libraries. This API is to work around that by providing -// info about the shared libraries that are mapped into these anonymous -// mappings. -void AddLibraryMapping(const char* library_name, uintptr_t start_address, - size_t mapping_length, size_t file_offset); - #endif // Annotates the crash report with the name of the calling thread. diff --git a/toolkit/xre/nsAndroidStartup.cpp b/toolkit/xre/nsAndroidStartup.cpp index a4bc71250eae..8df017edc6fb 100644 --- a/toolkit/xre/nsAndroidStartup.cpp +++ b/toolkit/xre/nsAndroidStartup.cpp @@ -15,7 +15,6 @@ #include "nsTArray.h" #include "nsString.h" #include "nsAppRunner.h" -#include "APKOpen.h" #include "nsExceptionHandler.h" #include "mozilla/Bootstrap.h" @@ -27,13 +26,6 @@ extern "C" NS_EXPORT void GeckoStart(JNIEnv* env, char** argv, int argc, const StaticXREAppData& aAppData) { mozilla::jni::SetGeckoThreadEnv(env); - const struct mapping_info* info = getLibraryMapping(); - while (info->name) { - CrashReporter::AddLibraryMapping(info->name, info->base, info->len, - info->offset); - info++; - } - if (!argv) { LOG("Failed to get arguments for GeckoStart\n"); return;