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]

Re: sh-coff broken


On Sep 13, 2000, Joern Rennecke <amylaar@cygnus.co.uk> wrote:

> All the execution tests fail in egcs sh-elf because ld issues warnings
> about the .init and .fini section.
> I suspect that the SH PIC work has caused this.
> Where should this memory region specification be added, and how?

> spawn /x/egcs-sh/gcc/xgcc -B/x/egcs-sh/gcc/ /s/egcs/gcc/testsuite/gcc.c-torture/execute/20000112-1.c -w -O0 -DSTACK_SIZE=16384 -I/x/egcs-sh/sh-hms/m2/newlib/targ-include -I/s/egcs/newlib/libc/include -L/x/egcs-sh/ld -B/x/egcs-sh/sh-hms/m2/newlib/ -L/x/egcs-sh/sh-hms/m2/newlib -lm -m2 -o /x/egcs-sh/gcc/testsuite/20000112-1.x0 ^M
> /x/egcs-sh/gcc/collect-ld: warning: no memory region specified for section `.init'^M
> /x/egcs-sh/gcc/collect-ld: warning: no memory region specified for section `.fini'^M

That would be in ld/scripttempl/sh.sc.  However, after several
attempts, I couldn't find out a simple way for GCC's crtstuff.c to
interact with the crt[1in].asm files on COFF the way it does on ELF.
So, I propose that we simply revert to newlib's start-up routines on
sh-coff.  Ok to install?

Index: gcc/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* config/sh/sh.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP,
	STARTFILE_SPEC, ENDFILE_SPEC): Remove define.
	* config/sh/elf.h (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP):
	Remove undefine before config/elfos.h.
	* config/sh/t-sh (EXTRA_MULTILIB_PARTS): Comment out.

Index: gcc/config/sh/sh.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/sh/sh.h,v
retrieving revision 1.74
diff -u -p -r1.74 sh.h
--- gcc/config/sh/sh.h 2000/09/12 12:38:51 1.74
+++ gcc/config/sh/sh.h 2000/09/14 14:27:15
@@ -2342,19 +2342,6 @@ do {									\
 
 #define DWARF_LINE_MIN_INSTR_LENGTH 2
 
-#undef INIT_SECTION_ASM_OP
-#define INIT_SECTION_ASM_OP	".section\t.init"
-#undef FINI_SECTION_ASM_OP
-#define FINI_SECTION_ASM_OP	".section\t.fini"
-
-#undef STARTFILE_SPEC
-#define STARTFILE_SPEC \
-  "crt1.o%s crti.o%s crtbegin.o%s"
-
-#undef ENDFILE_SPEC
-#define ENDFILE_SPEC \
-  "crtend.o%s crtn.o%s"
-
 /* SH constant pool breaks the devices in crtstuff.c to control section
    in where code resides.  We have to write it as asm code.  */
 #define CRT_CALL_STATIC_FUNCTION(func) \
Index: gcc/config/sh/elf.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/sh/elf.h,v
retrieving revision 1.11
diff -u -p -r1.11 elf.h
--- gcc/config/sh/elf.h 2000/09/07 22:24:33 1.11
+++ gcc/config/sh/elf.h 2000/09/14 14:27:15
@@ -43,8 +43,6 @@ Boston, MA 02111-1307, USA.  */
 #undef ASM_OUTPUT_DESTRUCTOR
 #undef ASM_DECLARE_FUNCTION_NAME
 #undef MAX_OFILE_ALIGNMENT
-#undef INIT_SECTION_ASM_OP
-#undef FINI_SECTION_ASM_OP
 
 /* Be ELF-like.  */
 #include "svr4.h"
Index: gcc/config/sh/t-sh
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/sh/t-sh,v
retrieving revision 1.7
diff -u -p -r1.7 t-sh
--- gcc/config/sh/t-sh 2000/09/02 03:28:47 1.7
+++ gcc/config/sh/t-sh 2000/09/14 14:27:15
@@ -35,4 +35,5 @@ $(T)crti.o: $(srcdir)/config/sh/crti.asm
 $(T)crtn.o: $(srcdir)/config/sh/crtn.asm $(GCC_PASSES)
 	$(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/sh/crtn.asm
 
-EXTRA_MULTILIB_PARTS= crt1.o crti.o crtn.o crtbegin.o crtend.o
+# These are not suitable for COFF.
+# EXTRA_MULTILIB_PARTS= crt1.o crti.o crtn.o crtbegin.o crtend.o

-- 
Alexandre Oliva, GCC Team    +55 19 9714-3658

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