Patch: java class registration via .jcr section, take 3

Richard Henderson rth@redhat.com
Wed Aug 8 10:16:00 GMT 2001


On Tue, Aug 07, 2001 at 02:29:41AM -0400, green@peach.cygnus.co.uk wrote:
> 	* java/class.c (jcr_section): New function.
>         (emit_register_classes): Use assemble_jcr if possible.  Keep the
> 	original mechanism as a fallback.
> 	* defaults.h (JCR_SECTION_NAME): Define if we have named section
> 	and weak symbol support.
> 	* crtstuff.c (__JCR_LIST__): Define.
> 	(__JCR_END__): Define.
> 	(_Jv_RegiserClasses): Define weak symbol if possible.
> 	(__do_global_ctors_aux): Register classes for ELF targets with
> 	weak symbol support.

Ok with changes:

> +static void
> +assemble_jcr (symbol)
> +     rtx symbol;

You forgot to prototype this, but we'd be doing less work if

> +      for ( t = registered_class; t; t = TREE_CHAIN (t))
> +	assemble_jcr (XEXP (DECL_RTL (t), 0), 0);

was written as

	named_section_flags (JCR_SECTION_NAME, SECTION_WRITE,
			     POINTER_SIZE / BITS_PER_UNIT);
	for (t = registered_class; t; t = TREE_CHAIN (t))
	  assemble_integer (XEXP (DECL_RTL (t), 0),
			    POINTER_SIZE / BITS_PER_UNIT, 1);



r~



More information about the Gcc-patches mailing list