* config/tc-mips.c (mips_flag_pdr): Define.
authorRainer Orth <ro@TechFak.Uni-Bielefeld.DE>
Mon, 28 Jul 2003 20:06:27 +0000 (20:06 +0000)
committerRainer Orth <ro@TechFak.Uni-Bielefeld.DE>
Mon, 28 Jul 2003 20:06:27 +0000 (20:06 +0000)
(md_begin) [OBJ_ELF]: Use it to control .pdr creation.
(s_mips_end) [OBJ_ELF]: Likewise.
(md_longopts) [OBJ_ELF]: Define OPTION_PDR, OPTION_NO_PDR.
(md_parse_option) [OBJ_ELF]: Handle them.
(md_show_usage) [OBJ_ELF]: Document -mpdr, -mno-pdr.

* doc/c-mips.texi (MIPS Opts): Document -mpdr, -mno-pdr.
* doc/as.texinfo (Overview) [MIPS]: Likewise.

gas/ChangeLog
gas/config/tc-mips.c
gas/doc/as.texinfo
gas/doc/c-mips.texi

index fe4210685bd20ef8dfd61e0ab9f1db620aeaab29..73135fec8fef8eda40616600f2ba1e0295495917 100644 (file)
@@ -1,3 +1,15 @@
+2003-07-28  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
+
+       * config/tc-mips.c (mips_flag_pdr): Define.
+       (md_begin) [OBJ_ELF]: Use it to control .pdr creation.
+       (s_mips_end) [OBJ_ELF]: Likewise.
+       (md_longopts) [OBJ_ELF]: Define OPTION_PDR, OPTION_NO_PDR.
+       (md_parse_option) [OBJ_ELF]: Handle them.
+       (md_show_usage) [OBJ_ELF]: Document -mpdr, -mno-pdr.
+
+       * doc/c-mips.texi (MIPS Opts): Document -mpdr, -mno-pdr.
+       * doc/as.texinfo (Overview) [MIPS]: Likewise.
+
 2003-07-25  H.J. Lu  <hongjiu.lu@intel.com>
 
        * config/obj-elf.c (obj_elf_change_section): Update
index 0aa5a2a3da3779a181121948e209a81f7268b798..e2e3f4a3294ecfedfd3e214047fd949ef7780977 100644 (file)
@@ -74,6 +74,15 @@ static int mips_output_flavor (void) { return OUTPUT_FLAVOR; }
 
 int mips_flag_mdebug = -1;
 
+/* Control generation of .pdr sections.  Off by default on IRIX: the native
+   linker doesn't know about and discards them, but relocations against them
+   remain, leading to rld crashes.  */
+#ifdef TE_IRIX
+int mips_flag_pdr = FALSE;
+#else
+int mips_flag_pdr = TRUE;
+#endif
+
 #include "ecoff.h"
 
 #if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)
@@ -1283,7 +1292,7 @@ md_begin (void)
            (void) bfd_set_section_alignment (stdoutput, sec, 2);
          }
 #ifdef OBJ_ELF
-       else if (OUTPUT_FLAVOR == bfd_target_elf_flavour)
+       else if (OUTPUT_FLAVOR == bfd_target_elf_flavour && mips_flag_pdr)
          {
            pdr_seg = subseg_new (".pdr", (subsegT) 0);
            (void) bfd_set_section_flags (stdoutput, pdr_seg,
@@ -10322,6 +10331,10 @@ struct option md_longopts[] =
   {"mdebug", no_argument, NULL, OPTION_MDEBUG},
 #define OPTION_NO_MDEBUG   (OPTION_ELF_BASE + 8)
   {"no-mdebug", no_argument, NULL, OPTION_NO_MDEBUG},
+#define OPTION_PDR        (OPTION_ELF_BASE + 9)
+  {"mpdr", no_argument, NULL, OPTION_PDR},
+#define OPTION_NO_PDR     (OPTION_ELF_BASE + 10)
+  {"mno-pdr", no_argument, NULL, OPTION_NO_PDR},
 #endif /* OBJ_ELF */
 
   {NULL, no_argument, NULL, 0}
@@ -10670,6 +10683,14 @@ md_parse_option (int c, char *arg)
     case OPTION_NO_MDEBUG:
       mips_flag_mdebug = FALSE;
       break;
+
+    case OPTION_PDR:
+      mips_flag_pdr = TRUE;
+      break;
+
+    case OPTION_NO_PDR:
+      mips_flag_pdr = FALSE;
+      break;
 #endif /* OBJ_ELF */
 
     default:
@@ -14040,7 +14061,8 @@ s_mips_end (int x ATTRIBUTE_UNUSED)
 
 #ifdef OBJ_ELF
   /* Generate a .pdr section.  */
-  if (OUTPUT_FLAVOR == bfd_target_elf_flavour && ! ECOFF_DEBUGGING)
+  if (OUTPUT_FLAVOR == bfd_target_elf_flavour && ! ECOFF_DEBUGGING
+      && mips_flag_pdr)
     {
       segT saved_seg = now_seg;
       subsegT saved_subseg = now_subseg;
@@ -14525,6 +14547,7 @@ MIPS options:\n\
 -KPIC, -call_shared    generate SVR4 position independent code\n\
 -non_shared            do not generate position independent code\n\
 -xgot                  assume a 32 bit GOT\n\
+-mpdr, -mno-pdr                enable/disable creation of .pdr sections\n\
 -mabi=ABI              create ABI conformant object file for:\n"));
 
   first = 1;
index 32b7678f0ae7c2ed294285f1efbfdc9926fd076a..8d3bfc55908a1d9f9d98c1995c8abe356a272324 100644 (file)
@@ -399,6 +399,7 @@ gcc(1), ld(1), and the Info entries for @file{binutils} and @file{ld}.
    [@b{-mips3d}] [@b{-no-mips3d}]
    [@b{-mdmx}] [@b{-no-mdmx}]
    [@b{-mdebug}] [@b{-no-mdebug}]
+   [@b{-mpdr}] [@b{-mno-pdr}]
 @end ifset
 @ifset MMIX
 
@@ -952,6 +953,10 @@ of an mfhi or mflo instruction occurs in the following two instructions.
 Cause stabs-style debugging output to go into an ECOFF-style .mdebug
 section instead of the standard ELF .stabs sections.
 
+@item -mpdr
+@itemx -mno-pdr
+Control generation of @code{.pdr} sections.
+
 @item -mgp32
 @itemx -mfp32
 The register sizes are normally inferred from the ISA and ABI, but these
index 4138d16f1d0646e001395fc6ae4156dd6e7105e2..4da7b259dd0f3d92b2cf50ee6ee661e7d9b3d944 100644 (file)
@@ -1,4 +1,4 @@
-@c Copyright 1991, 1992, 1993, 1994, 1995, 1997, 1999, 2000
+@c Copyright 1991, 1992, 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2002, 2003
 @c Free Software Foundation, Inc.
 @c This is part of the GAS manual.
 @c For copying conditions, see the file as.texinfo.
@@ -230,6 +230,11 @@ are only supported at Instruction Set Architecture level 2 and higher.
 Generate code to take a break exception rather than a trap exception when an
 error is detected.  This is the default.
 
+@item -mpdr
+@itemx -mno-pdr
+Control generation of @code{.pdr} sections.  Off by default on IRIX, on
+elsewhere.
+
 @item -n
 When this option is used, @code{@value{AS}} will issue a warning every
 time it generates a nop instruction from a macro.
This page took 0.059379 seconds and 4 git commands to generate.