This is the mail archive of the mailing list for the GCC 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]

[PATCH] for Review: Fix for PR java/12548

Hi People,

This patch attempts to fix this:

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

2003-11-23  Mohan Embar  <>

	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 @@
-  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);

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