PATCH: Reverse SUPPORTS_INIT_PRIORITY Change to iris6.h

Mark Mitchell mark@codesourcery.com
Fri Feb 2 09:25:00 GMT 2001


>>>>> "Jason" == Jason Merrill <jason@redhat.com> writes:

    >> This is really the linker_supports_init_fini flag.

    Jason> Well, kind of.  It's actually only checked for targets that
    Jason> don't define ASM_OUTPUT_CONSTRUCTOR; what it really means

iris6.h does defined ASM_OUTPUT_CONSTRUCTOR.

    Jason> is "linker supports GNU ld vector-building stabs".  Which
    Jason> should not be set for the IRIX linker.

I'm lost. :-)

I guess you're saying that this code:

  #ifdef USE_COLLECT2
  int flag_gnu_linker = 0;
  #else
  int flag_gnu_linker = 1;
  #endif

is not initializing this flag correctly?

Something is way out of whack: the initialization, the comments, the
name of the option, something.

It sounds to me like all of the above.  

It sounds like your'e saying this flag should be named

  flag_use_gnu_linker_init_fini_support;

and that the code should look like:

  /* If we have ASM_OUTPUT_CONSTRUCTOR and ASM_OUTPUT_DESTRUCTOR, 
     then the linker will automatically set things up so that
     initialization and finalization functions are run.  Otherwise, 
     if we're using GNU as and GNU ld, and we can rely on the special
     __CTOR_LIST__ and __DTOR_LIST__ support in those tools.
     Otherwise, we have to resort to collect2.  */
  int flag_use_gnu_linker_init_fini_support = 
#if defined(ASM_OUTPUT_CONSTRUCTOR) && defined(ASM_OUTPUT_DESTRUCTOR)
  /* In this case we don't need to use the GNU linker support.  */
  0
#elif defined(USE_COLLECT2)
  /* If we're using collect2, we don't have the GNU linker, so 
     this is not an option.  */
  0
#else
  /* Use the GNU linker support.  */
  1
#endif
  ;

Sound right?

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com


More information about the Gcc-patches mailing list