This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[RFA (GCC)] Patch to remove default ELF definition of ASM_FILE_END


[CC:ed to gdb to solicit comments whether gdb needs to have the GCC
version string in the .comment section as produced by the discussed
.ident directive.]

Here's a patch to get rid of the ".ident" containing the GCC version
emitted into every object file.  It shouldn't be there for similar
reasons that there should be no gcc2_compiled symbol.  The root cause is
a default definition of ASM_FILE_END in config/elfos.h.  Note that
targets without special needs do not have to provide any ASM_FILE_END
definition at all.

As seen in the deleted definition below, it acts as if there was an
#ident directive in the compiled code.  This causes the same (or
sometimes differing) version information for all gcc-compiled sources
accumulate into the .comment section.  I don't see the purpose: It does
not seem likely that gdb should iterate over several version strings
with no documented syntax.  If there is a purpose, gdb-related or other,
please tell, so we can add a comment in elfos.h.

That ASM_FILE_END definition is unfortunately copied into several files.
Getting rid of it altogether seems bigger than anticipated, so I'd like
to do this in small steps.  This first one is to get rid of the default
definition in config/elfos.h, and not using config/i386/i386afe.h on
i686-pc-linux-gnu at all, as all it does is to work around including
elfos.h *after* other config .h-files, providing an ASM_FILE_END
definition that is the same as the one in i386/i386.h, but adding what
is deleted below.

No documentation needs to be adjusted, as this behavior was never
documented.

A further step would be to get rid of config/i386/i386afe.h entirely.  I
don't have access to all the other targets that use it, so I can't
bootstrap and check them all.  If you think it's OK anyway, I'll send a
patch.  An optional step after that would be to adjust the other
ASM_FILE_END definitions that were originally copied from elfos.h.

Bootstrapped and checked on i686-pc-linux-gnu with no new regressions
(although java wasn't configured; I used --enable-languages=c,objc,c++,f77
since bootstrapping with Java was broken at the time I updated).

Ok to commit?

	* config/elfos.h: Remove default definition of ASM_FILE_END.
	* config.gcc: Remove reference to config/i386/i386afe.h for
	i686-pc-linux-gnu.

Index: config/elfos.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/elfos.h,v
retrieving revision 1.25
diff -p -c -r1.25 elfos.h
*** elfos.h	2001/02/07 05:43:59	1.25
--- elfos.h	2001/03/13 00:16:39
*************** Boston, MA 02111-1307, USA.  */
*** 101,116 ****
  
  #define IDENT_ASM_OP "\t.ident\t"
  
- #undef ASM_FILE_END
- #define ASM_FILE_END(FILE)				\
-   do							\
-     {				 			\
-       if (!flag_no_ident)				\
- 	fprintf ((FILE), "%s\"GCC: (GNU) %s\"\n",	\
- 		 IDENT_ASM_OP, version_string);		\
-     }							\
-   while (0)
- 
  #undef  ASM_BYTE_OP
  #define ASM_BYTE_OP	"\t.byte\t"
  
--- 101,106 ----
Index: config.gcc
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config.gcc,v
retrieving revision 1.38
diff -p -c -r1.38 config.gcc
*** config.gcc	2001/03/09 20:53:52	1.38
--- config.gcc	2001/03/13 00:16:54
*************** i[34567]86-*-linux*)	# Intel 80386's run
*** 1178,1184 ****
  			# with ELF format using glibc 2
  			# aka GNU/Linux C library 6
  	xmake_file=x-linux
! 	tm_file="i386/i386.h i386/att.h linux.h i386/i386afe.h i386/linux.h"
  	tmake_file="t-linux i386/t-crtstuff"
  	extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
  	gnu_ld=yes
--- 1178,1184 ----
  			# with ELF format using glibc 2
  			# aka GNU/Linux C library 6
  	xmake_file=x-linux
! 	tm_file="i386/i386.h i386/att.h linux.h i386/linux.h"
  	tmake_file="t-linux i386/t-crtstuff"
  	extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
  	gnu_ld=yes

brgds, H-P


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]