diff options
Diffstat (limited to 'gcc/config/m68k')
-rw-r--r-- | gcc/config/m68k/m68k.h | 6 | ||||
-rw-r--r-- | gcc/config/m68k/mot3300-crt0.S | 27 | ||||
-rw-r--r-- | gcc/config/m68k/mot3300.h | 36 | ||||
-rw-r--r-- | gcc/config/m68k/mot3300Mcrt0.S | 47 | ||||
-rw-r--r-- | gcc/config/m68k/xm-mot3300.h | 4 |
5 files changed, 52 insertions, 68 deletions
diff --git a/gcc/config/m68k/m68k.h b/gcc/config/m68k/m68k.h index 486ca781408..654f24c7b57 100644 --- a/gcc/config/m68k/m68k.h +++ b/gcc/config/m68k/m68k.h @@ -1223,7 +1223,11 @@ while(0) /* Emit RTL insns to initialize the variable parts of a trampoline. FNADDR is an RTX for the address of the function's pure code. - CXT is an RTX for the static chain value for the function. */ + CXT is an RTX for the static chain value for the function. + + We generate a two-instructions program at address TRAMP : + movea.l &CXT,%a0 + jmp FNADDR */ #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \ { \ diff --git a/gcc/config/m68k/mot3300-crt0.S b/gcc/config/m68k/mot3300-crt0.S index e9fc1d463b5..3c1648fe053 100644 --- a/gcc/config/m68k/mot3300-crt0.S +++ b/gcc/config/m68k/mot3300-crt0.S @@ -26,7 +26,7 @@ Boston, MA 02111-1307, USA. */ # define FILE(n) file n # define GLOBAL_SYM(s) global s # define LOCAL_LABEL(l) L%##l -# define SECTION(n) section n +# define IDENT(s) ident s # define TEXT text #else /* Assume we are using GNU as. */ # define COMM .comm @@ -35,8 +35,7 @@ Boston, MA 02111-1307, USA. */ # define FILE(name) .file name # define GLOBAL_SYM(s) .globl s # define LOCAL_LABEL(l) .L.##l -# define SECTION(n) .section n -# define STRING(s) .asciz s +# define IDENT(s) .section .comment;.asciz s # define TEXT .text #endif @@ -86,24 +85,14 @@ LOCAL_LABEL(isatty): trap &0 nop + GLOBAL_SYM (__stop_monitor) +__stop_monitor: + rts EVEN COMM splimit%,4 COMM environ,4 - COMM mcount,4 - COMM mcount%,4 - COMM monitor,4 - -#ifdef STRING - SECTION (.comment) - STRING ("$Id: mot3300-crt0.S,v 1.1 1997/08/11 15:57:32 law Exp $\n") - STRING ("Contributed by manfred@lts.sel.alcatel.de (Manfred Hollstein, Germany)\n") -#else - byte 'C,'o,'n,'t,'r,'i,'b,'u,'t,'e,'d,' ,'b,'y - byte ' ,'m,'a,'n,'f,'r,'e,'d,'@,'l,'t,'s,'.,'s - byte 'e,'l,'.,'a,'l,'c,'a,'t,'e,'l,'.,'d,'e,' - byte '(,'M,'a,'n,'f,'r,'e,'d,' ,'H,'o,'l,'l,'s - byte 't,'e,'i,'n,',,' ,'G,'e,'r,'m,'a,'n,'y,') - byte 10,0 -#endif + IDENT ("$Id: mot3300-crt0.S,v 1.2 1997/12/22 23:41:12 kenner Exp $") + IDENT ("Contributed by Manfred Hollstein (manfred@lts.sel.alcatel.de)") + IDENT ("Corrections by Philippe De Muyter (phdm@macqel.be)") diff --git a/gcc/config/m68k/mot3300.h b/gcc/config/m68k/mot3300.h index f7d35847b26..65c2f476043 100644 --- a/gcc/config/m68k/mot3300.h +++ b/gcc/config/m68k/mot3300.h @@ -147,13 +147,8 @@ Boston, MA 02111-1307, USA. */ asm_fprintf (FILE, "\tmov.l %Ra0,%Rd0\n"); } #undef FUNCTION_PROFILER -#ifndef USE_GAS -#define FUNCTION_PROFILER(FILE, LABEL_NO) \ - asm_fprintf (FILE, "\tmov.l %ILP%%%d,%Ra0\n\tjsr mcount%%\n", (LABEL_NO)) -#else /* USE_GAS */ #define FUNCTION_PROFILER(FILE, LABEL_NO) \ - asm_fprintf (FILE, "\tmov.l %I%.LP%d,%Ra0\n\tjsr mcount%%\n", (LABEL_NO)) -#endif /* USE_GAS */ + asm_fprintf (FILE, "\tmov.l %I%LLP%d,%Ra0\n\tjsr mcount%%\n", (LABEL_NO)) /* This is how to output an insn to push a register on the stack. It need not be very fast code. */ @@ -356,7 +351,7 @@ dtors_section () \ #undef ASM_BYTE #define ASM_BYTE ".byte" #undef ASM_BYTE_OP -#define ASM_BYTE_OP "\t.byte" +#define ASM_BYTE_OP ".byte" #else #undef ASM_LONG #define ASM_LONG "long" @@ -367,7 +362,7 @@ dtors_section () \ #undef ASM_BYTE #define ASM_BYTE "byte" #undef ASM_BYTE_OP -#define ASM_BYTE_OP "\tbyte" +#define ASM_BYTE_OP "byte" #endif /* USE_GAS */ /* The sysV68 as doesn't know about double's and float's. */ @@ -476,7 +471,7 @@ do { long l; \ #undef ASM_OUTPUT_ASCII #define ASM_OUTPUT_ASCII(FILE,PTR,LEN) \ do { register int sp = 0, lp = 0; \ - fprintf ((FILE), "%s\t", ASM_BYTE_OP); \ + fprintf ((FILE), "\t%s\t", ASM_BYTE_OP); \ loop: \ if ((PTR)[sp] > ' ' && ! ((PTR)[sp] & 0x80) && (PTR)[sp] != '\\') \ { lp += 3; \ @@ -797,20 +792,25 @@ do {(CUM).offset = 0;\ #define MATH_LIBRARY "-lm881" #endif -/* Currently we do not have the atexit() function; - * so take that from libgcc2.c - */ +/* Currently we do not have the atexit() function, + so take that from libgcc2.c */ #define NEED_ATEXIT 1 #define HAVE_ATEXIT 1 #define EXIT_BODY \ do \ - { extern void monitor (); \ - extern long mcount asm ("mcount%"); \ - extern long etext; \ - \ - if (&mcount < &etext) \ - monitor (0); \ + { \ + __stop_monitor (); \ _cleanup (); \ } while (0) + +/* FINALIZE_TRAMPOLINE clears the instruction cache. */ + +#undef FINALIZE_TRAMPOLINE +#define FINALIZE_TRAMPOLINE(TRAMP) \ + if (!TARGET_68040) \ + ; \ + else \ + emit_library_call (gen_rtx (SYMBOL_REF, Pmode, "__clear_insn_cache"), \ + 0, VOIDmode, 0) diff --git a/gcc/config/m68k/mot3300Mcrt0.S b/gcc/config/m68k/mot3300Mcrt0.S index acb317c92fe..3ef6611630c 100644 --- a/gcc/config/m68k/mot3300Mcrt0.S +++ b/gcc/config/m68k/mot3300Mcrt0.S @@ -1,5 +1,5 @@ /* The start module mcrt0.s for the SysV68 Motorola 3300 Delta Series. - Copyright (C) 1996 Free Software Foundation, Inc. + Copyright (C) 1996, 1997 Free Software Foundation, Inc. Contributed by Manfred Hollstein (manfred@lts.sel.alcatel.de). This file is part of GNU CC. @@ -26,7 +26,7 @@ Boston, MA 02111-1307, USA. */ # define FILE(n) file n # define GLOBAL_SYM(s) global s # define LOCAL_LABEL(l) L%##l -# define SECTION(n) section n +# define IDENT(s) ident s # define TEXT text #else /* Assume we are using GNU as. */ # define COMM .comm @@ -35,8 +35,7 @@ Boston, MA 02111-1307, USA. */ # define FILE(name) .file name # define GLOBAL_SYM(s) .globl s # define LOCAL_LABEL(l) .L.##l -# define SECTION(n) .section n -# define STRING(s) .asciz s +# define IDENT(s) .section .comment;.asciz s # define TEXT .text #endif @@ -110,30 +109,27 @@ LOCAL_LABEL(isatty): jsr exit _exit: moveq &1,%d0 trap &0 - - GLOBAL_SYM (mcount) - EVEN -mcount: bra mcount% + GLOBAL_SYM (__stop_monitor) +__stop_monitor: + clr.l -(%sp) + jsr monitor + add.w &4,%sp + rts LOCAL_LABEL(errtxt): -#ifdef STRING - STRING ("No space for monitor buffer\n") -#else byte 'N,'o,' ,'s,'p,'a,'c,'e,' ,'f,'o,'r,' ,'m,'o,'n - byte 'i,'t,'o,'r,' ,'b,'u,'f,'f,'e,'r,'\n,0 -#endif + byte 'i,'t,'o,'r,' ,'b,'u,'f,'f,'e,'r,'\n +LOCAL_LABEL(errtxt_end): EVEN LOCAL_LABEL(3): - mov.l &28,-(%sp) - mov.l &LOCAL_LABEL(errtxt),-(%sp) - moveq &2,%d0 - mov.l %d0,-(%sp) + pea LOCAL_LABEL(errtxt_end)-LOCAL_LABEL(errtxt) + pea LOCAL_LABEL(errtxt)(%pc) + pea 2 jsr write bra.b _exit LOCAL_LABEL(endofstart): - nop EVEN @@ -141,15 +137,6 @@ LOCAL_LABEL(endofstart): COMM environ,4 COMM _countbase,4 -#ifdef STRING - SECTION (.comment) - STRING ("$Id: mot3300Mcrt0.S,v 1.1 1997/08/11 15:57:32 law Exp $\n") - STRING ("Contributed by manfred@lts.sel.alcatel.de (Manfred Hollstein, Germany)\n") -#else - byte 'C,'o,'n,'t,'r,'i,'b,'u,'t,'e,'d,' ,'b,'y - byte ' ,'m,'a,'n,'f,'r,'e,'d,'@,'l,'t,'s,'.,'s - byte 'e,'l,'.,'a,'l,'c,'a,'t,'e,'l,'.,'d,'e,' - byte '(,'M,'a,'n,'f,'r,'e,'d,' ,'H,'o,'l,'l,'s - byte 't,'e,'i,'n,',,' ,'G,'e,'r,'m,'a,'n,'y,') - byte 10,0 -#endif + IDENT ("$Id: mot3300Mcrt0.S,v 1.2 1997/12/22 23:39:48 kenner Exp $") + IDENT ("Contributed by Manfred Hollstein (manfred@lts.sel.alcatel.de)") + IDENT ("Corrections by Philippe De Muyter (phdm@macqel.be)") diff --git a/gcc/config/m68k/xm-mot3300.h b/gcc/config/m68k/xm-mot3300.h index 8f4c0a46bf9..c61bd293e25 100644 --- a/gcc/config/m68k/xm-mot3300.h +++ b/gcc/config/m68k/xm-mot3300.h @@ -40,3 +40,7 @@ extern char *alloca (); #define __PTR_TO_INT(P) ((int)(P)) #define __INT_TO_PTR(P) ((char *)(P)) + +/* We need POSIX/XOPEN symbols; otherwise make check will fail. */ +#define ADD_MISSING_POSIX 1 +#define ADD_MISSING_XOPEN 1 |