public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Remove .jcr registry from the crtfiles
@ 2016-10-01 20:29 Jakub Jelinek
  2016-10-01 20:47 ` Florian Weimer
  2016-10-03 15:26 ` Joseph Myers
  0 siblings, 2 replies; 8+ messages in thread
From: Jakub Jelinek @ 2016-10-01 20:29 UTC (permalink / raw)
  To: Richard Biener, Andrew Haley, Ian Lance Taylor; +Cc: gcc-patches

Hi!

Now that GCJ is gone, I think we should remove the the tests for .jcr
sections from the crtfiles, which slows down (by a couple of instructions
and some relocations) every gcc compiled binary/library.

Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

2016-10-01  Jakub Jelinek  <jakub@redhat.com>

gcc/
	* defaults.h (JCR_SECTION_NAME, TARGET_USE_JCR_SECTION): Remove.
	* doc/tm.texi.in (TARGET_USE_JCR_SECTION): Remove.
	* doc/tm.texi: Regenerated.
	* config/i386/mingw32.h (TARGET_USE_JCR_SECTION): Remove.
	* config/i386/cygming.h (TARGET_USE_JCR_SECTION): Remove.
	* config/darwin.h (JCR_SECTION_NAME): Remove.
	* config/pa/pa64-hpux.h (JCR_SECTION_NAME): Remove.
	* config/rs6000/aix71.h (TARGET_USE_JCR_SECTION): Remove.
	* config/rs6000/aix51.h (TARGET_USE_JCR_SECTION): Remove.
	* config/rs6000/aix52.h (TARGET_USE_JCR_SECTION): Remove.
	* config/rs6000/aix53.h (TARGET_USE_JCR_SECTION): Remove.
	* config/rs6000/aix61.h (TARGET_USE_JCR_SECTION): Remove.
gcc/c-family/
	* c-cppbuiltin.c (c_cpp_builtins): Don't define
	__LIBGCC_JCR_SECTION_NAME__.
libgcc/
	* config/i386/cygming-crtbegin.c (_Jv_RegisterClasses): Remove.
	(__JCR_LIST__): Remove.
	(__gcc_register_frame): Don't attempt to _Jv_RegisterClasses.
	* config/i386/cygming-crtend.c (__JCR_END__): Remove.
	* config/ia64/crtbegin.S (__JCR_LIST__): Remove.
	* config/ia64/crtend.S (__JCR_END__): Remove.
	* crtstuff.c: Remove __LIBGCC_JCR_SECTION_NAME__ from preprocessor
	conditionals.
	(__JCR_LIST__, __JCR_END__): Remove.
	(frame_dummy): Don't attempt to _Jv_RegisterClasses.
	(__do_global_ctors_1): Likewise.

--- gcc/config/i386/mingw32.h.jj	2016-05-20 09:05:08.836063467 +0200
+++ gcc/config/i386/mingw32.h	2016-10-01 18:55:14.646199686 +0200
@@ -239,9 +239,6 @@ do {						         \
 #undef TARGET_N_FORMAT_TYPES
 #define TARGET_N_FORMAT_TYPES 3
 
-/* Let defaults.h definition of TARGET_USE_JCR_SECTION apply. */
-#undef TARGET_USE_JCR_SECTION
-
 #define HAVE_ENABLE_EXECUTE_STACK
 #undef  CHECK_EXECUTE_STACK_ENABLED
 #define CHECK_EXECUTE_STACK_ENABLED flag_setstackexecutable
--- gcc/config/i386/cygming.h.jj	2016-09-27 09:46:13.000000000 +0200
+++ gcc/config/i386/cygming.h	2016-10-01 18:56:16.133441952 +0200
@@ -443,11 +443,6 @@ do {						\
 
 #endif /* HAVE_GAS_WEAK */
 
-/* FIXME: SUPPORTS_WEAK && TARGET_HAVE_NAMED_SECTIONS is true,
-   but for .jcr section to work we also need crtbegin and crtend
-   objects.  */
-#define TARGET_USE_JCR_SECTION 1
-
 /* Decide whether it is safe to use a local alias for a virtual function
    when constructing thunks.  */
 #undef TARGET_USE_LOCAL_THUNK_ALIAS_P
--- gcc/config/darwin.h.jj	2016-09-15 13:39:14.518013115 +0200
+++ gcc/config/darwin.h	2016-10-01 18:55:40.056886539 +0200
@@ -825,9 +825,6 @@ enum machopic_addr_class {
 #define EH_FRAME_SECTION_NAME   "__TEXT"
 #define EH_FRAME_SECTION_ATTR ",coalesced,no_toc+strip_static_syms+live_support"
 
-/* Java runtime class list.  */
-#define JCR_SECTION_NAME "__DATA,jcr,regular,no_dead_strip"
-
 #undef ASM_PREFERRED_EH_DATA_FORMAT
 #define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL)  \
   (((CODE) == 2 && (GLOBAL) == 1) \
--- gcc/config/pa/pa64-hpux.h.jj	2016-04-08 19:19:23.894042211 +0200
+++ gcc/config/pa/pa64-hpux.h	2016-10-01 18:55:35.171946738 +0200
@@ -170,8 +170,6 @@ along with GCC; see the file COPYING3.
 #define DATA_SECTION_ASM_OP	"\t.data"
 #define BSS_SECTION_ASM_OP	"\t.section\t.bss"
 
-#define JCR_SECTION_NAME	".jcr"
-
 #define HP_INIT_ARRAY_SECTION_ASM_OP	"\t.section\t.init"
 #define GNU_INIT_ARRAY_SECTION_ASM_OP	"\t.section\t.init_array"
 #define HP_FINI_ARRAY_SECTION_ASM_OP	"\t.section\t.fini"
@@ -382,8 +380,8 @@ do {								\
    initializers specified here.  */
 
 /* We need to add frame_dummy to the initializer list if EH_FRAME_SECTION_NAME
-   or JCR_SECTION_NAME is defined.  */
-#if defined(EH_FRAME_SECTION_NAME) || defined(JCR_SECTION_NAME)
+   is defined.  */
+#if defined(EH_FRAME_SECTION_NAME)
 #define PA_INIT_FRAME_DUMMY_ASM_OP ".dword P%frame_dummy"
 #else
 #define PA_INIT_FRAME_DUMMY_ASM_OP ""
--- gcc/config/rs6000/aix71.h.jj	2016-01-21 21:28:01.218834652 +0100
+++ gcc/config/rs6000/aix71.h	2016-10-01 18:55:49.667768100 +0200
@@ -210,8 +210,6 @@ extern long long int    atoll(const char
 /* This target defines SUPPORTS_WEAK and TARGET_ASM_NAMED_SECTION,
    but does not have crtbegin/end.  */
 
-#define TARGET_USE_JCR_SECTION 0
-
 #define TARGET_AIX_VERSION 71
 
 /* AIX 7.1 supports DWARF3 debugging, but XCOFF remains the default.  */
--- gcc/config/rs6000/aix51.h.jj	2016-06-20 10:30:35.629607920 +0200
+++ gcc/config/rs6000/aix51.h	2016-10-01 18:55:51.659743552 +0200
@@ -163,8 +163,6 @@ do {									\
 /* This target defines SUPPORTS_WEAK and TARGET_ASM_NAMED_SECTION,
    but does not have crtbegin/end.  */
 
-#define TARGET_USE_JCR_SECTION 0
-
 #define TARGET_AIX_VERSION 51
 
 #undef TARGET_LIBC_HAS_FUNCTION
--- gcc/config/rs6000/aix52.h.jj	2016-01-04 14:55:57.081414429 +0100
+++ gcc/config/rs6000/aix52.h	2016-10-01 18:55:43.356845872 +0200
@@ -176,6 +176,4 @@ extern long long int    atoll(const char
 /* This target defines SUPPORTS_WEAK and TARGET_ASM_NAMED_SECTION,
    but does not have crtbegin/end.  */
 
-#define TARGET_USE_JCR_SECTION 0
-
 #define TARGET_AIX_VERSION 52
--- gcc/config/rs6000/aix53.h.jj	2016-01-04 14:55:57.280411661 +0100
+++ gcc/config/rs6000/aix53.h	2016-10-01 18:55:47.620793326 +0200
@@ -177,6 +177,4 @@ extern long long int    atoll(const char
 /* This target defines SUPPORTS_WEAK and TARGET_ASM_NAMED_SECTION,
    but does not have crtbegin/end.  */
 
-#define TARGET_USE_JCR_SECTION 0
-
 #define TARGET_AIX_VERSION 53
--- gcc/config/rs6000/aix61.h.jj	2016-01-04 14:55:57.150413469 +0100
+++ gcc/config/rs6000/aix61.h	2016-10-01 18:55:45.736816543 +0200
@@ -210,6 +210,4 @@ extern long long int    atoll(const char
 /* This target defines SUPPORTS_WEAK and TARGET_ASM_NAMED_SECTION,
    but does not have crtbegin/end.  */
 
-#define TARGET_USE_JCR_SECTION 0
-
 #define TARGET_AIX_VERSION 61
--- gcc/defaults.h.jj	2016-09-29 22:53:12.000000000 +0200
+++ gcc/defaults.h	2016-10-01 18:56:54.180973076 +0200
@@ -392,27 +392,6 @@ see the files COPYING3 and COPYING.RUNTI
 #define MASK_RETURN_ADDR NULL_RTX
 #endif
 
-/* If we have named section and we support weak symbols, then use the
-   .jcr section for recording java classes which need to be registered
-   at program start-up time.  */
-#if defined (TARGET_ASM_NAMED_SECTION) && SUPPORTS_WEAK
-#ifndef JCR_SECTION_NAME
-#define JCR_SECTION_NAME ".jcr"
-#endif
-#endif
-
-/* This decision to use a .jcr section can be overridden by defining
-   USE_JCR_SECTION to 0 in target file.  This is necessary if target
-   can define JCR_SECTION_NAME but does not have crtstuff or
-   linker support for .jcr section.  */
-#ifndef TARGET_USE_JCR_SECTION
-#ifdef JCR_SECTION_NAME
-#define TARGET_USE_JCR_SECTION 1
-#else
-#define TARGET_USE_JCR_SECTION 0
-#endif
-#endif
-
 /* Number of hardware registers that go into the DWARF-2 unwind info.
    If not defined, equals FIRST_PSEUDO_REGISTER  */
 
--- gcc/c-family/c-cppbuiltin.c.jj	2016-09-27 21:15:39.000000000 +0200
+++ gcc/c-family/c-cppbuiltin.c	2016-10-01 19:49:58.395673099 +0200
@@ -1213,10 +1213,6 @@ c_cpp_builtins (cpp_reader *pfile)
       builtin_define_with_value ("__LIBGCC_EH_FRAME_SECTION_NAME__",
 				 EH_FRAME_SECTION_NAME, 1);
 #endif
-#ifdef JCR_SECTION_NAME
-      builtin_define_with_value ("__LIBGCC_JCR_SECTION_NAME__",
-				 JCR_SECTION_NAME, 1);
-#endif
 #ifdef CTORS_SECTION_ASM_OP
       builtin_define_with_value ("__LIBGCC_CTORS_SECTION_ASM_OP__",
 				 CTORS_SECTION_ASM_OP, 1);
--- gcc/doc/tm.texi.in.jj	2016-09-23 09:32:12.000000000 +0200
+++ gcc/doc/tm.texi.in	2016-10-01 19:48:14.537954491 +0200
@@ -8186,12 +8186,6 @@ and scanf formatter settings.
 
 @hook TARGET_CONVERT_TO_TYPE
 
-@defmac TARGET_USE_JCR_SECTION
-This macro determines whether to use the JCR section to register Java
-classes. By default, TARGET_USE_JCR_SECTION is defined to 1 if both
-SUPPORTS_WEAK and TARGET_HAVE_NAMED_SECTIONS are true, else 0.
-@end defmac
-
 @defmac OBJC_JBLEN
 This macro determines the size of the objective C jump buffer for the
 NeXT runtime. By default, OBJC_JBLEN is defined to an innocuous value.
--- gcc/doc/tm.texi.jj	2016-09-27 09:46:07.000000000 +0200
+++ gcc/doc/tm.texi	2016-10-01 19:48:23.254846943 +0200
@@ -11598,12 +11598,6 @@ conversion rules.
 This is currently used only by the C and C++ front ends.
 @end deftypefn
 
-@defmac TARGET_USE_JCR_SECTION
-This macro determines whether to use the JCR section to register Java
-classes. By default, TARGET_USE_JCR_SECTION is defined to 1 if both
-SUPPORTS_WEAK and TARGET_HAVE_NAMED_SECTIONS are true, else 0.
-@end defmac
-
 @defmac OBJC_JBLEN
 This macro determines the size of the objective C jump buffer for the
 NeXT runtime. By default, OBJC_JBLEN is defined to an innocuous value.
--- libgcc/config/i386/cygming-crtbegin.c.jj	2016-01-04 15:14:09.000000000 +0100
+++ libgcc/config/i386/cygming-crtbegin.c	2016-10-01 18:53:57.743147396 +0200
@@ -73,18 +73,6 @@ __deregister_frame_info (__attribute__((
 #endif
 #endif /* DWARF2_UNWIND_INFO */
 
-#if TARGET_USE_JCR_SECTION
-extern void _Jv_RegisterClasses (__attribute__((unused)) const void *)
-  TARGET_ATTRIBUTE_WEAK;
-
-#ifdef __x86_64__
-TARGET_ATTRIBUTE_WEAK void
-_Jv_RegisterClasses (__attribute__((unused)) const void *p)
-{
-}
-#endif
-#endif /* TARGET_USE_JCR_SECTION */
-
 #if defined(HAVE_LD_RO_RW_SECTION_MIXING)
 # define EH_FRAME_SECTION_CONST const
 #else
@@ -105,12 +93,6 @@ HANDLE hmod_libgcc;
 static void *  (*deregister_frame_fn) (const void *) = NULL;
 #endif
 
-#if TARGET_USE_JCR_SECTION
-static void *__JCR_LIST__[]
-  __attribute__ ((used, section(__LIBGCC_JCR_SECTION_NAME__), aligned(4)))
-  = { };
-#endif
-
 #ifdef __CYGWIN__
 /* Declare the __dso_handle variable.  It should have a unique value
    in every shared-object; in a main program its value is zero.  The
@@ -163,22 +145,6 @@ __gcc_register_frame (void)
      register_frame_fn (__EH_FRAME_BEGIN__, &obj);
 #endif
 
-#if TARGET_USE_JCR_SECTION 
-  if (__JCR_LIST__[0])
-    {
-      void (*register_class_fn) (const void *);
-      HANDLE h = GetModuleHandle (LIBGCJ_SONAME);
-      if (h)
-	register_class_fn = (void (*) (const void *))
-			     GetProcAddress (h, "_Jv_RegisterClasses");
-      else
-	register_class_fn = _Jv_RegisterClasses;
-
-      if (register_class_fn)
-	register_class_fn (__JCR_LIST__);
-    }
-#endif
-
 #if DEFAULT_USE_CXA_ATEXIT
   /* If we use the __cxa_atexit method to register C++ dtors
      at object construction,  also use atexit to register eh frame
--- libgcc/config/i386/cygming-crtend.c.jj	2016-01-04 15:14:09.000000000 +0100
+++ libgcc/config/i386/cygming-crtend.c	2016-10-01 18:54:11.980971937 +0200
@@ -53,14 +53,6 @@ static EH_FRAME_SECTION_CONST int __FRAM
   = { 0 };
 #endif
 
-#if TARGET_USE_JCR_SECTION
-/* Null terminate the .jcr section array.  */
-static void *__JCR_END__[1] 
-   __attribute__ ((used, section(__LIBGCC_JCR_SECTION_NAME__),
-		   aligned(sizeof(void *))))
-   = { 0 };
-#endif
-
 extern void __gcc_register_frame (void); 
 extern void __gcc_deregister_frame (void);
 
--- libgcc/config/ia64/crtbegin.S.jj	2016-01-04 15:14:10.000000000 +0100
+++ libgcc/config/ia64/crtbegin.S	2016-10-01 18:53:10.237732825 +0200
@@ -34,10 +34,6 @@ __CTOR_LIST__:
 __DTOR_LIST__:
 	data8	-1
 
-.section .jcr,"aw","progbits"
-	.align	8
-__JCR_LIST__:
-
 .section .sdata
 	.type dtor_ptr,@object
 	.size dtor_ptr,8
--- libgcc/config/ia64/crtend.S.jj	2016-01-04 15:14:10.000000000 +0100
+++ libgcc/config/ia64/crtend.S	2016-10-01 18:53:19.641616937 +0200
@@ -34,11 +34,6 @@ __CTOR_END__:
 __DTOR_END__:
 	data8	0
 
-.section .jcr,"aw","progbits"
-	.align 8
-__JCR_END__:
-	data8	0
-
 #if HAVE_INITFINI_ARRAY_SUPPORT
 	.global __do_global_ctors_aux
 	.hidden	__do_global_ctors_aux
--- libgcc/crtstuff.c.jj	2016-01-04 15:14:09.000000000 +0100
+++ libgcc/crtstuff.c	2016-10-01 18:51:52.246693943 +0200
@@ -266,15 +266,6 @@ STATIC EH_FRAME_SECTION_CONST char __EH_
      = { };
 #endif /* USE_EH_FRAME_REGISTRY */
 
-#ifdef __LIBGCC_JCR_SECTION_NAME__
-/* Stick a label at the beginning of the java class registration info
-   so we can register them properly.  */
-STATIC void *__JCR_LIST__[]
-  __attribute__ ((used, section(__LIBGCC_JCR_SECTION_NAME__),
-		  aligned(sizeof(void*))))
-  = { };
-#endif /* __LIBGCC_JCR_SECTION_NAME__ */
-
 #if USE_TM_CLONE_REGISTRY
 STATIC func_ptr __TMC_LIST__[]
   __attribute__((used, section(".tm_clone_table"), aligned(sizeof(void*))))
@@ -449,7 +440,6 @@ CRT_CALL_STATIC_FUNCTION (__LIBGCC_INIT_
 #endif
 
 #if defined(USE_EH_FRAME_REGISTRY) \
-    || defined(__LIBGCC_JCR_SECTION_NAME__) \
     || defined(USE_TM_CLONE_REGISTRY)
 /* Stick a call to __register_frame_info into the .init section.  For some
    reason calls with no arguments work more reliably in .init, so stick the
@@ -472,18 +462,6 @@ frame_dummy (void)
 #endif /* CRT_GET_RFIB_DATA */
 #endif /* USE_EH_FRAME_REGISTRY */
 
-#ifdef __LIBGCC_JCR_SECTION_NAME__
-  void **jcr_list;
-  __asm ("" : "=g" (jcr_list) : "0" (__JCR_LIST__));
-  if (__builtin_expect (*jcr_list != NULL, 0))
-    {
-      void (*register_classes) (void *) = _Jv_RegisterClasses;
-      __asm ("" : "+r" (register_classes));
-      if (register_classes)
-	register_classes (jcr_list);
-    }
-#endif /* __LIBGCC_JCR_SECTION_NAME__ */
-
 #if USE_TM_CLONE_REGISTRY
   register_tm_clones ();
 #endif /* USE_TM_CLONE_REGISTRY */
@@ -496,7 +474,7 @@ static func_ptr __frame_dummy_init_array
   __attribute__ ((__used__, section(".init_array"), aligned(sizeof(func_ptr))))
   = { frame_dummy };
 #endif /* !defined(__LIBGCC_INIT_SECTION_ASM_OP__) */
-#endif /* USE_EH_FRAME_REGISTRY || __LIBGCC_JCR_SECTION_NAME__ || USE_TM_CLONE_REGISTRY */
+#endif /* USE_EH_FRAME_REGISTRY || USE_TM_CLONE_REGISTRY */
 
 #else  /* OBJECT_FORMAT_ELF */
 
@@ -564,7 +542,6 @@ __do_global_dtors (void)
 }
 
 #if defined(USE_EH_FRAME_REGISTRY) \
-    || defined(__LIBGCC_JCR_SECTION_NAME__) \
     || defined(USE_TM_CLONE_REGISTRY)
 /* A helper function for __do_global_ctors, which is in crtend.o.  Here
    in crtbegin.o, we can reference a couple of symbols not visible there.
@@ -579,23 +556,11 @@ __do_global_ctors_1(void)
     __register_frame_info (__EH_FRAME_BEGIN__, &object);
 #endif
 
-#ifdef __LIBGCC_JCR_SECTION_NAME__
-  void **jcr_list;
-  __asm ("" : "=g" (jcr_list) : "0" (__JCR_LIST__));
-  if (__builtin_expect (*jcr_list != NULL, 0))
-    {
-      void (*register_classes) (void *) = _Jv_RegisterClasses;
-      __asm ("" : "+r" (register_classes));
-      if (register_classes)
-	register_classes (jcr_list);
-    }
-#endif
-
 #if USE_TM_CLONE_REGISTRY
   register_tm_clones ();
 #endif /* USE_TM_CLONE_REGISTRY */
 }
-#endif /* USE_EH_FRAME_REGISTRY || __LIBGCC_JCR_SECTION_NAME__ || USE_TM_CLONE_REGISTRY */
+#endif /* USE_EH_FRAME_REGISTRY || USE_TM_CLONE_REGISTRY */
 
 #else /* ! __LIBGCC_INIT_SECTION_ASM_OP__ && ! HAS_INIT_SECTION */
 #error "What are you doing with crtstuff.c, then?"
@@ -671,14 +636,6 @@ STATIC EH_FRAME_SECTION_CONST int32 __FR
      = { 0 };
 #endif /* __LIBGCC_EH_FRAME_SECTION_NAME__ */
 
-#ifdef __LIBGCC_JCR_SECTION_NAME__
-/* Null terminate the .jcr section array.  */
-STATIC void *__JCR_END__[1]
-   __attribute__ ((used, section(__LIBGCC_JCR_SECTION_NAME__),
-		   aligned(sizeof(void *))))
-   = { 0 };
-#endif /* __LIBGCC_JCR_SECTION_NAME__ */
-
 #if USE_TM_CLONE_REGISTRY
 # ifndef HAVE_GAS_HIDDEN
 static
@@ -757,7 +714,6 @@ __do_global_ctors (void)
 {
   func_ptr *p;
 #if defined(USE_EH_FRAME_REGISTRY) \
-    || defined(__LIBGCC_JCR_SECTION_NAME__) \
     || defined(USE_TM_CLONE_REGISTRY)
   __do_global_ctors_1();
 #endif

	Jakub

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] Remove .jcr registry from the crtfiles
  2016-10-01 20:29 [PATCH] Remove .jcr registry from the crtfiles Jakub Jelinek
@ 2016-10-01 20:47 ` Florian Weimer
  2016-10-01 21:23   ` Jakub Jelinek
  2016-10-03 15:26 ` Joseph Myers
  1 sibling, 1 reply; 8+ messages in thread
From: Florian Weimer @ 2016-10-01 20:47 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Richard Biener, Andrew Haley, Ian Lance Taylor, gcc-patches

* Jakub Jelinek:

> Now that GCJ is gone, I think we should remove the the tests for .jcr
> sections from the crtfiles, which slows down (by a couple of instructions
> and some relocations) every gcc compiled binary/library.

Why were they needed *in every DSO* in the first place?

We still have _ITM_registerTMCloneTable, _ITM_deregisterTMCloneTable,
and __gmon_start__ on amd64, which don't look terribly relevant for
most users, either.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] Remove .jcr registry from the crtfiles
  2016-10-01 20:47 ` Florian Weimer
@ 2016-10-01 21:23   ` Jakub Jelinek
  0 siblings, 0 replies; 8+ messages in thread
From: Jakub Jelinek @ 2016-10-01 21:23 UTC (permalink / raw)
  To: Florian Weimer
  Cc: Richard Biener, Andrew Haley, Ian Lance Taylor, gcc-patches

On Sat, Oct 01, 2016 at 10:46:53PM +0200, Florian Weimer wrote:
> * Jakub Jelinek:
> 
> > Now that GCJ is gone, I think we should remove the the tests for .jcr
> > sections from the crtfiles, which slows down (by a couple of instructions
> > and some relocations) every gcc compiled binary/library.
> 
> Why were they needed *in every DSO* in the first place?

They aren't strictly needed, I guess it would be possible to add additional
crt files for the various compilation modes (-fgnu-tm, in the past linking
with gcj driver, etc.) and do the registration only there.  But it is
actually implemented in the shared crt files, by looking at the section
sizes and testing weak undef function symbols.

> We still have _ITM_registerTMCloneTable, _ITM_deregisterTMCloneTable,
> and __gmon_start__ on amd64, which don't look terribly relevant for
> most users, either.

	Jakub

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] Remove .jcr registry from the crtfiles
  2016-10-01 20:29 [PATCH] Remove .jcr registry from the crtfiles Jakub Jelinek
  2016-10-01 20:47 ` Florian Weimer
@ 2016-10-03 15:26 ` Joseph Myers
  2016-10-03 17:29   ` Jakub Jelinek
  1 sibling, 1 reply; 8+ messages in thread
From: Joseph Myers @ 2016-10-03 15:26 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Richard Biener, Andrew Haley, Ian Lance Taylor, gcc-patches

As usual when removing target macros they should be poisoned in system.h.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] Remove .jcr registry from the crtfiles
  2016-10-03 15:26 ` Joseph Myers
@ 2016-10-03 17:29   ` Jakub Jelinek
  2016-10-04  7:36     ` Richard Biener
  2016-10-05  7:52     ` Andreas Schwab
  0 siblings, 2 replies; 8+ messages in thread
From: Jakub Jelinek @ 2016-10-03 17:29 UTC (permalink / raw)
  To: Joseph Myers; +Cc: Richard Biener, Andrew Haley, Ian Lance Taylor, gcc-patches

On Mon, Oct 03, 2016 at 03:26:10PM +0000, Joseph Myers wrote:
> As usual when removing target macros they should be poisoned in system.h.

Here is the patch with that poisoning.  Bootstrapped/regtested on
x86_64-linux and i686-linux again, ok for trunk?

2016-10-03  Jakub Jelinek  <jakub@redhat.com>

gcc/
	* defaults.h (JCR_SECTION_NAME, TARGET_USE_JCR_SECTION): Remove.
	* system.h (JCR_SECTION_NAME, TARGET_USE_JCR_SECTION): Poison.
	* doc/tm.texi.in (TARGET_USE_JCR_SECTION): Remove.
	* doc/tm.texi: Regenerated.
	* config/i386/mingw32.h (TARGET_USE_JCR_SECTION): Remove.
	* config/i386/cygming.h (TARGET_USE_JCR_SECTION): Remove.
	* config/darwin.h (JCR_SECTION_NAME): Remove.
	* config/pa/pa64-hpux.h (JCR_SECTION_NAME): Remove.
	* config/rs6000/aix71.h (TARGET_USE_JCR_SECTION): Remove.
	* config/rs6000/aix51.h (TARGET_USE_JCR_SECTION): Remove.
	* config/rs6000/aix52.h (TARGET_USE_JCR_SECTION): Remove.
	* config/rs6000/aix53.h (TARGET_USE_JCR_SECTION): Remove.
	* config/rs6000/aix61.h (TARGET_USE_JCR_SECTION): Remove.
gcc/c-family/
	* c-cppbuiltin.c (c_cpp_builtins): Don't define
	__LIBGCC_JCR_SECTION_NAME__.
libgcc/
	* config/i386/cygming-crtbegin.c (_Jv_RegisterClasses): Remove.
	(__JCR_LIST__): Remove.
	(__gcc_register_frame): Don't attempt to _Jv_RegisterClasses.
	* config/i386/cygming-crtend.c (__JCR_END__): Remove.
	* config/ia64/crtbegin.S (__JCR_LIST__): Remove.
	* config/ia64/crtend.S (__JCR_END__): Remove.
	* crtstuff.c: Remove __LIBGCC_JCR_SECTION_NAME__ from preprocessor
	conditionals.
	(__JCR_LIST__, __JCR_END__): Remove.
	(frame_dummy): Don't attempt to _Jv_RegisterClasses.
	(__do_global_ctors_1): Likewise.

--- gcc/config/i386/mingw32.h.jj	2016-05-20 09:05:08.836063467 +0200
+++ gcc/config/i386/mingw32.h	2016-10-01 18:55:14.646199686 +0200
@@ -239,9 +239,6 @@ do {						         \
 #undef TARGET_N_FORMAT_TYPES
 #define TARGET_N_FORMAT_TYPES 3
 
-/* Let defaults.h definition of TARGET_USE_JCR_SECTION apply. */
-#undef TARGET_USE_JCR_SECTION
-
 #define HAVE_ENABLE_EXECUTE_STACK
 #undef  CHECK_EXECUTE_STACK_ENABLED
 #define CHECK_EXECUTE_STACK_ENABLED flag_setstackexecutable
--- gcc/config/i386/cygming.h.jj	2016-09-27 09:46:13.000000000 +0200
+++ gcc/config/i386/cygming.h	2016-10-01 18:56:16.133441952 +0200
@@ -443,11 +443,6 @@ do {						\
 
 #endif /* HAVE_GAS_WEAK */
 
-/* FIXME: SUPPORTS_WEAK && TARGET_HAVE_NAMED_SECTIONS is true,
-   but for .jcr section to work we also need crtbegin and crtend
-   objects.  */
-#define TARGET_USE_JCR_SECTION 1
-
 /* Decide whether it is safe to use a local alias for a virtual function
    when constructing thunks.  */
 #undef TARGET_USE_LOCAL_THUNK_ALIAS_P
--- gcc/config/darwin.h.jj	2016-09-15 13:39:14.518013115 +0200
+++ gcc/config/darwin.h	2016-10-01 18:55:40.056886539 +0200
@@ -825,9 +825,6 @@ enum machopic_addr_class {
 #define EH_FRAME_SECTION_NAME   "__TEXT"
 #define EH_FRAME_SECTION_ATTR ",coalesced,no_toc+strip_static_syms+live_support"
 
-/* Java runtime class list.  */
-#define JCR_SECTION_NAME "__DATA,jcr,regular,no_dead_strip"
-
 #undef ASM_PREFERRED_EH_DATA_FORMAT
 #define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL)  \
   (((CODE) == 2 && (GLOBAL) == 1) \
--- gcc/config/pa/pa64-hpux.h.jj	2016-04-08 19:19:23.894042211 +0200
+++ gcc/config/pa/pa64-hpux.h	2016-10-01 18:55:35.171946738 +0200
@@ -170,8 +170,6 @@ along with GCC; see the file COPYING3.
 #define DATA_SECTION_ASM_OP	"\t.data"
 #define BSS_SECTION_ASM_OP	"\t.section\t.bss"
 
-#define JCR_SECTION_NAME	".jcr"
-
 #define HP_INIT_ARRAY_SECTION_ASM_OP	"\t.section\t.init"
 #define GNU_INIT_ARRAY_SECTION_ASM_OP	"\t.section\t.init_array"
 #define HP_FINI_ARRAY_SECTION_ASM_OP	"\t.section\t.fini"
@@ -382,8 +380,8 @@ do {								\
    initializers specified here.  */
 
 /* We need to add frame_dummy to the initializer list if EH_FRAME_SECTION_NAME
-   or JCR_SECTION_NAME is defined.  */
-#if defined(EH_FRAME_SECTION_NAME) || defined(JCR_SECTION_NAME)
+   is defined.  */
+#if defined(EH_FRAME_SECTION_NAME)
 #define PA_INIT_FRAME_DUMMY_ASM_OP ".dword P%frame_dummy"
 #else
 #define PA_INIT_FRAME_DUMMY_ASM_OP ""
--- gcc/config/rs6000/aix71.h.jj	2016-01-21 21:28:01.218834652 +0100
+++ gcc/config/rs6000/aix71.h	2016-10-01 18:55:49.667768100 +0200
@@ -210,8 +210,6 @@ extern long long int    atoll(const char
 /* This target defines SUPPORTS_WEAK and TARGET_ASM_NAMED_SECTION,
    but does not have crtbegin/end.  */
 
-#define TARGET_USE_JCR_SECTION 0
-
 #define TARGET_AIX_VERSION 71
 
 /* AIX 7.1 supports DWARF3 debugging, but XCOFF remains the default.  */
--- gcc/config/rs6000/aix51.h.jj	2016-06-20 10:30:35.629607920 +0200
+++ gcc/config/rs6000/aix51.h	2016-10-01 18:55:51.659743552 +0200
@@ -163,8 +163,6 @@ do {									\
 /* This target defines SUPPORTS_WEAK and TARGET_ASM_NAMED_SECTION,
    but does not have crtbegin/end.  */
 
-#define TARGET_USE_JCR_SECTION 0
-
 #define TARGET_AIX_VERSION 51
 
 #undef TARGET_LIBC_HAS_FUNCTION
--- gcc/config/rs6000/aix52.h.jj	2016-01-04 14:55:57.081414429 +0100
+++ gcc/config/rs6000/aix52.h	2016-10-01 18:55:43.356845872 +0200
@@ -176,6 +176,4 @@ extern long long int    atoll(const char
 /* This target defines SUPPORTS_WEAK and TARGET_ASM_NAMED_SECTION,
    but does not have crtbegin/end.  */
 
-#define TARGET_USE_JCR_SECTION 0
-
 #define TARGET_AIX_VERSION 52
--- gcc/config/rs6000/aix53.h.jj	2016-01-04 14:55:57.280411661 +0100
+++ gcc/config/rs6000/aix53.h	2016-10-01 18:55:47.620793326 +0200
@@ -177,6 +177,4 @@ extern long long int    atoll(const char
 /* This target defines SUPPORTS_WEAK and TARGET_ASM_NAMED_SECTION,
    but does not have crtbegin/end.  */
 
-#define TARGET_USE_JCR_SECTION 0
-
 #define TARGET_AIX_VERSION 53
--- gcc/config/rs6000/aix61.h.jj	2016-01-04 14:55:57.150413469 +0100
+++ gcc/config/rs6000/aix61.h	2016-10-01 18:55:45.736816543 +0200
@@ -210,6 +210,4 @@ extern long long int    atoll(const char
 /* This target defines SUPPORTS_WEAK and TARGET_ASM_NAMED_SECTION,
    but does not have crtbegin/end.  */
 
-#define TARGET_USE_JCR_SECTION 0
-
 #define TARGET_AIX_VERSION 61
--- gcc/defaults.h.jj	2016-09-29 22:53:12.000000000 +0200
+++ gcc/defaults.h	2016-10-01 18:56:54.180973076 +0200
@@ -392,27 +392,6 @@ see the files COPYING3 and COPYING.RUNTI
 #define MASK_RETURN_ADDR NULL_RTX
 #endif
 
-/* If we have named section and we support weak symbols, then use the
-   .jcr section for recording java classes which need to be registered
-   at program start-up time.  */
-#if defined (TARGET_ASM_NAMED_SECTION) && SUPPORTS_WEAK
-#ifndef JCR_SECTION_NAME
-#define JCR_SECTION_NAME ".jcr"
-#endif
-#endif
-
-/* This decision to use a .jcr section can be overridden by defining
-   USE_JCR_SECTION to 0 in target file.  This is necessary if target
-   can define JCR_SECTION_NAME but does not have crtstuff or
-   linker support for .jcr section.  */
-#ifndef TARGET_USE_JCR_SECTION
-#ifdef JCR_SECTION_NAME
-#define TARGET_USE_JCR_SECTION 1
-#else
-#define TARGET_USE_JCR_SECTION 0
-#endif
-#endif
-
 /* Number of hardware registers that go into the DWARF-2 unwind info.
    If not defined, equals FIRST_PSEUDO_REGISTER  */
 
--- gcc/system.h.jj	2016-09-29 22:53:15.275713645 +0200
+++ gcc/system.h	2016-10-03 17:39:18.361698158 +0200
@@ -987,7 +987,8 @@ extern void fancy_abort (const char *, i
 	CALLER_SAVE_PROFITABLE LARGEST_EXPONENT_IS_NORMAL		   \
 	ROUND_TOWARDS_ZERO SF_SIZE DF_SIZE XF_SIZE TF_SIZE LIBGCC2_TF_CEXT \
 	LIBGCC2_LONG_DOUBLE_TYPE_SIZE STRUCT_VALUE			   \
-	EH_FRAME_IN_DATA_SECTION TARGET_FLT_EVAL_METHOD_NON_DEFAULT
+	EH_FRAME_IN_DATA_SECTION TARGET_FLT_EVAL_METHOD_NON_DEFAULT	   \
+	JCR_SECTION_NAME TARGET_USE_JCR_SECTION
 
 /* Hooks that are no longer used.  */
  #pragma GCC poison LANG_HOOKS_FUNCTION_MARK LANG_HOOKS_FUNCTION_FREE	\
--- gcc/c-family/c-cppbuiltin.c.jj	2016-09-27 21:15:39.000000000 +0200
+++ gcc/c-family/c-cppbuiltin.c	2016-10-01 19:49:58.395673099 +0200
@@ -1213,10 +1213,6 @@ c_cpp_builtins (cpp_reader *pfile)
       builtin_define_with_value ("__LIBGCC_EH_FRAME_SECTION_NAME__",
 				 EH_FRAME_SECTION_NAME, 1);
 #endif
-#ifdef JCR_SECTION_NAME
-      builtin_define_with_value ("__LIBGCC_JCR_SECTION_NAME__",
-				 JCR_SECTION_NAME, 1);
-#endif
 #ifdef CTORS_SECTION_ASM_OP
       builtin_define_with_value ("__LIBGCC_CTORS_SECTION_ASM_OP__",
 				 CTORS_SECTION_ASM_OP, 1);
--- gcc/doc/tm.texi.in.jj	2016-09-23 09:32:12.000000000 +0200
+++ gcc/doc/tm.texi.in	2016-10-01 19:48:14.537954491 +0200
@@ -8186,12 +8186,6 @@ and scanf formatter settings.
 
 @hook TARGET_CONVERT_TO_TYPE
 
-@defmac TARGET_USE_JCR_SECTION
-This macro determines whether to use the JCR section to register Java
-classes. By default, TARGET_USE_JCR_SECTION is defined to 1 if both
-SUPPORTS_WEAK and TARGET_HAVE_NAMED_SECTIONS are true, else 0.
-@end defmac
-
 @defmac OBJC_JBLEN
 This macro determines the size of the objective C jump buffer for the
 NeXT runtime. By default, OBJC_JBLEN is defined to an innocuous value.
--- gcc/doc/tm.texi.jj	2016-09-27 09:46:07.000000000 +0200
+++ gcc/doc/tm.texi	2016-10-01 19:48:23.254846943 +0200
@@ -11598,12 +11598,6 @@ conversion rules.
 This is currently used only by the C and C++ front ends.
 @end deftypefn
 
-@defmac TARGET_USE_JCR_SECTION
-This macro determines whether to use the JCR section to register Java
-classes. By default, TARGET_USE_JCR_SECTION is defined to 1 if both
-SUPPORTS_WEAK and TARGET_HAVE_NAMED_SECTIONS are true, else 0.
-@end defmac
-
 @defmac OBJC_JBLEN
 This macro determines the size of the objective C jump buffer for the
 NeXT runtime. By default, OBJC_JBLEN is defined to an innocuous value.
--- libgcc/config/i386/cygming-crtbegin.c.jj	2016-01-04 15:14:09.000000000 +0100
+++ libgcc/config/i386/cygming-crtbegin.c	2016-10-01 18:53:57.743147396 +0200
@@ -73,18 +73,6 @@ __deregister_frame_info (__attribute__((
 #endif
 #endif /* DWARF2_UNWIND_INFO */
 
-#if TARGET_USE_JCR_SECTION
-extern void _Jv_RegisterClasses (__attribute__((unused)) const void *)
-  TARGET_ATTRIBUTE_WEAK;
-
-#ifdef __x86_64__
-TARGET_ATTRIBUTE_WEAK void
-_Jv_RegisterClasses (__attribute__((unused)) const void *p)
-{
-}
-#endif
-#endif /* TARGET_USE_JCR_SECTION */
-
 #if defined(HAVE_LD_RO_RW_SECTION_MIXING)
 # define EH_FRAME_SECTION_CONST const
 #else
@@ -105,12 +93,6 @@ HANDLE hmod_libgcc;
 static void *  (*deregister_frame_fn) (const void *) = NULL;
 #endif
 
-#if TARGET_USE_JCR_SECTION
-static void *__JCR_LIST__[]
-  __attribute__ ((used, section(__LIBGCC_JCR_SECTION_NAME__), aligned(4)))
-  = { };
-#endif
-
 #ifdef __CYGWIN__
 /* Declare the __dso_handle variable.  It should have a unique value
    in every shared-object; in a main program its value is zero.  The
@@ -163,22 +145,6 @@ __gcc_register_frame (void)
      register_frame_fn (__EH_FRAME_BEGIN__, &obj);
 #endif
 
-#if TARGET_USE_JCR_SECTION 
-  if (__JCR_LIST__[0])
-    {
-      void (*register_class_fn) (const void *);
-      HANDLE h = GetModuleHandle (LIBGCJ_SONAME);
-      if (h)
-	register_class_fn = (void (*) (const void *))
-			     GetProcAddress (h, "_Jv_RegisterClasses");
-      else
-	register_class_fn = _Jv_RegisterClasses;
-
-      if (register_class_fn)
-	register_class_fn (__JCR_LIST__);
-    }
-#endif
-
 #if DEFAULT_USE_CXA_ATEXIT
   /* If we use the __cxa_atexit method to register C++ dtors
      at object construction,  also use atexit to register eh frame
--- libgcc/config/i386/cygming-crtend.c.jj	2016-01-04 15:14:09.000000000 +0100
+++ libgcc/config/i386/cygming-crtend.c	2016-10-01 18:54:11.980971937 +0200
@@ -53,14 +53,6 @@ static EH_FRAME_SECTION_CONST int __FRAM
   = { 0 };
 #endif
 
-#if TARGET_USE_JCR_SECTION
-/* Null terminate the .jcr section array.  */
-static void *__JCR_END__[1] 
-   __attribute__ ((used, section(__LIBGCC_JCR_SECTION_NAME__),
-		   aligned(sizeof(void *))))
-   = { 0 };
-#endif
-
 extern void __gcc_register_frame (void); 
 extern void __gcc_deregister_frame (void);
 
--- libgcc/config/ia64/crtbegin.S.jj	2016-01-04 15:14:10.000000000 +0100
+++ libgcc/config/ia64/crtbegin.S	2016-10-01 18:53:10.237732825 +0200
@@ -34,10 +34,6 @@ __CTOR_LIST__:
 __DTOR_LIST__:
 	data8	-1
 
-.section .jcr,"aw","progbits"
-	.align	8
-__JCR_LIST__:
-
 .section .sdata
 	.type dtor_ptr,@object
 	.size dtor_ptr,8
--- libgcc/config/ia64/crtend.S.jj	2016-01-04 15:14:10.000000000 +0100
+++ libgcc/config/ia64/crtend.S	2016-10-01 18:53:19.641616937 +0200
@@ -34,11 +34,6 @@ __CTOR_END__:
 __DTOR_END__:
 	data8	0
 
-.section .jcr,"aw","progbits"
-	.align 8
-__JCR_END__:
-	data8	0
-
 #if HAVE_INITFINI_ARRAY_SUPPORT
 	.global __do_global_ctors_aux
 	.hidden	__do_global_ctors_aux
--- libgcc/crtstuff.c.jj	2016-01-04 15:14:09.000000000 +0100
+++ libgcc/crtstuff.c	2016-10-01 18:51:52.246693943 +0200
@@ -266,15 +266,6 @@ STATIC EH_FRAME_SECTION_CONST char __EH_
      = { };
 #endif /* USE_EH_FRAME_REGISTRY */
 
-#ifdef __LIBGCC_JCR_SECTION_NAME__
-/* Stick a label at the beginning of the java class registration info
-   so we can register them properly.  */
-STATIC void *__JCR_LIST__[]
-  __attribute__ ((used, section(__LIBGCC_JCR_SECTION_NAME__),
-		  aligned(sizeof(void*))))
-  = { };
-#endif /* __LIBGCC_JCR_SECTION_NAME__ */
-
 #if USE_TM_CLONE_REGISTRY
 STATIC func_ptr __TMC_LIST__[]
   __attribute__((used, section(".tm_clone_table"), aligned(sizeof(void*))))
@@ -449,7 +440,6 @@ CRT_CALL_STATIC_FUNCTION (__LIBGCC_INIT_
 #endif
 
 #if defined(USE_EH_FRAME_REGISTRY) \
-    || defined(__LIBGCC_JCR_SECTION_NAME__) \
     || defined(USE_TM_CLONE_REGISTRY)
 /* Stick a call to __register_frame_info into the .init section.  For some
    reason calls with no arguments work more reliably in .init, so stick the
@@ -472,18 +462,6 @@ frame_dummy (void)
 #endif /* CRT_GET_RFIB_DATA */
 #endif /* USE_EH_FRAME_REGISTRY */
 
-#ifdef __LIBGCC_JCR_SECTION_NAME__
-  void **jcr_list;
-  __asm ("" : "=g" (jcr_list) : "0" (__JCR_LIST__));
-  if (__builtin_expect (*jcr_list != NULL, 0))
-    {
-      void (*register_classes) (void *) = _Jv_RegisterClasses;
-      __asm ("" : "+r" (register_classes));
-      if (register_classes)
-	register_classes (jcr_list);
-    }
-#endif /* __LIBGCC_JCR_SECTION_NAME__ */
-
 #if USE_TM_CLONE_REGISTRY
   register_tm_clones ();
 #endif /* USE_TM_CLONE_REGISTRY */
@@ -496,7 +474,7 @@ static func_ptr __frame_dummy_init_array
   __attribute__ ((__used__, section(".init_array"), aligned(sizeof(func_ptr))))
   = { frame_dummy };
 #endif /* !defined(__LIBGCC_INIT_SECTION_ASM_OP__) */
-#endif /* USE_EH_FRAME_REGISTRY || __LIBGCC_JCR_SECTION_NAME__ || USE_TM_CLONE_REGISTRY */
+#endif /* USE_EH_FRAME_REGISTRY || USE_TM_CLONE_REGISTRY */
 
 #else  /* OBJECT_FORMAT_ELF */
 
@@ -564,7 +542,6 @@ __do_global_dtors (void)
 }
 
 #if defined(USE_EH_FRAME_REGISTRY) \
-    || defined(__LIBGCC_JCR_SECTION_NAME__) \
     || defined(USE_TM_CLONE_REGISTRY)
 /* A helper function for __do_global_ctors, which is in crtend.o.  Here
    in crtbegin.o, we can reference a couple of symbols not visible there.
@@ -579,23 +556,11 @@ __do_global_ctors_1(void)
     __register_frame_info (__EH_FRAME_BEGIN__, &object);
 #endif
 
-#ifdef __LIBGCC_JCR_SECTION_NAME__
-  void **jcr_list;
-  __asm ("" : "=g" (jcr_list) : "0" (__JCR_LIST__));
-  if (__builtin_expect (*jcr_list != NULL, 0))
-    {
-      void (*register_classes) (void *) = _Jv_RegisterClasses;
-      __asm ("" : "+r" (register_classes));
-      if (register_classes)
-	register_classes (jcr_list);
-    }
-#endif
-
 #if USE_TM_CLONE_REGISTRY
   register_tm_clones ();
 #endif /* USE_TM_CLONE_REGISTRY */
 }
-#endif /* USE_EH_FRAME_REGISTRY || __LIBGCC_JCR_SECTION_NAME__ || USE_TM_CLONE_REGISTRY */
+#endif /* USE_EH_FRAME_REGISTRY || USE_TM_CLONE_REGISTRY */
 
 #else /* ! __LIBGCC_INIT_SECTION_ASM_OP__ && ! HAS_INIT_SECTION */
 #error "What are you doing with crtstuff.c, then?"
@@ -671,14 +636,6 @@ STATIC EH_FRAME_SECTION_CONST int32 __FR
      = { 0 };
 #endif /* __LIBGCC_EH_FRAME_SECTION_NAME__ */
 
-#ifdef __LIBGCC_JCR_SECTION_NAME__
-/* Null terminate the .jcr section array.  */
-STATIC void *__JCR_END__[1]
-   __attribute__ ((used, section(__LIBGCC_JCR_SECTION_NAME__),
-		   aligned(sizeof(void *))))
-   = { 0 };
-#endif /* __LIBGCC_JCR_SECTION_NAME__ */
-
 #if USE_TM_CLONE_REGISTRY
 # ifndef HAVE_GAS_HIDDEN
 static
@@ -757,7 +714,6 @@ __do_global_ctors (void)
 {
   func_ptr *p;
 #if defined(USE_EH_FRAME_REGISTRY) \
-    || defined(__LIBGCC_JCR_SECTION_NAME__) \
     || defined(USE_TM_CLONE_REGISTRY)
   __do_global_ctors_1();
 #endif

	Jakub

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] Remove .jcr registry from the crtfiles
  2016-10-03 17:29   ` Jakub Jelinek
@ 2016-10-04  7:36     ` Richard Biener
  2016-10-05  7:52     ` Andreas Schwab
  1 sibling, 0 replies; 8+ messages in thread
From: Richard Biener @ 2016-10-04  7:36 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Joseph Myers, Andrew Haley, Ian Lance Taylor, gcc-patches

On Mon, 3 Oct 2016, Jakub Jelinek wrote:

> On Mon, Oct 03, 2016 at 03:26:10PM +0000, Joseph Myers wrote:
> > As usual when removing target macros they should be poisoned in system.h.
> 
> Here is the patch with that poisoning.  Bootstrapped/regtested on
> x86_64-linux and i686-linux again, ok for trunk?

Ok.

Thanks,
Richard.

> 2016-10-03  Jakub Jelinek  <jakub@redhat.com>
> 
> gcc/
> 	* defaults.h (JCR_SECTION_NAME, TARGET_USE_JCR_SECTION): Remove.
> 	* system.h (JCR_SECTION_NAME, TARGET_USE_JCR_SECTION): Poison.
> 	* doc/tm.texi.in (TARGET_USE_JCR_SECTION): Remove.
> 	* doc/tm.texi: Regenerated.
> 	* config/i386/mingw32.h (TARGET_USE_JCR_SECTION): Remove.
> 	* config/i386/cygming.h (TARGET_USE_JCR_SECTION): Remove.
> 	* config/darwin.h (JCR_SECTION_NAME): Remove.
> 	* config/pa/pa64-hpux.h (JCR_SECTION_NAME): Remove.
> 	* config/rs6000/aix71.h (TARGET_USE_JCR_SECTION): Remove.
> 	* config/rs6000/aix51.h (TARGET_USE_JCR_SECTION): Remove.
> 	* config/rs6000/aix52.h (TARGET_USE_JCR_SECTION): Remove.
> 	* config/rs6000/aix53.h (TARGET_USE_JCR_SECTION): Remove.
> 	* config/rs6000/aix61.h (TARGET_USE_JCR_SECTION): Remove.
> gcc/c-family/
> 	* c-cppbuiltin.c (c_cpp_builtins): Don't define
> 	__LIBGCC_JCR_SECTION_NAME__.
> libgcc/
> 	* config/i386/cygming-crtbegin.c (_Jv_RegisterClasses): Remove.
> 	(__JCR_LIST__): Remove.
> 	(__gcc_register_frame): Don't attempt to _Jv_RegisterClasses.
> 	* config/i386/cygming-crtend.c (__JCR_END__): Remove.
> 	* config/ia64/crtbegin.S (__JCR_LIST__): Remove.
> 	* config/ia64/crtend.S (__JCR_END__): Remove.
> 	* crtstuff.c: Remove __LIBGCC_JCR_SECTION_NAME__ from preprocessor
> 	conditionals.
> 	(__JCR_LIST__, __JCR_END__): Remove.
> 	(frame_dummy): Don't attempt to _Jv_RegisterClasses.
> 	(__do_global_ctors_1): Likewise.
> 
> --- gcc/config/i386/mingw32.h.jj	2016-05-20 09:05:08.836063467 +0200
> +++ gcc/config/i386/mingw32.h	2016-10-01 18:55:14.646199686 +0200
> @@ -239,9 +239,6 @@ do {						         \
>  #undef TARGET_N_FORMAT_TYPES
>  #define TARGET_N_FORMAT_TYPES 3
>  
> -/* Let defaults.h definition of TARGET_USE_JCR_SECTION apply. */
> -#undef TARGET_USE_JCR_SECTION
> -
>  #define HAVE_ENABLE_EXECUTE_STACK
>  #undef  CHECK_EXECUTE_STACK_ENABLED
>  #define CHECK_EXECUTE_STACK_ENABLED flag_setstackexecutable
> --- gcc/config/i386/cygming.h.jj	2016-09-27 09:46:13.000000000 +0200
> +++ gcc/config/i386/cygming.h	2016-10-01 18:56:16.133441952 +0200
> @@ -443,11 +443,6 @@ do {						\
>  
>  #endif /* HAVE_GAS_WEAK */
>  
> -/* FIXME: SUPPORTS_WEAK && TARGET_HAVE_NAMED_SECTIONS is true,
> -   but for .jcr section to work we also need crtbegin and crtend
> -   objects.  */
> -#define TARGET_USE_JCR_SECTION 1
> -
>  /* Decide whether it is safe to use a local alias for a virtual function
>     when constructing thunks.  */
>  #undef TARGET_USE_LOCAL_THUNK_ALIAS_P
> --- gcc/config/darwin.h.jj	2016-09-15 13:39:14.518013115 +0200
> +++ gcc/config/darwin.h	2016-10-01 18:55:40.056886539 +0200
> @@ -825,9 +825,6 @@ enum machopic_addr_class {
>  #define EH_FRAME_SECTION_NAME   "__TEXT"
>  #define EH_FRAME_SECTION_ATTR ",coalesced,no_toc+strip_static_syms+live_support"
>  
> -/* Java runtime class list.  */
> -#define JCR_SECTION_NAME "__DATA,jcr,regular,no_dead_strip"
> -
>  #undef ASM_PREFERRED_EH_DATA_FORMAT
>  #define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL)  \
>    (((CODE) == 2 && (GLOBAL) == 1) \
> --- gcc/config/pa/pa64-hpux.h.jj	2016-04-08 19:19:23.894042211 +0200
> +++ gcc/config/pa/pa64-hpux.h	2016-10-01 18:55:35.171946738 +0200
> @@ -170,8 +170,6 @@ along with GCC; see the file COPYING3.
>  #define DATA_SECTION_ASM_OP	"\t.data"
>  #define BSS_SECTION_ASM_OP	"\t.section\t.bss"
>  
> -#define JCR_SECTION_NAME	".jcr"
> -
>  #define HP_INIT_ARRAY_SECTION_ASM_OP	"\t.section\t.init"
>  #define GNU_INIT_ARRAY_SECTION_ASM_OP	"\t.section\t.init_array"
>  #define HP_FINI_ARRAY_SECTION_ASM_OP	"\t.section\t.fini"
> @@ -382,8 +380,8 @@ do {								\
>     initializers specified here.  */
>  
>  /* We need to add frame_dummy to the initializer list if EH_FRAME_SECTION_NAME
> -   or JCR_SECTION_NAME is defined.  */
> -#if defined(EH_FRAME_SECTION_NAME) || defined(JCR_SECTION_NAME)
> +   is defined.  */
> +#if defined(EH_FRAME_SECTION_NAME)
>  #define PA_INIT_FRAME_DUMMY_ASM_OP ".dword P%frame_dummy"
>  #else
>  #define PA_INIT_FRAME_DUMMY_ASM_OP ""
> --- gcc/config/rs6000/aix71.h.jj	2016-01-21 21:28:01.218834652 +0100
> +++ gcc/config/rs6000/aix71.h	2016-10-01 18:55:49.667768100 +0200
> @@ -210,8 +210,6 @@ extern long long int    atoll(const char
>  /* This target defines SUPPORTS_WEAK and TARGET_ASM_NAMED_SECTION,
>     but does not have crtbegin/end.  */
>  
> -#define TARGET_USE_JCR_SECTION 0
> -
>  #define TARGET_AIX_VERSION 71
>  
>  /* AIX 7.1 supports DWARF3 debugging, but XCOFF remains the default.  */
> --- gcc/config/rs6000/aix51.h.jj	2016-06-20 10:30:35.629607920 +0200
> +++ gcc/config/rs6000/aix51.h	2016-10-01 18:55:51.659743552 +0200
> @@ -163,8 +163,6 @@ do {									\
>  /* This target defines SUPPORTS_WEAK and TARGET_ASM_NAMED_SECTION,
>     but does not have crtbegin/end.  */
>  
> -#define TARGET_USE_JCR_SECTION 0
> -
>  #define TARGET_AIX_VERSION 51
>  
>  #undef TARGET_LIBC_HAS_FUNCTION
> --- gcc/config/rs6000/aix52.h.jj	2016-01-04 14:55:57.081414429 +0100
> +++ gcc/config/rs6000/aix52.h	2016-10-01 18:55:43.356845872 +0200
> @@ -176,6 +176,4 @@ extern long long int    atoll(const char
>  /* This target defines SUPPORTS_WEAK and TARGET_ASM_NAMED_SECTION,
>     but does not have crtbegin/end.  */
>  
> -#define TARGET_USE_JCR_SECTION 0
> -
>  #define TARGET_AIX_VERSION 52
> --- gcc/config/rs6000/aix53.h.jj	2016-01-04 14:55:57.280411661 +0100
> +++ gcc/config/rs6000/aix53.h	2016-10-01 18:55:47.620793326 +0200
> @@ -177,6 +177,4 @@ extern long long int    atoll(const char
>  /* This target defines SUPPORTS_WEAK and TARGET_ASM_NAMED_SECTION,
>     but does not have crtbegin/end.  */
>  
> -#define TARGET_USE_JCR_SECTION 0
> -
>  #define TARGET_AIX_VERSION 53
> --- gcc/config/rs6000/aix61.h.jj	2016-01-04 14:55:57.150413469 +0100
> +++ gcc/config/rs6000/aix61.h	2016-10-01 18:55:45.736816543 +0200
> @@ -210,6 +210,4 @@ extern long long int    atoll(const char
>  /* This target defines SUPPORTS_WEAK and TARGET_ASM_NAMED_SECTION,
>     but does not have crtbegin/end.  */
>  
> -#define TARGET_USE_JCR_SECTION 0
> -
>  #define TARGET_AIX_VERSION 61
> --- gcc/defaults.h.jj	2016-09-29 22:53:12.000000000 +0200
> +++ gcc/defaults.h	2016-10-01 18:56:54.180973076 +0200
> @@ -392,27 +392,6 @@ see the files COPYING3 and COPYING.RUNTI
>  #define MASK_RETURN_ADDR NULL_RTX
>  #endif
>  
> -/* If we have named section and we support weak symbols, then use the
> -   .jcr section for recording java classes which need to be registered
> -   at program start-up time.  */
> -#if defined (TARGET_ASM_NAMED_SECTION) && SUPPORTS_WEAK
> -#ifndef JCR_SECTION_NAME
> -#define JCR_SECTION_NAME ".jcr"
> -#endif
> -#endif
> -
> -/* This decision to use a .jcr section can be overridden by defining
> -   USE_JCR_SECTION to 0 in target file.  This is necessary if target
> -   can define JCR_SECTION_NAME but does not have crtstuff or
> -   linker support for .jcr section.  */
> -#ifndef TARGET_USE_JCR_SECTION
> -#ifdef JCR_SECTION_NAME
> -#define TARGET_USE_JCR_SECTION 1
> -#else
> -#define TARGET_USE_JCR_SECTION 0
> -#endif
> -#endif
> -
>  /* Number of hardware registers that go into the DWARF-2 unwind info.
>     If not defined, equals FIRST_PSEUDO_REGISTER  */
>  
> --- gcc/system.h.jj	2016-09-29 22:53:15.275713645 +0200
> +++ gcc/system.h	2016-10-03 17:39:18.361698158 +0200
> @@ -987,7 +987,8 @@ extern void fancy_abort (const char *, i
>  	CALLER_SAVE_PROFITABLE LARGEST_EXPONENT_IS_NORMAL		   \
>  	ROUND_TOWARDS_ZERO SF_SIZE DF_SIZE XF_SIZE TF_SIZE LIBGCC2_TF_CEXT \
>  	LIBGCC2_LONG_DOUBLE_TYPE_SIZE STRUCT_VALUE			   \
> -	EH_FRAME_IN_DATA_SECTION TARGET_FLT_EVAL_METHOD_NON_DEFAULT
> +	EH_FRAME_IN_DATA_SECTION TARGET_FLT_EVAL_METHOD_NON_DEFAULT	   \
> +	JCR_SECTION_NAME TARGET_USE_JCR_SECTION
>  
>  /* Hooks that are no longer used.  */
>   #pragma GCC poison LANG_HOOKS_FUNCTION_MARK LANG_HOOKS_FUNCTION_FREE	\
> --- gcc/c-family/c-cppbuiltin.c.jj	2016-09-27 21:15:39.000000000 +0200
> +++ gcc/c-family/c-cppbuiltin.c	2016-10-01 19:49:58.395673099 +0200
> @@ -1213,10 +1213,6 @@ c_cpp_builtins (cpp_reader *pfile)
>        builtin_define_with_value ("__LIBGCC_EH_FRAME_SECTION_NAME__",
>  				 EH_FRAME_SECTION_NAME, 1);
>  #endif
> -#ifdef JCR_SECTION_NAME
> -      builtin_define_with_value ("__LIBGCC_JCR_SECTION_NAME__",
> -				 JCR_SECTION_NAME, 1);
> -#endif
>  #ifdef CTORS_SECTION_ASM_OP
>        builtin_define_with_value ("__LIBGCC_CTORS_SECTION_ASM_OP__",
>  				 CTORS_SECTION_ASM_OP, 1);
> --- gcc/doc/tm.texi.in.jj	2016-09-23 09:32:12.000000000 +0200
> +++ gcc/doc/tm.texi.in	2016-10-01 19:48:14.537954491 +0200
> @@ -8186,12 +8186,6 @@ and scanf formatter settings.
>  
>  @hook TARGET_CONVERT_TO_TYPE
>  
> -@defmac TARGET_USE_JCR_SECTION
> -This macro determines whether to use the JCR section to register Java
> -classes. By default, TARGET_USE_JCR_SECTION is defined to 1 if both
> -SUPPORTS_WEAK and TARGET_HAVE_NAMED_SECTIONS are true, else 0.
> -@end defmac
> -
>  @defmac OBJC_JBLEN
>  This macro determines the size of the objective C jump buffer for the
>  NeXT runtime. By default, OBJC_JBLEN is defined to an innocuous value.
> --- gcc/doc/tm.texi.jj	2016-09-27 09:46:07.000000000 +0200
> +++ gcc/doc/tm.texi	2016-10-01 19:48:23.254846943 +0200
> @@ -11598,12 +11598,6 @@ conversion rules.
>  This is currently used only by the C and C++ front ends.
>  @end deftypefn
>  
> -@defmac TARGET_USE_JCR_SECTION
> -This macro determines whether to use the JCR section to register Java
> -classes. By default, TARGET_USE_JCR_SECTION is defined to 1 if both
> -SUPPORTS_WEAK and TARGET_HAVE_NAMED_SECTIONS are true, else 0.
> -@end defmac
> -
>  @defmac OBJC_JBLEN
>  This macro determines the size of the objective C jump buffer for the
>  NeXT runtime. By default, OBJC_JBLEN is defined to an innocuous value.
> --- libgcc/config/i386/cygming-crtbegin.c.jj	2016-01-04 15:14:09.000000000 +0100
> +++ libgcc/config/i386/cygming-crtbegin.c	2016-10-01 18:53:57.743147396 +0200
> @@ -73,18 +73,6 @@ __deregister_frame_info (__attribute__((
>  #endif
>  #endif /* DWARF2_UNWIND_INFO */
>  
> -#if TARGET_USE_JCR_SECTION
> -extern void _Jv_RegisterClasses (__attribute__((unused)) const void *)
> -  TARGET_ATTRIBUTE_WEAK;
> -
> -#ifdef __x86_64__
> -TARGET_ATTRIBUTE_WEAK void
> -_Jv_RegisterClasses (__attribute__((unused)) const void *p)
> -{
> -}
> -#endif
> -#endif /* TARGET_USE_JCR_SECTION */
> -
>  #if defined(HAVE_LD_RO_RW_SECTION_MIXING)
>  # define EH_FRAME_SECTION_CONST const
>  #else
> @@ -105,12 +93,6 @@ HANDLE hmod_libgcc;
>  static void *  (*deregister_frame_fn) (const void *) = NULL;
>  #endif
>  
> -#if TARGET_USE_JCR_SECTION
> -static void *__JCR_LIST__[]
> -  __attribute__ ((used, section(__LIBGCC_JCR_SECTION_NAME__), aligned(4)))
> -  = { };
> -#endif
> -
>  #ifdef __CYGWIN__
>  /* Declare the __dso_handle variable.  It should have a unique value
>     in every shared-object; in a main program its value is zero.  The
> @@ -163,22 +145,6 @@ __gcc_register_frame (void)
>       register_frame_fn (__EH_FRAME_BEGIN__, &obj);
>  #endif
>  
> -#if TARGET_USE_JCR_SECTION 
> -  if (__JCR_LIST__[0])
> -    {
> -      void (*register_class_fn) (const void *);
> -      HANDLE h = GetModuleHandle (LIBGCJ_SONAME);
> -      if (h)
> -	register_class_fn = (void (*) (const void *))
> -			     GetProcAddress (h, "_Jv_RegisterClasses");
> -      else
> -	register_class_fn = _Jv_RegisterClasses;
> -
> -      if (register_class_fn)
> -	register_class_fn (__JCR_LIST__);
> -    }
> -#endif
> -
>  #if DEFAULT_USE_CXA_ATEXIT
>    /* If we use the __cxa_atexit method to register C++ dtors
>       at object construction,  also use atexit to register eh frame
> --- libgcc/config/i386/cygming-crtend.c.jj	2016-01-04 15:14:09.000000000 +0100
> +++ libgcc/config/i386/cygming-crtend.c	2016-10-01 18:54:11.980971937 +0200
> @@ -53,14 +53,6 @@ static EH_FRAME_SECTION_CONST int __FRAM
>    = { 0 };
>  #endif
>  
> -#if TARGET_USE_JCR_SECTION
> -/* Null terminate the .jcr section array.  */
> -static void *__JCR_END__[1] 
> -   __attribute__ ((used, section(__LIBGCC_JCR_SECTION_NAME__),
> -		   aligned(sizeof(void *))))
> -   = { 0 };
> -#endif
> -
>  extern void __gcc_register_frame (void); 
>  extern void __gcc_deregister_frame (void);
>  
> --- libgcc/config/ia64/crtbegin.S.jj	2016-01-04 15:14:10.000000000 +0100
> +++ libgcc/config/ia64/crtbegin.S	2016-10-01 18:53:10.237732825 +0200
> @@ -34,10 +34,6 @@ __CTOR_LIST__:
>  __DTOR_LIST__:
>  	data8	-1
>  
> -.section .jcr,"aw","progbits"
> -	.align	8
> -__JCR_LIST__:
> -
>  .section .sdata
>  	.type dtor_ptr,@object
>  	.size dtor_ptr,8
> --- libgcc/config/ia64/crtend.S.jj	2016-01-04 15:14:10.000000000 +0100
> +++ libgcc/config/ia64/crtend.S	2016-10-01 18:53:19.641616937 +0200
> @@ -34,11 +34,6 @@ __CTOR_END__:
>  __DTOR_END__:
>  	data8	0
>  
> -.section .jcr,"aw","progbits"
> -	.align 8
> -__JCR_END__:
> -	data8	0
> -
>  #if HAVE_INITFINI_ARRAY_SUPPORT
>  	.global __do_global_ctors_aux
>  	.hidden	__do_global_ctors_aux
> --- libgcc/crtstuff.c.jj	2016-01-04 15:14:09.000000000 +0100
> +++ libgcc/crtstuff.c	2016-10-01 18:51:52.246693943 +0200
> @@ -266,15 +266,6 @@ STATIC EH_FRAME_SECTION_CONST char __EH_
>       = { };
>  #endif /* USE_EH_FRAME_REGISTRY */
>  
> -#ifdef __LIBGCC_JCR_SECTION_NAME__
> -/* Stick a label at the beginning of the java class registration info
> -   so we can register them properly.  */
> -STATIC void *__JCR_LIST__[]
> -  __attribute__ ((used, section(__LIBGCC_JCR_SECTION_NAME__),
> -		  aligned(sizeof(void*))))
> -  = { };
> -#endif /* __LIBGCC_JCR_SECTION_NAME__ */
> -
>  #if USE_TM_CLONE_REGISTRY
>  STATIC func_ptr __TMC_LIST__[]
>    __attribute__((used, section(".tm_clone_table"), aligned(sizeof(void*))))
> @@ -449,7 +440,6 @@ CRT_CALL_STATIC_FUNCTION (__LIBGCC_INIT_
>  #endif
>  
>  #if defined(USE_EH_FRAME_REGISTRY) \
> -    || defined(__LIBGCC_JCR_SECTION_NAME__) \
>      || defined(USE_TM_CLONE_REGISTRY)
>  /* Stick a call to __register_frame_info into the .init section.  For some
>     reason calls with no arguments work more reliably in .init, so stick the
> @@ -472,18 +462,6 @@ frame_dummy (void)
>  #endif /* CRT_GET_RFIB_DATA */
>  #endif /* USE_EH_FRAME_REGISTRY */
>  
> -#ifdef __LIBGCC_JCR_SECTION_NAME__
> -  void **jcr_list;
> -  __asm ("" : "=g" (jcr_list) : "0" (__JCR_LIST__));
> -  if (__builtin_expect (*jcr_list != NULL, 0))
> -    {
> -      void (*register_classes) (void *) = _Jv_RegisterClasses;
> -      __asm ("" : "+r" (register_classes));
> -      if (register_classes)
> -	register_classes (jcr_list);
> -    }
> -#endif /* __LIBGCC_JCR_SECTION_NAME__ */
> -
>  #if USE_TM_CLONE_REGISTRY
>    register_tm_clones ();
>  #endif /* USE_TM_CLONE_REGISTRY */
> @@ -496,7 +474,7 @@ static func_ptr __frame_dummy_init_array
>    __attribute__ ((__used__, section(".init_array"), aligned(sizeof(func_ptr))))
>    = { frame_dummy };
>  #endif /* !defined(__LIBGCC_INIT_SECTION_ASM_OP__) */
> -#endif /* USE_EH_FRAME_REGISTRY || __LIBGCC_JCR_SECTION_NAME__ || USE_TM_CLONE_REGISTRY */
> +#endif /* USE_EH_FRAME_REGISTRY || USE_TM_CLONE_REGISTRY */
>  
>  #else  /* OBJECT_FORMAT_ELF */
>  
> @@ -564,7 +542,6 @@ __do_global_dtors (void)
>  }
>  
>  #if defined(USE_EH_FRAME_REGISTRY) \
> -    || defined(__LIBGCC_JCR_SECTION_NAME__) \
>      || defined(USE_TM_CLONE_REGISTRY)
>  /* A helper function for __do_global_ctors, which is in crtend.o.  Here
>     in crtbegin.o, we can reference a couple of symbols not visible there.
> @@ -579,23 +556,11 @@ __do_global_ctors_1(void)
>      __register_frame_info (__EH_FRAME_BEGIN__, &object);
>  #endif
>  
> -#ifdef __LIBGCC_JCR_SECTION_NAME__
> -  void **jcr_list;
> -  __asm ("" : "=g" (jcr_list) : "0" (__JCR_LIST__));
> -  if (__builtin_expect (*jcr_list != NULL, 0))
> -    {
> -      void (*register_classes) (void *) = _Jv_RegisterClasses;
> -      __asm ("" : "+r" (register_classes));
> -      if (register_classes)
> -	register_classes (jcr_list);
> -    }
> -#endif
> -
>  #if USE_TM_CLONE_REGISTRY
>    register_tm_clones ();
>  #endif /* USE_TM_CLONE_REGISTRY */
>  }
> -#endif /* USE_EH_FRAME_REGISTRY || __LIBGCC_JCR_SECTION_NAME__ || USE_TM_CLONE_REGISTRY */
> +#endif /* USE_EH_FRAME_REGISTRY || USE_TM_CLONE_REGISTRY */
>  
>  #else /* ! __LIBGCC_INIT_SECTION_ASM_OP__ && ! HAS_INIT_SECTION */
>  #error "What are you doing with crtstuff.c, then?"
> @@ -671,14 +636,6 @@ STATIC EH_FRAME_SECTION_CONST int32 __FR
>       = { 0 };
>  #endif /* __LIBGCC_EH_FRAME_SECTION_NAME__ */
>  
> -#ifdef __LIBGCC_JCR_SECTION_NAME__
> -/* Null terminate the .jcr section array.  */
> -STATIC void *__JCR_END__[1]
> -   __attribute__ ((used, section(__LIBGCC_JCR_SECTION_NAME__),
> -		   aligned(sizeof(void *))))
> -   = { 0 };
> -#endif /* __LIBGCC_JCR_SECTION_NAME__ */
> -
>  #if USE_TM_CLONE_REGISTRY
>  # ifndef HAVE_GAS_HIDDEN
>  static
> @@ -757,7 +714,6 @@ __do_global_ctors (void)
>  {
>    func_ptr *p;
>  #if defined(USE_EH_FRAME_REGISTRY) \
> -    || defined(__LIBGCC_JCR_SECTION_NAME__) \
>      || defined(USE_TM_CLONE_REGISTRY)
>    __do_global_ctors_1();
>  #endif
> 
> 	Jakub
> 
> 

-- 
Richard Biener <rguenther@suse.de>
SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nuernberg)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] Remove .jcr registry from the crtfiles
  2016-10-03 17:29   ` Jakub Jelinek
  2016-10-04  7:36     ` Richard Biener
@ 2016-10-05  7:52     ` Andreas Schwab
  2016-10-05  7:56       ` Jakub Jelinek
  1 sibling, 1 reply; 8+ messages in thread
From: Andreas Schwab @ 2016-10-05  7:52 UTC (permalink / raw)
  To: Jakub Jelinek
  Cc: Joseph Myers, Richard Biener, Andrew Haley, Ian Lance Taylor,
	gcc-patches

	* config/ia64/crtbegin.S (__do_jv_register_classes): Remove.
	(.section .init_array): Don't call __do_jv_register_classes.
	(.section .init): Likewise.

diff --git a/libgcc/config/ia64/crtbegin.S b/libgcc/config/ia64/crtbegin.S
index 3bf0e71a3a..cee0cf567d 100644
--- a/libgcc/config/ia64/crtbegin.S
+++ b/libgcc/config/ia64/crtbegin.S
@@ -63,7 +63,6 @@ __dso_handle:
 	data8 @fptr(__do_global_dtors_aux)
 
 .section .init_array, "a"
-	data8 @fptr(__do_jv_register_classes)
 	data8 @fptr(__do_global_ctors_aux)
 
 #else /* !HAVE_INITFINI_ARRAY_SUPPORT */
@@ -95,24 +94,6 @@ __dso_handle:
 	  mov b6 = r2
 	  br.call.sptk.many b0 = b6
 	}
-
-/* Likewise for _init.  */
-
-.section .init,"ax","progbits"
-	{ .mlx
-	  movl r2 = @pcrel(__do_jv_register_classes - 16)
-	}
-	{ .mii
-	  mov r3 = ip
-	  ;;
-	  add r2 = r2, r3
-	  ;;
-	}
-	{ .mib
-	  nop 0
-	  mov b6 = r2
-	  br.call.sptk.many b0 = b6
-	}
 #endif /* !HAVE_INITFINI_ARRAY_SUPPORT */
 
 .section .text
@@ -200,50 +181,6 @@ __do_global_dtors_aux:
 	br.ret.sptk.many rp
 	.endp __do_global_dtors_aux
 
-	.align	32
-	.proc	__do_jv_register_classes
-__do_jv_register_classes:
-	.prologue
-	.save ar.pfs, r33
-	alloc loc1 = ar.pfs, 0, 3, 1, 0
-	movl out0 = @gprel(__JCR_LIST__)
-	;;
-
-	addl r14 = @ltoff(@fptr(_Jv_RegisterClasses)), gp
-	add out0 = out0, gp
-	.save rp, loc0
-	mov loc0 = rp
-	.body
-	;;
-
-	ld8 r14 = [r14]
-	ld8 r15 = [out0]
-	cmp.ne p6, p0 = r0, r0
-	;;
-
-	cmp.eq.or p6, p0 = r0, r14
-	cmp.eq.or p6, p0 = r0, r15
-(p6)	br.ret.sptk.many rp
-
-	ld8 r15 = [r14], 8
-	;;
-	nop 0
-	mov b6 = r15
-
-	mov loc2 = gp
-	ld8 gp = [r14]
-	br.call.sptk.many rp = b6
-	;;
-
-	mov gp = loc2
-	mov rp = loc0
-	mov ar.pfs = loc1
-
-	nop 0
-	nop 0
-	br.ret.sptk.many rp
-	.endp	__do_jv_register_classes
-
 #ifdef SHARED
 .weak __cxa_finalize
 #endif
-- 
2.10.1


Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] Remove .jcr registry from the crtfiles
  2016-10-05  7:52     ` Andreas Schwab
@ 2016-10-05  7:56       ` Jakub Jelinek
  0 siblings, 0 replies; 8+ messages in thread
From: Jakub Jelinek @ 2016-10-05  7:56 UTC (permalink / raw)
  To: Andreas Schwab
  Cc: Joseph Myers, Richard Biener, Andrew Haley, Ian Lance Taylor,
	gcc-patches

On Wed, Oct 05, 2016 at 09:52:31AM +0200, Andreas Schwab wrote:
> 	* config/ia64/crtbegin.S (__do_jv_register_classes): Remove.
> 	(.section .init_array): Don't call __do_jv_register_classes.
> 	(.section .init): Likewise.

Oops, sorry for missing that.  The patch is ok.
> 
> diff --git a/libgcc/config/ia64/crtbegin.S b/libgcc/config/ia64/crtbegin.S
> index 3bf0e71a3a..cee0cf567d 100644
> --- a/libgcc/config/ia64/crtbegin.S
> +++ b/libgcc/config/ia64/crtbegin.S
> @@ -63,7 +63,6 @@ __dso_handle:
>  	data8 @fptr(__do_global_dtors_aux)
>  
>  .section .init_array, "a"
> -	data8 @fptr(__do_jv_register_classes)
>  	data8 @fptr(__do_global_ctors_aux)
>  
>  #else /* !HAVE_INITFINI_ARRAY_SUPPORT */
> @@ -95,24 +94,6 @@ __dso_handle:
>  	  mov b6 = r2
>  	  br.call.sptk.many b0 = b6
>  	}
> -
> -/* Likewise for _init.  */
> -
> -.section .init,"ax","progbits"
> -	{ .mlx
> -	  movl r2 = @pcrel(__do_jv_register_classes - 16)
> -	}
> -	{ .mii
> -	  mov r3 = ip
> -	  ;;
> -	  add r2 = r2, r3
> -	  ;;
> -	}
> -	{ .mib
> -	  nop 0
> -	  mov b6 = r2
> -	  br.call.sptk.many b0 = b6
> -	}
>  #endif /* !HAVE_INITFINI_ARRAY_SUPPORT */
>  
>  .section .text
> @@ -200,50 +181,6 @@ __do_global_dtors_aux:
>  	br.ret.sptk.many rp
>  	.endp __do_global_dtors_aux
>  
> -	.align	32
> -	.proc	__do_jv_register_classes
> -__do_jv_register_classes:
> -	.prologue
> -	.save ar.pfs, r33
> -	alloc loc1 = ar.pfs, 0, 3, 1, 0
> -	movl out0 = @gprel(__JCR_LIST__)
> -	;;
> -
> -	addl r14 = @ltoff(@fptr(_Jv_RegisterClasses)), gp
> -	add out0 = out0, gp
> -	.save rp, loc0
> -	mov loc0 = rp
> -	.body
> -	;;
> -
> -	ld8 r14 = [r14]
> -	ld8 r15 = [out0]
> -	cmp.ne p6, p0 = r0, r0
> -	;;
> -
> -	cmp.eq.or p6, p0 = r0, r14
> -	cmp.eq.or p6, p0 = r0, r15
> -(p6)	br.ret.sptk.many rp
> -
> -	ld8 r15 = [r14], 8
> -	;;
> -	nop 0
> -	mov b6 = r15
> -
> -	mov loc2 = gp
> -	ld8 gp = [r14]
> -	br.call.sptk.many rp = b6
> -	;;
> -
> -	mov gp = loc2
> -	mov rp = loc0
> -	mov ar.pfs = loc1
> -
> -	nop 0
> -	nop 0
> -	br.ret.sptk.many rp
> -	.endp	__do_jv_register_classes
> -
>  #ifdef SHARED
>  .weak __cxa_finalize
>  #endif
> -- 
> 2.10.1
> 
> 
> Andreas.
> 
> -- 
> Andreas Schwab, SUSE Labs, schwab@suse.de
> GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
> "And now for something completely different."

	Jakub

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-10-05  7:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-01 20:29 [PATCH] Remove .jcr registry from the crtfiles Jakub Jelinek
2016-10-01 20:47 ` Florian Weimer
2016-10-01 21:23   ` Jakub Jelinek
2016-10-03 15:26 ` Joseph Myers
2016-10-03 17:29   ` Jakub Jelinek
2016-10-04  7:36     ` Richard Biener
2016-10-05  7:52     ` Andreas Schwab
2016-10-05  7:56       ` Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).