|
From: NIIBE Y. <gn...@ch...> - 2000-05-14 09:07:10
|
Here is the patch against current CVS of GCC.
--------------------------
diff --exclude CVS -ruN gcc-core/gcc/config/fp-bit.c gcc-2.95.2+kaz+g/gcc/config/fp-bit.c
--- gcc-core/gcc/config/fp-bit.c Sun May 7 22:44:44 2000
+++ gcc-2.95.2+kaz+g/gcc/config/fp-bit.c Mon May 1 16:52:02 2000
@@ -779,6 +779,9 @@
}
+#ifdef HAVE_VISIVILITY_HIDDEN
+__attribute__ ((hidden))
+#endif
FLO_type
add (FLO_type arg_a, FLO_type arg_b)
{
@@ -795,6 +798,9 @@
return pack_d (res);
}
+#ifdef HAVE_VISIVILITY_HIDDEN
+__attribute__ ((hidden))
+#endif
FLO_type
sub (FLO_type arg_a, FLO_type arg_b)
{
@@ -985,6 +991,9 @@
return tmp;
}
+#ifdef HAVE_VISIVILITY_HIDDEN
+__attribute__ ((hidden))
+#endif
FLO_type
multiply (FLO_type arg_a, FLO_type arg_b)
{
@@ -1092,6 +1101,9 @@
}
}
+#ifdef HAVE_VISIVILITY_HIDDEN
+__attribute__ ((hidden))
+#endif
FLO_type
divide (FLO_type arg_a, FLO_type arg_b)
{
@@ -1493,7 +1505,14 @@
This is needed for some 8-bit ports that can't handle well values that
are 8-bytes in size, so we just don't support double for them at all. */
+#ifdef HAVE_VISIVILITY_HIDDEN
+__attribute__ ((hidden))
+#endif
extern DFtype __make_dp (fp_class_type, unsigned int, int, UDItype frac);
+#ifdef HAVE_VISIVILITY_HIDDEN
+asm(".hidden __make_dp");
+asm(".global __make_dp");
+#endif
#if defined(L_sf_to_df)
#ifdef HAVE_VISIVILITY_HIDDEN
@@ -1515,7 +1534,14 @@
#ifndef FLOAT
+#ifdef HAVE_VISIVILITY_HIDDEN
+__attribute__ ((hidden))
+#endif
extern SFtype __make_fp (fp_class_type, unsigned int, int, USItype);
+#ifdef HAVE_VISIVILITY_HIDDEN
+asm(".hidden __make_fp");
+asm(".global __make_fp");
+#endif
#if defined(L_make_df)
#ifdef HAVE_VISIVILITY_HIDDEN
diff --exclude CVS -ruN gcc-core/gcc/config/sh/elf.h gcc-2.95.2+kaz+g/gcc/config/sh/elf.h
--- gcc-core/gcc/config/sh/elf.h Sun May 7 22:24:17 2000
+++ gcc-2.95.2+kaz+g/gcc/config/sh/elf.h Mon May 1 16:52:02 2000
@@ -42,12 +42,21 @@
/* Be ELF-like. */
#include "svr4.h"
+/* For builtin library routins (e.g. __udivsi3), we explicitly declare
+ the symbol as .globl with .hidden. */
+
+#undef ASM_OUTPUT_EXTERNAL_LIBCALL
+#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
+ ASM_HIDDEN_GLOBAL_LABEL (FILE, XSTR (FUN, 0))
+
/* The prefix to add to user-visible assembler symbols.
Note that svr4.h redefined it from the original value (that we want)
in sh.h */
+#if 0
#undef USER_LABEL_PREFIX
#define USER_LABEL_PREFIX "_"
+#endif
#undef LOCAL_LABEL_PREFIX
#define LOCAL_LABEL_PREFIX "."
diff --exclude CVS -ruN gcc-core/gcc/config/sh/lib1funcs-gnu.asm gcc-2.95.2+kaz+g/gcc/config/sh/lib1funcs-gnu.asm
--- gcc-core/gcc/config/sh/lib1funcs-gnu.asm Sun May 7 22:26:03 2000
+++ gcc-2.95.2+kaz+g/gcc/config/sh/lib1funcs-gnu.asm Mon May 1 17:02:05 2000
@@ -25,4 +25,6 @@
#define GLOBAL(X) __##X
+#define __NOFPU_DIV__
+
#include "sh/lib1funcs.asm"
diff --exclude CVS -ruN gcc-core/gcc/config/sh/lib1funcs.asm gcc-2.95.2+kaz+g/gcc/config/sh/lib1funcs.asm
--- gcc-core/gcc/config/sh/lib1funcs.asm Sun May 7 22:44:45 2000
+++ gcc-2.95.2+kaz+g/gcc/config/sh/lib1funcs.asm Mon May 1 17:02:05 2000
@@ -969,7 +969,7 @@
#ifdef L_sdivsi3
/* __SH4_SINGLE_ONLY__ keeps this part for link compatibility with
sh3e code. */
-#if ! defined(__SH4__) && ! defined (__SH4_SINGLE__)
+#if (! defined(__SH4__) && ! defined (__SH4_SINGLE__)) || defined(__NOFPU_DIV__)
!!
!! Steve Chamberlain
!! sa...@cy...
@@ -1168,7 +1168,7 @@
#ifdef L_udivsi3
/* __SH4_SINGLE_ONLY__ keeps this part for link compatibility with
sh3e code. */
-#if ! defined(__SH4__) && ! defined (__SH4_SINGLE__)
+#if (! defined(__SH4__) && ! defined (__SH4_SINGLE__)) || defined(__NOFPU_DIV__)
!!
!! Steve Chamberlain
!! sa...@cy...
diff --exclude CVS -ruN gcc-core/gcc/config/sh/linux.h gcc-2.95.2+kaz+g/gcc/config/sh/linux.h
--- gcc-core/gcc/config/sh/linux.h Sun May 7 22:44:45 2000
+++ gcc-2.95.2+kaz+g/gcc/config/sh/linux.h Wed May 10 15:29:49 2000
@@ -65,6 +65,14 @@
#undef ASM_SPEC
#define ASM_SPEC "%{!mb:-little} %{mrelax:-relax}"
+#undef CC1_SPEC
+#define CC1_SPEC \
+ "-musermode"
+
+#undef CC1PLUS_SPEC
+#define CC1PLUS_SPEC \
+ "-musermode"
+
#undef LINK_SPEC
#define LINK_SPEC \
"%{!mb:-m shlelf_linux} %{mrelax:-relax} \
@@ -72,7 +80,7 @@
%{!static: \
%{rdynamic:-export-dynamic} \
%{!dynamic-linker:-dynamic-linker /lib/ld.so.1} \
- } \
+ %{!rpath:-rpath /lib}} \
%{static:-static}"
#undef LIB_SPEC
@@ -87,10 +95,71 @@
%{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
%{!p:%{profile:gcrt1.o%s} \
%{!profile:crt1.o%s}}}} \
- crti.o%s %{!shared:crtbegin.o%s}"
+ crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
#define ENDFILE_SPEC \
- "%{!shared:crtend.o%s} crtn.o%s"
+ "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
+
+/* On svr4, we *do* have support for the .init and .fini sections, and we
+ can put stuff in there to be executed before and after `main'. We let
+ crtstuff.c and other files know this by defining the following symbols.
+ The definitions say how to change sections to the .init and .fini
+ sections. This is the same for all known svr4 assemblers. */
+#define INIT_SECTION_ASM_OP ".section\t.init"
+#define FINI_SECTION_ASM_OP ".section\t.fini"
+
+/* SH constant pool breaks the devices in crtstuff.c to control section
+ in where code resides. We have to write it as asm code. */
+#ifndef __PIC__
+#define CALL_IN_INIT_SECTION(func) \
+ asm (INIT_SECTION_ASM_OP "\n\
+ mov.l\t1f,r1\n\
+ jsr\t@r1\n\
+ nop\n\
+ bra\t2f\n\
+ nop\n\
+ .align\t2\n\
+ 1:\t.long\t" #func "\n\
+ 2:\n");
+
+#define CALL_IN_FINI_SECTION(func) \
+ asm (FINI_SECTION_ASM_OP "\n\
+ mov.l\t1f,r1\n\
+ jsr\t@r1\n\
+ nop\n\
+ bra\t2f\n\
+ nop\n\
+ .align\t2\n\
+ 1:\t.long\t" #func "\n\
+ 2:\n");
+#else
+#define CALL_IN_INIT_SECTION(func) \
+ asm (INIT_SECTION_ASM_OP "\n\
+ mov.l\t1f,r1\n\
+ mova\t1f,r0\n\
+ add\tr0,r1\n\
+ jsr\t@r1\n\
+ nop\n\
+ bra\t2f\n\
+ nop\n\
+ .align\t2\n\
+ 1:\t.long\t" #func "@PLT\n\
+ 2:\n");
+
+#define CALL_IN_FINI_SECTION(func) \
+ asm (FINI_SECTION_ASM_OP "\n\
+ mov.l\t1f,r1\n\
+ mova\t1f,r0\n\
+ add\tr0,r1\n\
+ jsr\t@r1\n\
+ nop\n\
+ bra\t2f\n\
+ nop\n\
+ .align\t2\n\
+ 1:\t.long\t" #func "@PLT\n\
+ 2:\n");
+
+#endif
/* Make DWARF2 an option, but keep DBX as the default for now.
Use -gdwarf-2 to turn on DWARF2. */
diff --exclude CVS -ruN gcc-core/gcc/config/sh/sh.c gcc-2.95.2+kaz+g/gcc/config/sh/sh.c
--- gcc-core/gcc/config/sh/sh.c Sun May 7 22:24:17 2000
+++ gcc-2.95.2+kaz+g/gcc/config/sh/sh.c Mon May 1 16:52:02 2000
@@ -388,8 +388,9 @@
entry_name = get_identifier ("__movstrSI12_i4");
sym = gen_rtx (SYMBOL_REF, Pmode, IDENTIFIER_POINTER (entry_name));
+ assemble_external_libcall (sym);
if (flag_pic)
- sym = legitimize_builtin_function_address (sym);
+ sym = legitimize_function_address (SImode, sym, 0);
func_addr_rtx = copy_to_mode_reg (Pmode, sym);
force_into (XEXP (operands[0], 0), r4);
force_into (XEXP (operands[1], 0), r5);
@@ -410,8 +411,9 @@
? "__movstr_i4_odd"
: "__movstr_i4_even");
sym = gen_rtx (SYMBOL_REF, Pmode, IDENTIFIER_POINTER (entry_name));
+ assemble_external_libcall (sym);
if (flag_pic)
- sym = legitimize_builtin_function_address (sym);
+ sym = legitimize_function_address (SImode, sym, 0);
func_addr_rtx = copy_to_mode_reg (Pmode, sym);
force_into (XEXP (operands[0], 0), r4);
force_into (XEXP (operands[1], 0), r5);
@@ -436,8 +438,9 @@
sprintf (entry, "__movstrSI%d", bytes);
entry_name = get_identifier (entry);
sym = gen_rtx (SYMBOL_REF, Pmode, IDENTIFIER_POINTER (entry_name));
+ assemble_external_libcall (sym);
if (flag_pic)
- sym = legitimize_builtin_function_address (sym);
+ sym = legitimize_function_address (SImode, sym, 0);
func_addr_rtx = copy_to_mode_reg (Pmode, sym);
force_into (XEXP (operands[0], 0), r4);
force_into (XEXP (operands[1], 0), r5);
@@ -459,8 +462,9 @@
entry_name = get_identifier ("__movstr");
sym = gen_rtx (SYMBOL_REF, Pmode, IDENTIFIER_POINTER (entry_name));
+ assemble_external_libcall (sym);
if (flag_pic)
- sym = legitimize_builtin_function_address (sym);
+ sym = legitimize_function_address (SImode, sym, 0);
func_addr_rtx = copy_to_mode_reg (Pmode, sym);
force_into (XEXP (operands[0], 0), r4);
force_into (XEXP (operands[1], 0), r5);
@@ -728,8 +732,8 @@
rtx insn;
rtx op;
{
- struct { rtx lab, reg, op; } this;
- char *jump;
+ struct { rtx lab, reg, op, lab2; } this;
+ const char *jump;
int far;
int offset = branch_dest (insn) - insn_addresses[INSN_UID (insn)];
@@ -767,19 +771,29 @@
if (dbr_sequence_length ())
print_slot (final_sequence);
- this.reg = gen_rtx (REG, SImode, 13);
- output_asm_insn ("mov.l " REGISTER_PREFIX "r13,@-" REGISTER_PREFIX "r15", 0);
+ this.reg = gen_rtx_REG (SImode, 13);
+ output_asm_insn ("mov.l " REGISTER_PREFIX "r13,@-"
+ REGISTER_PREFIX "r15", 0);
output_asm_insn (jump, &this.lab);
- output_asm_insn ("mov.l @" REGISTER_PREFIX "r15+," REGISTER_PREFIX "r13", 0);
+ output_asm_insn ("mov.l @" REGISTER_PREFIX "r15+,"
+ REGISTER_PREFIX "r13", 0);
+ }
+ if (flag_pic && far)
+ {
+ this.lab2 = gen_label_rtx ();
+ ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "L",
+ CODE_LABEL_NUMBER (this.lab2));
}
if (far)
output_asm_insn (".align 2", 0);
ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "L", CODE_LABEL_NUMBER (this.lab));
this.op = op;
- if (flag_pic)
- output_asm_insn (far ? ".long %O2-%O0" : ".word %O2-%O0", &this.lab);
+ if (flag_pic && far)
+ output_asm_insn (".long %O2-%O3", &this.lab);
+ else if (far)
+ output_asm_insn (".long %O2", &this.lab);
else
- output_asm_insn (far ? ".long %O2" : ".word %O2-%O0", &this.lab);
+ output_asm_insn (".word %O2-%O0", &this.lab);
return "";
}
@@ -1282,8 +1296,9 @@
sprintf (func, "__ashiftrt_r4_%d", value);
func_name = get_identifier (func);
sym = gen_rtx (SYMBOL_REF, Pmode, IDENTIFIER_POINTER (func_name));
+ assemble_external_libcall (sym);
if (flag_pic)
- sym = legitimize_builtin_function_address (sym);
+ sym = legitimize_function_address (SImode, sym, 0);
emit_move_insn (wrk, sym);
emit_insn (gen_ashrsi3_n (GEN_INT (value), wrk));
emit_move_insn (operands[0], gen_rtx (REG, SImode, 4));
@@ -5100,19 +5115,6 @@
}
rtx
-legitimize_builtin_function_address (orig)
- rtx orig;
-{
- rtx new;
-#if 0
- new = gen_rtx_UNSPEC (VOIDmode, gen_rtvec (1, orig), 13);
- return gen_rtx_CONST (VOIDmode, new);
-#else
- return legitimize_function_address (SImode, orig, 0);
-#endif
-}
-
-rtx
legitimize_pic_address (orig, mode, reg)
rtx orig;
enum machine_mode mode;
@@ -5303,15 +5305,6 @@
case UNSPEC:
if ((XVECLEN (x, 0)) > 3)
abort ();
- if (XINT (x, 1) == 12)
- {
- output_pic_addr_const (file, XVECEXP (x, 0, 0));
- fputs ("@PLT", file);
- fputs ("+", file);
- fputs (".-2-", file);
- output_pic_addr_const (file, XVECEXP (x, 0, 2));
- break;
- }
output_pic_addr_const (file, XVECEXP (x, 0, 0));
switch (XINT (x, 1))
{
@@ -5329,6 +5322,12 @@
case 10:
case 11:
/* _GLOBAL_OFFSET_TABLE_ reference */
+ break;
+ case 12:
+ fputs ("@PLT", file);
+ fputs ("+", file);
+ fputs (".-2-", file);
+ output_pic_addr_const (file, XVECEXP (x, 0, 2));
break;
case 13:
break;
diff --exclude CVS -ruN gcc-core/gcc/config/sh/sh.h gcc-2.95.2+kaz+g/gcc/config/sh/sh.h
--- gcc-core/gcc/config/sh/sh.h Sun May 7 22:24:17 2000
+++ gcc-2.95.2+kaz+g/gcc/config/sh/sh.h Mon May 1 17:02:05 2000
@@ -107,6 +107,7 @@
#define BIGTABLE_BIT (1<<14)
#define RELAX_BIT (1<<15)
#define HITACHI_BIT (1<<22)
+#define NOFPU_DIV_BIT (1<<23)
#define USERMODE_BIT (1<<24)
#define SMALLPOOLS_BIT (1<<25)
#define PREFERGOT_BIT (1<<26)
@@ -180,6 +181,9 @@
/* Nonzero if generating code for a little endian SH. */
#define TARGET_LITTLE_ENDIAN (target_flags & LITTLE_ENDIAN_BIT)
+/* Nonzero if we should prefer not to use FPU in interger division. */
+#define TARGET_NOFPU_DIV (target_flags & NOFPU_DIV_BIT)
+
/* Nonzero if we should do everything in userland. */
#define TARGET_USERMODE (target_flags & USERMODE_BIT)
@@ -209,6 +213,7 @@
{"isize", ISIZE_BIT}, \
{"l", LITTLE_ENDIAN_BIT}, \
{"no-ieee", -IEEE_BIT}, \
+ {"nofpu-idiv", NOFPU_DIV_BIT}, \
{"padstruct", PADSTRUCT_BIT}, \
{"usermode", USERMODE_BIT}, \
{"smallpools",SMALLPOOLS_BIT}, \
@@ -223,7 +228,7 @@
/* This are meant to be redefined in the host dependent files */
#define SUBTARGET_SWITCHES
-#define TARGET_DEFAULT (0)
+#define TARGET_DEFAULT (SH3_BIT|SH2_BIT|LITTLE_ENDIAN_BIT)
#define OPTIMIZATION_OPTIONS(LEVEL,SIZE) \
do { \
@@ -1546,7 +1551,6 @@
}
extern struct rtx_def *legitimize_function_address ();
-extern struct rtx_def *legitimize_builtin_function_address ();
/* Specify the machine mode that this machine uses
for the index in the tablejump instruction. */
@@ -2055,6 +2059,15 @@
/* Output a globalising directive for a label. */
#define ASM_GLOBALIZE_LABEL(STREAM,NAME) \
(fprintf ((STREAM), "\t.global\t"), \
+ assemble_name ((STREAM), (NAME)), \
+ fputc ('\n', (STREAM)))
+
+/* Output a hidden&global directive for a label. */
+#define ASM_HIDDEN_GLOBAL_LABEL(STREAM,NAME) \
+ (fprintf ((STREAM), "\t.global\t"), \
+ assemble_name ((STREAM), (NAME)), \
+ fputc ('\n', (STREAM)), \
+ fprintf ((STREAM), "\t.hidden\t"), \
assemble_name ((STREAM), (NAME)), \
fputc ('\n', (STREAM)))
diff --exclude CVS -ruN gcc-core/gcc/config/sh/sh.md gcc-2.95.2+kaz+g/gcc/config/sh/sh.md
--- gcc-core/gcc/config/sh/sh.md Sun May 7 22:24:17 2000
+++ gcc-2.95.2+kaz+g/gcc/config/sh/sh.md Mon May 1 17:02:05 2000
@@ -865,7 +865,7 @@
(clobber (reg:SI 1))
(clobber (reg:SI 2))
(use (match_operand:SI 1 "arith_reg_operand" "r"))]
- "! TARGET_SH4"
+ "! (TARGET_SH4 && ! TARGET_NOFPU_DIV)"
"jsr @%1%#"
[(set_attr "type" "sfunc")
(set_attr "needs_delay_slot" "yes")])
@@ -885,7 +885,7 @@
(clobber (reg:SI 5))
(use (reg:PSI 48))
(use (match_operand:SI 1 "arith_reg_operand" "r"))]
- "TARGET_SH4 && ! TARGET_FPU_SINGLE"
+ "(TARGET_SH4 && ! TARGET_NOFPU_DIV) && ! TARGET_FPU_SINGLE"
"jsr @%1%#"
[(set_attr "type" "sfunc")
(set_attr "needs_delay_slot" "yes")])
@@ -904,7 +904,7 @@
(clobber (reg:SI 4))
(clobber (reg:SI 5))
(use (match_operand:SI 1 "arith_reg_operand" "r"))]
- "TARGET_HARD_SH4 && TARGET_FPU_SINGLE"
+ "(TARGET_HARD_SH4 && ! TARGET_NOFPU_DIV) && TARGET_FPU_SINGLE"
"jsr @%1%#"
[(set_attr "type" "sfunc")
(set_attr "needs_delay_slot" "yes")])
@@ -925,11 +925,12 @@
emit_move_insn (gen_rtx (REG, SImode, 4), operands[1]);
emit_move_insn (gen_rtx (REG, SImode, 5), operands[2]);
- if (TARGET_HARD_SH4)
+ if (TARGET_HARD_SH4 && ! TARGET_NOFPU_DIV)
{
sym = gen_rtx_SYMBOL_REF (SImode, \"__udivsi3_i4\");
+ assemble_external_libcall (sym);
if (flag_pic)
- sym = legitimize_builtin_function_address (sym);
+ sym = legitimize_function_address (SImode, sym, 0);
emit_move_insn (operands[3], sym);
if (TARGET_FPU_SINGLE)
emit_insn (gen_udivsi3_i4_single (operands[0], operands[3]));
@@ -939,8 +940,9 @@
else
{
sym = gen_rtx_SYMBOL_REF (SImode, \"__udivsi3\");
+ assemble_external_libcall (sym);
if (flag_pic)
- sym = legitimize_builtin_function_address (sym);
+ sym = legitimize_function_address (SImode, sym, 0);
emit_move_insn (operands[3], sym);
emit_insn (gen_udivsi3_i3 (operands[0], operands[3]));
}
@@ -957,7 +959,7 @@
(clobber (reg:SI 2))
(clobber (reg:SI 3))
(use (match_operand:SI 1 "arith_reg_operand" "r"))]
- "! TARGET_SH4"
+ "! (TARGET_SH4 && ! TARGET_NOFPU_DIV)"
"jsr @%1%#"
[(set_attr "type" "sfunc")
(set_attr "needs_delay_slot" "yes")])
@@ -974,7 +976,7 @@
(clobber (reg:SI 2))
(use (reg:PSI 48))
(use (match_operand:SI 1 "arith_reg_operand" "r"))]
- "TARGET_SH4 && ! TARGET_FPU_SINGLE"
+ "(TARGET_SH4 && ! TARGET_NOFPU_DIV) && ! TARGET_FPU_SINGLE"
"jsr @%1%#"
[(set_attr "type" "sfunc")
(set_attr "needs_delay_slot" "yes")])
@@ -990,7 +992,7 @@
(clobber (reg:SI 1))
(clobber (reg:SI 2))
(use (match_operand:SI 1 "arith_reg_operand" "r"))]
- "TARGET_HARD_SH4 && TARGET_FPU_SINGLE"
+ "(TARGET_HARD_SH4 && ! TARGET_NOFPU_DIV) && TARGET_FPU_SINGLE"
"jsr @%1%#"
[(set_attr "type" "sfunc")
(set_attr "needs_delay_slot" "yes")])
@@ -1011,11 +1013,12 @@
emit_move_insn (gen_rtx (REG, SImode, 4), operands[1]);
emit_move_insn (gen_rtx (REG, SImode, 5), operands[2]);
- if (TARGET_HARD_SH4)
+ if (TARGET_HARD_SH4 && ! TARGET_NOFPU_DIV)
{
sym = gen_rtx_SYMBOL_REF (SImode, \"__sdivsi3_i4\");
+ assemble_external_libcall (sym);
if (flag_pic)
- sym = legitimize_builtin_function_address (sym);
+ sym = legitimize_function_address (SImode, sym, 0);
emit_move_insn (operands[3], sym);
if (TARGET_FPU_SINGLE)
emit_insn (gen_divsi3_i4_single (operands[0], operands[3]));
@@ -1025,8 +1028,9 @@
else
{
sym = gen_rtx_SYMBOL_REF (SImode, \"__sdivsi3\");
+ assemble_external_libcall (sym);
if (flag_pic)
- sym = legitimize_builtin_function_address (sym);
+ sym = legitimize_function_address (SImode, sym, 0);
emit_move_insn (operands[3], sym);
emit_insn (gen_divsi3_i3 (operands[0], operands[3]));
}
@@ -1135,8 +1139,10 @@
{
/* The address must be set outside the libcall,
since it goes into a pseudo. */
- rtx addr = force_reg (SImode, gen_rtx_SYMBOL_REF (SImode, \"__mulsi3\"));
+ rtx sym = gen_rtx_SYMBOL_REF (SImode, \"__mulsi3\");
+ rtx addr = force_reg (SImode, sym);
rtx insns = gen_mulsi3_call (operands[0], operands[1], operands[2], addr);
+ assemble_external_libcall (sym);
first = XVECEXP (insns, 0, 0);
last = XVECEXP (insns, 0, XVECLEN (insns, 0) - 1);
emit_insn (insns);
diff --exclude CVS -ruN gcc-core/gcc/config/sh/t-linux gcc-2.95.2+kaz+g/gcc/config/sh/t-linux
--- gcc-core/gcc/config/sh/t-linux Sun May 7 23:12:05 2000
+++ gcc-2.95.2+kaz+g/gcc/config/sh/t-linux Mon May 1 16:53:41 2000
@@ -1,4 +1,4 @@
-TARGET_LIBGCC2_CFLAGS=-DHAVE_VISIVILITY_HIDDEN
+TARGET_LIBGCC2_CFLAGS=-DHAVE_VISIVILITY_HIDDEN -fpic
LIBGCC1 = libgcc1-asm.a
CROSS_LIBGCC1 = libgcc1-asm.a
LIB1ASMSRC = sh/lib1funcs-gnu.asm
@@ -30,3 +30,20 @@
LIBGCC = stmp-multilib
INSTALL_LIBGCC = install-multilib
+
+EXTRA_MULTILIB_PARTS= crtbegin.o crtend.o crtbeginS.o crtendS.o
+
+# Compile crtbeginS.o and crtendS.o with pic.
+CRTSTUFF_T_CFLAGS_S = -fPIC
+
+tcrtbeginS.o: crtstuff.c $(GCC_PASSES) $(CONFIG_H) \
+ defaults.h frame.h gbl-ctors.h
+ $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \
+ -finhibit-size-directive -fno-inline-functions -fno-exceptions $(CRTSTUFF_T_CFLAGS_S) \
+ -c $(srcdir)/crtstuff.c -DCRT_BEGIN -o tcrtbeginS$(objext)
+
+tcrtendS.o: crtstuff.c $(GCC_PASSES) $(CONFIG_H) \
+ defaults.h frame.h gbl-ctors.h
+ $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \
+ -finhibit-size-directive -fno-inline-functions -fno-exceptions $(CRTSTUFF_T_CFLAGS_S) \
+ -c $(srcdir)/crtstuff.c -DCRT_END -o tcrtendS$(objext)
diff --exclude CVS -ruN gcc-core/gcc/config/sh/t-sh gcc-2.95.2+kaz+g/gcc/config/sh/t-sh
--- gcc-core/gcc/config/sh/t-sh Sun May 7 22:24:17 2000
+++ gcc-2.95.2+kaz+g/gcc/config/sh/t-sh Mon May 1 16:51:22 2000
@@ -1,13 +1,8 @@
LIBGCC1 = libgcc1-asm.a
CROSS_LIBGCC1 = libgcc1-asm.a
-ifneq (,$(findstring gnu,$(target)))
-LIB1ASMSRC = sh/lib1funcs-gnu.asm
-else
LIB1ASMSRC = sh/lib1funcs.asm
-endif
LIB1ASMFUNCS = _ashiftrt _ashiftrt_n _ashiftlt _lshiftrt _movstr \
- _movstr_i4 _mulsi3 _sdivsi3 _sdivsi3_i4 _udivsi3 _udivsi3_i4 _set_fpscr \
- _ic_invalidate
+ _movstr_i4 _mulsi3 _sdivsi3 _sdivsi3_i4 _udivsi3 _udivsi3_i4 _set_fpscr
# These are really part of libgcc1, but this will cause them to be
# built correctly, so...
diff --exclude CVS -ruN gcc-core/gcc/configure gcc-2.95.2+kaz+g/gcc/configure
--- gcc-core/gcc/configure Sun May 7 22:44:44 2000
+++ gcc-2.95.2+kaz+g/gcc/configure Mon May 1 16:55:31 2000
@@ -5312,6 +5312,7 @@
tm_file=sh/linux.h
tmake_file="sh/t-linux"
xmake_file=x-linux
+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
gas=yes gnu_ld=yes
if test x$enable_threads = xyes; then
thread_file='posix'
diff --exclude CVS -ruN gcc-core/gcc/configure.in gcc-2.95.2+kaz+g/gcc/configure.in
--- gcc-core/gcc/configure.in Sun May 7 22:44:44 2000
+++ gcc-2.95.2+kaz+g/gcc/configure.in Mon May 1 16:51:22 2000
@@ -3007,6 +3007,7 @@
tm_file=sh/linux.h
tmake_file="sh/t-linux"
xmake_file=x-linux
+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
gas=yes gnu_ld=yes
if test x$enable_threads = xyes; then
thread_file='posix'
diff --exclude CVS -ruN gcc-core/gcc/crtstuff.c gcc-2.95.2+kaz+g/gcc/crtstuff.c
--- gcc-core/gcc/crtstuff.c Sun May 7 22:09:28 2000
+++ gcc-2.95.2+kaz+g/gcc/crtstuff.c Mon May 1 16:51:22 2000
@@ -181,6 +181,9 @@
/* Stick a call to __do_global_dtors_aux into the .fini section. */
+#if defined(CALL_IN_FINI_SECTION)
+CALL_IN_FINI_SECTION (__do_global_dtors_aux)
+#else
static void __attribute__ ((__unused__))
fini_dummy (void)
{
@@ -191,6 +194,7 @@
#endif
asm (TEXT_SECTION_ASM_OP);
}
+#endif /* defined(CALL_IN_FINI_SECTION) */
#ifdef EH_FRAME_SECTION_ASM_OP
/* Stick a call to __register_frame_info into the .init section. For some
@@ -205,6 +209,9 @@
__register_frame_info (__EH_FRAME_BEGIN__, &object);
}
+#if defined(CALL_IN_INIT_SECTION)
+CALL_IN_INIT_SECTION (frame_dummy)
+#else
static void __attribute__ ((__unused__))
init_dummy (void)
{
@@ -215,6 +222,7 @@
#endif
asm (TEXT_SECTION_ASM_OP);
}
+#endif /* defined(CALL_IN_INIT_SECTION) */
#endif /* EH_FRAME_SECTION_ASM_OP */
#else /* OBJECT_FORMAT_ELF */
@@ -370,6 +378,9 @@
/* Stick a call to __do_global_ctors_aux into the .init section. */
+#if defined(CALL_IN_INIT_SECTION)
+CALL_IN_INIT_SECTION (__do_global_ctors_aux)
+#else
static void __attribute__ ((__unused__))
init_dummy (void)
{
@@ -395,6 +406,7 @@
}
#endif
}
+#endif /* defined(CALL_IN_INIT_SECTION) */
#else /* OBJECT_FORMAT_ELF */
|