[PATCH] for Review: Fix for PR java/12548
Mohan Embar
gnustuff@thisiscool.com
Sun Nov 23 16:12:00 GMT 2003
Hi People,
This patch attempts to fix this:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12548
This isn't my area of expertise, so I might be
diagnosing the problem incorrectly....
When compiling a jar file which contains resources,
write_constructor_resource uses get_file_function_name('I'),
which returns an identifier based on first_global_object_name.
However, this has already been used in another context.
On systems with weak symbol support, the linker tolerates
the local use of this symbol as the constructor identifier,
but not on systems without weak symbol support like
Win32 and Darwin.
This patch appends the suffix "_resource" to the
constructor identifier name and seems to resolve
the problem. I ran some informal tests on Linux
and Win32 with this, successfully compiling and using
jarfiles, but don't know how to run Jacks or whatever else
might be needed to officially certify this.
Let me know if you want me to follow up on this.
-- Mohan
http://www.thisiscool.com/
http://www.animalsong.org/
ChangeLog
2003-11-23 Mohan Embar <gnustuff@thisiscool.com>
PR java/12548
* resource.c (write_resource_constructor): append
"_resource" to constructor identifier name.
Index: resource.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/resource.c,v
retrieving revision 1.8
diff -u -2 -r1.8 resource.c
--- resource.c 22 Sep 2003 05:09:32 -0000 1.8
+++ resource.c 23 Nov 2003 15:49:45 -0000
@@ -111,5 +111,8 @@
return;
- init_name = get_file_function_name ('I');
+ init_name =
+ get_identifier (
+ concat (IDENTIFIER_POINTER (get_file_function_name ('I')),
+ "_resource", NULL));
init_type = build_function_type (void_type_node, end_params_node);
More information about the Java-patches
mailing list