collect2 and ".obj" files

David Edelsohn dje@watson.ibm.com
Thu Oct 5 12:23:00 GMT 2000


	collect2 does not scan files with the suffix ".obj" which means
that it misses static consructors on targets that require scanning.  The
".obj" suffix is not standard on those targets, however.

	The following patch fixes the problem for this one specific case,
but I don't know whether GCC should accomodate ".obj" suffixes and whether
this is a slippery slope.

David


Index: collect2.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/collect2.c,v
retrieving revision 1.99
diff -c -p -r1.99 collect2.c
*** collect2.c	2000/08/14 20:46:15	1.99
--- collect2.c	2000/10/05 19:15:24
*************** main (argc, argv)
*** 1203,1209 ****
  	}
        else if ((p = rindex (arg, '.')) != (char *) 0
  	       && (strcmp (p, ".o") == 0 || strcmp (p, ".a") == 0
! 		   || strcmp (p, ".so") == 0 || strcmp (p, ".lo") == 0))
  	{
  	  if (first_file)
  	    {
--- 1202,1209 ----
  	}
        else if ((p = rindex (arg, '.')) != (char *) 0
  	       && (strcmp (p, ".o") == 0 || strcmp (p, ".a") == 0
! 		   || strcmp (p, ".so") == 0 || strcmp (p, ".lo") == 0
! 		   || strcmp (p, ".obj") == 0))
  	{
  	  if (first_file)
  	    {


More information about the Gcc-patches mailing list