Updated.

copyright assignment process in progress.

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 0e1e8bb..5fd857c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2015-01-31  Yoshinori Sato  <ys...@users.sourceforge.jp>
+
+       * config.gcc: Add target h8300-linux.
+       * config/h8300/linux.h: New file.
+       * config/h8300/t-linux: New file.
+       * config/h8300/h8300.c (h8300_option_override): Force clear H8300H
+       flag on H8300S or H8300SX mode.
+
 2015-01-30  Vladimir Makarov  <vmaka...@redhat.com>
 
        PR target/64688
diff --git a/gcc/config.gcc b/gcc/config.gcc
index abd915e..40e86e0 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -1213,6 +1213,10 @@ h8300-*-elf*)
        tmake_file="h8300/t-h8300"
        tm_file="h8300/h8300.h dbxelf.h elfos.h newlib-stdint.h h8300/elf.h"
        ;;
+h8300-*-linux*)
+       tmake_file="${tmake_file} h8300/t-h8300 h8300/t-linux"
+       tm_file="h8300/h8300.h dbxelf.h elfos.h gnu-user.h linux.h 
glibc-stdint.h h8300/linux.h"
+       ;;
 hppa*64*-*-linux*)
        target_cpu_default="MASK_PA_11|MASK_PA_20"
        tm_file="pa/pa64-start.h ${tm_file} dbxelf.h elfos.h gnu-user.h linux.h 
\
diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c
index 5968e55..dd133ca 100644
--- a/gcc/config/h8300/h8300.c
+++ b/gcc/config/h8300/h8300.c
@@ -406,6 +406,11 @@ h8300_option_override (void)
                - Option ignored!");
    }
 
+ if (TARGET_H8300S || TARGET_H8300SX)
+   {
+     target_flags &= ~MASK_H8300H;
+   }
+
   /* Some of the shifts are optimized for speed by default.
      See http://gcc.gnu.org/ml/gcc-patches/2002-07/msg01858.html
      If optimizing for size, change shift_alg for those shift to
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog
index 5600d56..fa5789b 100644
--- a/libgcc/ChangeLog
+++ b/libgcc/ChangeLog
@@ -1,3 +1,9 @@
+2015-01-31  Yoshinori Sato  <ys...@users.sourceforge.jp>
+
+       * config.host: Add h8300-linux.
+       * config/h8300/t-linux: New file.
+       * config/h8300/lib1funcs.S: Add __USER_LABEL_PREFIX__ to label head.
+
 2015-01-27  Caroline Tice  <cmt...@google.com>
 
        Committing VTV Cywin/Ming patch for Patrick Wollgast
diff --git a/libgcc/config.host b/libgcc/config.host
index 5baeae5..11adb31 100644
--- a/libgcc/config.host
+++ b/libgcc/config.host
@@ -487,6 +487,10 @@ h8300-*-elf*)
        tm_file="$tm_file h8300/h8300-lib.h"
        extra_parts="$extra_parts crti.o crtn.o"
        ;;
+h8300-*-linux*)
+       tmake_file="t-linux h8300/t-linux t-fpbit"
+       tm_file="$tm_file h8300/h8300-lib.h"
+       ;;
 hppa*64*-*-linux*)
        tmake_file="$tmake_file pa/t-linux pa/t-linux64"
        extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o"
diff --git a/libgcc/config/h8300/lib1funcs.S b/libgcc/config/h8300/lib1funcs.S
index 36e7d53..24a74a9 100644
--- a/libgcc/config/h8300/lib1funcs.S
+++ b/libgcc/config/h8300/lib1funcs.S
@@ -84,6 +84,12 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If 
not, see
 #define A3E    e3
 #endif
 
+#define CONCAT(A,B)     A##B
+#define LABEL0(U,X)    CONCAT(U,__##X)
+#define LABEL0_DEF(U,X)    CONCAT(U,__##X##:)
+#define LABEL_DEF(X)       LABEL0_DEF(__USER_LABEL_PREFIX__,X)
+#define LABEL(X)       LABEL0(__USER_LABEL_PREFIX__,X)
+
 #ifdef __H8300H__
 #ifdef __NORMAL_MODE__
        .h8300hn
@@ -111,8 +117,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  
If not, see
 #ifdef __H8300__
        .section .text
        .align 2
-       .global ___cmpsi2
-___cmpsi2:
+       .global LABEL(cmpsi2)
+LABEL_DEF(cmpsi2)
        cmp.w   A0,A2
        bne     .L2
        cmp.w   A1,A3
@@ -137,8 +143,8 @@ ___cmpsi2:
 #ifdef __H8300__
        .section .text
        .align 2
-       .global ___ucmpsi2
-___ucmpsi2:
+       .global LABEL(ucmpsi2)
+LABEL_DEF(ucmpsi2)
        cmp.w   A0,A2
        bne     .L2
        cmp.w   A1,A3
@@ -207,10 +213,10 @@ _lab8:    rts
 
 ; A0=A0/A1 signed
 
-       .global ___divhi3
-___divhi3:
+       .global LABEL(divhi3)
+LABEL_DEF(divhi3)
        bsr     divnorm
-       bsr     ___udivhi3
+       bsr     LABEL(udivhi3)
 negans:        btst    #3,A2L  ; should answer be negative ?
        beq     _lab4
        not     A0H     ; yes, so make it so
@@ -220,18 +226,18 @@ _lab4:    rts
 
 ; A0=A0%A1 signed
 
-       .global ___modhi3
-___modhi3:
+       .global LABEL(modhi3)
+LABEL_DEF(modhi3)
        bsr     modnorm
-       bsr     ___udivhi3
+       bsr     LABEL(udivhi3)
        mov     A3,A0
        bra     negans
 
 ; A0=A0%A1 unsigned
 
-       .global ___umodhi3
-___umodhi3:
-       bsr     ___udivhi3
+       .global LABEL(umodhi3)
+LABEL_DEF(umodhi3)
+       bsr     LABEL(udivhi3)
        mov     A3,A0
        rts
 
@@ -251,8 +257,8 @@ ___umodhi3:
 ; The H8/300 only has a 16/8 bit divide, so we look at the incoming and
 ; see how to partition up the expression.
 
-       .global ___udivhi3
-___udivhi3:
+       .global LABEL(udivhi3)
+LABEL_DEF(udivhi3)
                                ; A0 A1 A2 A3
                                ; Nn Dd       P
        sub.w   A3,A3           ; Nn Dd xP 00
@@ -418,8 +424,8 @@ mpostive2:
 
 ; numerator in A0/A1
 ; denominator in A2/A3
-       .global ___modsi3
-___modsi3:
+       .global LABEL(modsi3)
+LABEL_DEF(modsi3)
 #ifdef __H8300__
        PUSHP   S2P
        PUSHP   S0P
@@ -432,7 +438,7 @@ ___modsi3:
 #else
        PUSHP   S2P
        bsr     modnorm
-       bsr     ___udivsi3
+       bsr     LABEL(divsi3)
        mov.l   er3,er0
        bra     exitdiv
 #endif
@@ -440,8 +446,8 @@ ___modsi3:
        ;; H8/300H and H8S version of ___udivsi3 is defined later in
        ;; the file.
 #ifdef __H8300__
-       .global ___udivsi3
-___udivsi3:
+       .global LABEL(udivsi3)
+LABEL_DEF(udivsi3)
        PUSHP   S2P
        PUSHP   S0P
        PUSHP   S1P
@@ -449,8 +455,8 @@ ___udivsi3:
        bra     reti
 #endif
 
-       .global ___umodsi3
-___umodsi3:
+       .global LABEL(umodsi3)
+LABEL_DEF(umodsi3)
 #ifdef __H8300__
        PUSHP   S2P
        PUSHP   S0P
@@ -460,13 +466,13 @@ ___umodsi3:
        mov     S1,A1
        bra     reti
 #else
-       bsr     ___udivsi3
+       bsr     LABEL(udivsi3)
        mov.l   er3,er0
        rts
 #endif
 
-       .global ___divsi3
-___divsi3:
+       .global LABEL(divsi3)
+LABEL_DEF(divsi3)
 #ifdef __H8300__
        PUSHP   S2P
        PUSHP   S0P
@@ -476,7 +482,7 @@ ___divsi3:
 #else
        PUSHP   S2P
        jsr     divnorm
-       bsr     ___udivsi3
+       bsr     LABEL(udivsi3)
 #endif
 
        ; examine what the sign should be
@@ -591,8 +597,8 @@ setone:
 #else /* __H8300H__ */
 
        ;; This function also computes the remainder and stores it in er3.
-       .global ___udivsi3
-___udivsi3:
+       .global LABEL(udivsi3)
+LABEL_DEF(udivsi3)
        mov.w   A1E,A1E         ; denominator top word 0?
        bne     DenHighNonZero
 
@@ -681,8 +687,8 @@ divmod_L26:
 #ifdef __H8300__
        .section .text
        .align 2
-       .global ___mulhi3
-___mulhi3:
+       .global LABEL(mulhi3)
+LABEL_DEF(mulhi3)
        mov.b   A1L,A2L         ; A2l gets srcb.l
        mulxu   A0L,A2          ; A2 gets first sub product
 
@@ -726,8 +732,8 @@ ___mulhi3:
 
 #ifdef __H8300__
 
-       .global ___mulsi3
-___mulsi3:
+       .global LABEL(mulsi3)
+LABEL_DEF(mulsi3)
        PUSHP   S0P
        PUSHP   S1P
 
@@ -785,8 +791,8 @@ _done:
 ; 32b * 32b =  92 states
 ;
 
-       .global ___mulsi3
-___mulsi3:
+       .global LABEL(mulsi3)
+LABEL_DEF(mulsi3)
        mov.w   r1,r2   ; ( 2 states) b * d
        mulxu   r0,er2  ; (22 states)
 
@@ -814,11 +820,11 @@ L_skip2:
 #ifdef __H8300__
 /* We still treat NANs different than libgcc2.c, but then, the
    behavior is undefined anyways.  */
-       .global ___fixunssfsi
-___fixunssfsi:
+       .global LABEL(fixunssfsi)
+LABEL_DEF(fixunssfsi)
        cmp.b #0x4f,r0h
        bge Large_num
-       jmp     @___fixsfsi
+       jmp     @LABEL(fixsfsi)
 Large_num:
        bhi L_huge_num
        xor.b #0x80,A0L

-- 
Yoshinori Sato
<ys...@users.sourceforge.jp>

Reply via email to