This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [ecj] Abort if we are ABI-incompatible


At the moment, if we have a linkage error caused by an incompatible
ABI version we just segfault at some random place rather than
displaying an error message.  This is a Bad Thing.

Andrew.


2006-11-23  Andrew Haley  <aph@redhat.com>

	* java/lang/natClassLoader.cc (_Jv_RegisterClasses): Abort if we
	are ABI-incompatible.

Index: java/lang/natClassLoader.cc
===================================================================
--- java/lang/natClassLoader.cc (revision 119120)
+++ java/lang/natClassLoader.cc (working copy)
@@ -196,6 +196,12 @@
 
       if (_Jv_CheckABIVersion ((unsigned long) klass->next_or_version))
        (*_Jv_RegisterClassHook) (klass);
+      else
+       {
+         fprintf (stderr, "ABI mismatch: library is compiled with "
+                  "the wrong version of gcj\n");
+         abort ();
+       }
     }
 }
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]