]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
rs6000.c (SMALL_DATA_REG): Register to use for small data relocs.
authorMichael Meissner <meissner@cygnus.com>
Thu, 27 Nov 1997 00:06:53 +0000 (00:06 +0000)
committerJeff Law <law@gcc.gnu.org>
Thu, 27 Nov 1997 00:06:53 +0000 (17:06 -0700)
        * rs6000.c (SMALL_DATA_REG): Register to use for small data relocs.
        (print_operand): Use SMALL_DATA_REG for the register involved in
        small data relocations.
        (print_operand_address): Ditto.

        * rs6000/linux.h (LINK_SPEC): Pass -dynamic-linker /lib/ld.so.1 if
        -dynamic linker is not used.

        * rs6000.md (call insns): For local calls, use @local suffix under
        System V.  Don't use @plt under Solaris.

From-SVN: r16771

gcc/ChangeLog
gcc/config/rs6000/linux.h
gcc/config/rs6000/rs6000.c
gcc/config/rs6000/rs6000.md

index dae49b30f2fe40fd9e00e6e48945be5348d457d1..f9d6aaf21382ef494690b861f340bd424dec901f 100644 (file)
@@ -1,5 +1,16 @@
 Wed Nov 26 13:04:46 1997  Michael Meissner  <meissner@cygnus.com>
 
+       * rs6000.c (SMALL_DATA_REG): Register to use for small data relocs.
+       (print_operand): Use SMALL_DATA_REG for the register involved in
+       small data relocations.
+       (print_operand_address): Ditto.
+
+       * rs6000/linux.h (LINK_SPEC): Pass -dynamic-linker /lib/ld.so.1 if
+       -dynamic linker is not used.
+
+       * rs6000.md (call insns): For local calls, use @local suffix under
+       System V.  Don't use @plt under Solaris.
+
        * rs6000.c (output_function_profiler): Put label address in r0, and
        store LR in 4(sp) for System V/eabi.
 
index 787afa816d421614674904aed8849476c6201069..0632dce365573d08a03a507fe1a22a5c1ed6db2a 100644 (file)
@@ -28,7 +28,9 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #undef LINK_SPEC
 #define LINK_SPEC "-m elf32ppc %{shared:-shared} \
   %{!shared: \
-    %{!static: %{rdynamic:-export-dynamic}} \
+    %{!static: \
+      %{rdynamic:-export-dynamic} \
+      %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
     %{static:-static}}"
 
 #undef LIB_DEFAULT_SPEC
index cbd682a9d7c86aa9a7a5271882ac4a564ca2637b..a880c75ebd73184521425fc7cd703eb7edb8dcbb 100644 (file)
@@ -2342,8 +2342,10 @@ rs6000_init_expanders ()
 
 #if TARGET_ELF
 #define SMALL_DATA_RELOC ((rs6000_sdata == SDATA_EABI) ? "sda21" : "sdarel")
+#define SMALL_DATA_REG ((rs6000_sdata == SDATA_EABI) ? 0 : 13)
 #else
 #define SMALL_DATA_RELOC "sda21"
+#define SMALL_DATA_REG 0
 #endif
 
 void
@@ -2542,7 +2544,8 @@ print_operand (file, x, code)
          else
            output_address (plus_constant (XEXP (x, 0), 4));
          if (small_data_operand (x, GET_MODE (x)))
-           fprintf (file, "@%s(%s)", SMALL_DATA_RELOC, reg_names[0]);
+           fprintf (file, "@%s(%s)", SMALL_DATA_RELOC,
+                    reg_names[SMALL_DATA_REG]);
        }
       return;
                            
@@ -2770,7 +2773,8 @@ print_operand (file, x, code)
          else
            output_address (plus_constant (XEXP (x, 0), 8));
          if (small_data_operand (x, GET_MODE (x)))
-           fprintf (file, "@%s(%s)", SMALL_DATA_RELOC, reg_names[0]);
+           fprintf (file, "@%s(%s)", SMALL_DATA_RELOC,
+                    reg_names[SMALL_DATA_REG]);
        }
       return;
                            
@@ -2819,7 +2823,8 @@ print_operand (file, x, code)
          else
            output_address (plus_constant (XEXP (x, 0), 12));
          if (small_data_operand (x, GET_MODE (x)))
-           fprintf (file, "@%s(%s)", SMALL_DATA_RELOC, reg_names[0]);
+           fprintf (file, "@%s(%s)", SMALL_DATA_RELOC,
+                    reg_names[SMALL_DATA_REG]);
        }
       return;
                            
@@ -2861,7 +2866,8 @@ print_operand_address (file, x)
     {
       output_addr_const (file, x);
       if (small_data_operand (x, GET_MODE (x)))
-       fprintf (file, "@%s(%s)", SMALL_DATA_RELOC, reg_names[0]);
+       fprintf (file, "@%s(%s)", SMALL_DATA_RELOC,
+                reg_names[SMALL_DATA_REG]);
 
 #ifdef TARGET_NO_TOC
       else if (TARGET_NO_TOC)
index 4446e8570dc986b55d3505077b5626da635efe06..47e0feb8e98bda9389c7a54e925de37505c570b5 100644 (file)
   else if (INTVAL (operands[2]) & CALL_V4_CLEAR_FP_ARGS)
     output_asm_insn (\"creqv 6,6,6\", operands);
 
-  return \"bl %z0\";
+  return (DEFAULT_ABI == ABI_V4 && flag_pic) ? \"bl %z0@local\" : \"bl %z0\";
 }"
   [(set_attr "type" "branch")
    (set_attr "length" "4,8")])
   else if (INTVAL (operands[2]) & CALL_V4_CLEAR_FP_ARGS)
     output_asm_insn (\"creqv 6,6,6\", operands);
 
-  return flag_pic ? \"bl %z0@plt\" : \"bl %z0\";
+  return (DEFAULT_ABI == ABI_V4 && flag_pic) ? \"bl %z0@plt\" : \"bl %z0\";
 }"
   [(set_attr "type" "branch")
    (set_attr "length" "4,8")])
   else if (INTVAL (operands[3]) & CALL_V4_CLEAR_FP_ARGS)
     output_asm_insn (\"creqv 6,6,6\", operands);
 
-  return \"bl %z1\";
+  return (DEFAULT_ABI == ABI_V4 && flag_pic) ? \"bl %z1@local\" : \"bl %z1\";
 }"
   [(set_attr "type" "branch")
    (set_attr "length" "4,8")])
   else if (INTVAL (operands[3]) & CALL_V4_CLEAR_FP_ARGS)
     output_asm_insn (\"creqv 6,6,6\", operands);
 
-  return flag_pic ? \"bl %z1@plt\" : \"bl %z1\";
+  return (DEFAULT_ABI == ABI_V4 && flag_pic) ? \"bl %z1@plt\" : \"bl %z1\";
 }"
   [(set_attr "type" "branch")
    (set_attr "length" "4,8")])