8164512: Replace ClassLoader use of finalizer with phantom reference to unload native library
Reviewed-by: alanb, bchristi, kbarrett, dholmes, plevart
data = R0x2000;
text = LOAD ?RXO;
# Test Null
text: .text%_init;
text: .text%JNI_OnLoad;
text: .text%Canonicalize;
text: .text%canonicalize;
text: .text%collapse: OUTPUTDIR/canonicalize_md.o;
text: .text%Java_java_lang_Object_registerNatives;
text: .text%Java_java_lang_System_registerNatives;
text: .text%Java_java_lang_Thread_registerNatives;
text: .text%Java_java_security_AccessController_getStackAccessControlContext;
text: .text%Java_java_security_AccessController_getInheritedAccessControlContext;
text: .text%Java_java_lang_ClassLoader_registerNatives;
text: .text%Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedAction_2;
text: .text%Java_java_lang_Class_registerNatives;
text: .text%Java_java_lang_Class_getPrimitiveClass;
text: .text%Java_java_lang_System_initProperties;
text: .text%GetJavaProperties;
text: .text%uname: OUTPUTDIR/java_props_md.o;
text: .text%mapLookup: OUTPUTDIR/java_props_md.o;
text: .text%JNU_NewStringPlatform;
text: .text%JNU_CallStaticMethodByName;
text: .text%NewStringPlatform;
text: .text%Java_java_io_FileInputStream_initIDs;
text: .text%Java_java_io_FileDescriptor_initIDs;
text: .text%Java_java_io_FileOutputStream_initIDs;
text: .text%Java_java_lang_System_setIn0;
text: .text%Java_sun_reflect_Reflection_getCallerClass__;
text: .text%Java_sun_reflect_Reflection_getCallerClass__I;
text: .text%Java_java_lang_Class_forName0;
text: .text%Java_java_lang_String_intern;
text: .text%Java_java_lang_StringUTF16_isBigEndian;
text: .text%Java_sun_reflect_NativeConstructorAccessorImpl_newInstance0;
text: .text%Java_java_lang_Throwable_fillInStackTrace;
text: .text%Java_java_lang_System_setOut0;
text: .text%Java_java_lang_System_setErr0;
text: .text%JNU_NewObjectByName;
text: .text%Java_java_io_UnixFileSystem_initIDs;
text: .text%Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedExceptionAction_2;
text: .text%Java_java_io_UnixFileSystem_list;
text: .text%JNU_GetStringPlatformChars;
text: .text%JNU_ReleaseStringPlatformChars;
text: .text%JNU_ClassString;
text: .text%JNU_CopyObjectArray;
text: .text%Java_java_io_UnixFileSystem_canonicalize0;
text: .text%Java_java_io_UnixFileSystem_getBooleanAttributes0;
text: .text%Java_java_lang_ClassLoader_findLoadedClass0;
text: .text%Java_java_lang_ClassLoader_findBootstrapClass;
text: .text%Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedExceptionAction_2Ljava_security_AccessControlContext_2;
text: .text%Java_java_lang_System_mapLibraryName;
text: .text%cpchars: OUTPUTDIR/System.o;
text: .text%Java_java_lang_ClassLoader_00024NativeLibrary_load0;
text: .text%Java_java_lang_ClassLoader_00024NativeLibrary_findEntry;
text: .text%Java_java_lang_Float_floatToRawIntBits;
text: .text%Java_java_lang_Double_doubleToRawLongBits;
text: .text%Java_java_io_FileInputStream_open0;
text: .text%fileOpen;
text: .text%Java_java_io_UnixFileSystem_getLength;
text: .text%Java_java_io_FileInputStream_readBytes;
text: .text%readBytes;
text: .text%Java_java_io_FileInputStream_close0;
text: .text%Java_java_lang_Object_getClass;
text: .text%Java_java_lang_ClassLoader_defineClass0;
text: .text%VerifyClassCodes;
# Test Exit
text: .text%Java_java_lang_Shutdown_halt0;
# Test Hello
text: .text%Java_java_io_FileOutputStream_writeBytes;
text: .text%writeBytes;
# Test Sleep
# Test IntToString
# Test LoadToolkit
text: .text%Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedAction_2Ljava_security_AccessControlContext_2;
text: .text%JNU_GetEnv;
text: .text%Java_java_io_UnixFileSystem_checkAccess;
text: .text%Java_sun_reflect_NativeMethodAccessorImpl_invoke0;
text: .text%Java_java_io_FileInputStream_available0;
text: .text%Java_java_lang_reflect_Array_newArray;
text: .text%Java_java_lang_StackTraceElement_initStackTraceElements;
text: .text%Java_java_lang_System_identityHashCode;
text: .text%JNU_NotifyAll;
# Test LoadFrame
text: .text%JNU_CallMethodByName;
text: .text%JNU_CallMethodByNameV;
text: .text%Java_java_util_logging_FileHandler_lockFile;
text: .text%Java_java_io_FileOutputStream_open0;
text: .text%Java_java_io_UnixFileSystem_createDirectory;
text: .text%Java_java_io_UnixFileSystem_getLastModifiedTime;
text: .text%Java_java_io_UnixFileSystem_setLastModifiedTime;
text: .text%Java_java_io_FileOutputStream_close0;
text: .text%Java_java_util_logging_FileHandler_unlockFile;
# Test LoadJFrame
text: .text%Java_java_lang_Class_isAssignableFrom;
text: .text%Java_java_lang_Class_isInstance;
# Test JHello
# SwingSet
text: .text%Java_java_util_TimeZone_getSystemTimeZoneID;
text: .text%findJavaTZ_md;
text: .text%Java_java_lang_StrictMath_log;