java_vm(NULL),
minimum_jni_version(0),
callback_poster(NULL),
- callback_poster_opaque(NULL) {
+ callback_poster_opaque(NULL),
+ no_map_exec_support_fallback_enabled(false) {
ResetSearchPaths();
}
int minimum_jni_version;
crazy_callback_poster_t callback_poster;
void* callback_poster_opaque;
+ bool no_map_exec_support_fallback_enabled;
};
void crazy_context_t::ResetSearchPaths() {
*minimum_jni_version = context->minimum_jni_version;
}
+void crazy_context_set_no_map_exec_support_fallback_enabled(
+ crazy_context_t* context, bool no_map_exec_support_fallback_enabled) {
+ context->no_map_exec_support_fallback_enabled =
+ no_map_exec_support_fallback_enabled;
+}
+
void crazy_context_set_callback_poster(crazy_context_t* context,
crazy_callback_poster_t poster,
void* poster_opaque) {
context->load_address,
context->file_offset,
&context->search_paths,
+ false,
&context->error);
if (!wrap)
RTLD_NOW,
context->load_address,
&context->search_paths,
+ context->no_map_exec_support_fallback_enabled,
&context->error);
if (!wrap)
}
}
+crazy_status_t crazy_library_file_path_in_zip_file(const char* lib_name,
+ char* buffer,
+ size_t buffer_size) {
+ crazy::String path = crazy::LibraryList::GetLibraryFilePathInZipFile(
+ lib_name);
+ if (path.size() >= buffer_size) {
+ return CRAZY_STATUS_FAILURE;
+ }
+
+ memcpy(buffer, path.c_str(), path.size());
+ buffer[path.size()] = '\0';
+ return CRAZY_STATUS_SUCCESS;
+}
+
+crazy_status_t crazy_linker_check_library_is_mappable_in_zip_file(
+ const char* zipfile_name,
+ const char* lib_name) {
+ Error error;
+ if (crazy::LibraryList::FindMappableLibraryInZipFile(
+ zipfile_name, lib_name, &error) == CRAZY_OFFSET_FAILED)
+ return CRAZY_STATUS_FAILURE;
+
+ return CRAZY_STATUS_SUCCESS;
+}
+
void crazy_library_close(crazy_library_t* library) {
crazy_library_close_with_context(library, NULL);
}