Removed decompilation for non-ELF targets.
authorTerry Laurenzo <tlaurenzo@gmail.com>
Tue, 8 Nov 2005 00:21:21 +0000 (00:21 +0000)
committerTerry Laurenzo <tlaurenzo@gcc.gnu.org>
Tue, 8 Nov 2005 00:21:21 +0000 (00:21 +0000)
From-SVN: r106628

gcc/java/ChangeLog
gcc/java/gjavah.c

index 33c01d7d146d9f4c37727164bd4171dae67f8c13..bb614b5f87211f1f5f0da934a6738477eec39833 100644 (file)
@@ -1,3 +1,9 @@
+2005-11-07   Terry Laurenzo   <tlaurenzo@gmail.com>
+
+       * gjavah.c (HANDLE_CODE_ATTRIBUTE): Only define for ELF Object
+       formats.
+       * gjavah.c (decompile_method): Add ATTRIBUTE_UNUSED
+
 2005-10-12  Nathan Sidwell  <nathan@codesourcery.com>
            Wil Mahan <wmahan@gmail.com>
 
index 7ca5fc73e5d59f9a5926c369b902d8eb9be22cac..02fd7799bfe814094745b9ee106afdbf44a3e42a 100644 (file)
@@ -145,7 +145,7 @@ static void print_method_info (FILE*, JCF*, int, int, JCF_u2);
 static void print_c_decl (FILE*, JCF*, int, int, int, const char *, int);
 static void print_stub_or_jni (FILE*, JCF*, int, int, int, const char *, int);
 static void print_full_cxx_name (FILE*, JCF*, int, int, int, const char *, int);
-static void decompile_method (FILE*, JCF*, int);
+static void decompile_method (FILE*, JCF*, int) ATTRIBUTE_UNUSED;
 static void add_class_decl (FILE*, JCF*, JCF_u2);
 
 static void print_name (FILE *, JCF *, int);
@@ -250,8 +250,14 @@ static int is_first_data_member = 0;
       }                                                                        \
   }
 
+/* Only include byte-code decompilation optimizations for ELF targets
+   since the generated headers are only known to work with ELF weak
+   symbol semnatics. Specifically, these optimizations are known to
+   not work on PE-COFF and possibly others.  */
+#ifdef OBJECT_FORMAT_ELF
 #define HANDLE_CODE_ATTRIBUTE(MAX_STACK, MAX_LOCALS, CODE_LENGTH)      \
   if (out && method_declared) decompile_method (out, jcf, CODE_LENGTH);
+#endif
 
 static int decompiled = 0;
 #define HANDLE_END_METHOD()                            \