This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
class decls vs encode_section_info
- To: java-patches at gcc dot gnu dot org
- Subject: class decls vs encode_section_info
- From: Richard Henderson <rth at twiddle dot net>
- Date: Sun, 9 Sep 2001 00:47:17 -0700
DECL_EXTERNAL is set too late for ENCODE_SECTION_INFO
(called from make_decl_rtl) to see it.
I have experimental Alpha patches for which this mistake results in
gp-relative relocations against symbols in a shared library, which
is a link-time error. The only reason this doesn't break ia64 is that
ia64 only performs gp-relative optimizations against "small" data.
Ok?
r~
* class.c (build_class_ref): Set DECL_EXTERNAL before
calling make_decl_rtl.
Index: class.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/class.c,v
retrieving revision 1.113
diff -c -p -d -u -r1.113 class.c
--- class.c 2001/09/06 22:22:43 1.113
+++ class.c 2001/09/09 07:41:24
@@ -1026,13 +1026,13 @@ build_class_ref (type)
TREE_PUBLIC (decl) = 1;
DECL_IGNORED_P (decl) = 1;
DECL_ARTIFICIAL (decl) = 1;
+ if (is_compiled == 1)
+ DECL_EXTERNAL (decl) = 1;
SET_DECL_ASSEMBLER_NAME (decl,
java_mangle_class_field
(&temporary_obstack, type));
make_decl_rtl (decl, NULL);
pushdecl_top_level (decl);
- if (is_compiled == 1)
- DECL_EXTERNAL (decl) = 1;
}
}
else