]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
varasm.c (default_section_type_flags): Append _1 to name with shlib parameter.
authorDavid Edelsohn <edelsohn@gnu.org>
Wed, 4 Sep 2002 01:56:12 +0000 (01:56 +0000)
committerDavid Edelsohn <dje@gcc.gnu.org>
Wed, 4 Sep 2002 01:56:12 +0000 (21:56 -0400)
        * varasm.c (default_section_type_flags): Append _1 to name with
        shlib parameter.  Use original name to call new function with
        implicit flag_pic.
        (decl_readonly_section): Likewise.
        (default_elf_select_section): Likewise.
        (default_unique_section): Likewise.
        (default_bind_local_p): Likewise.
        (categorize_decl_for_section): Add shlib parameter to use in place
        of implicit flag_pic.
        * output.h: Declare new functions with _1 and shlib argument.

From-SVN: r56780

gcc/ChangeLog
gcc/output.h
gcc/varasm.c

index 96555f460fc6e6e299e96712454d250befe76624..81db01b1e231f03dff0a825220b2636bdf1a51d7 100644 (file)
@@ -1,3 +1,16 @@
+2002-09-03  David Edelsohn  <edelsohn@gnu.org>
+
+       * varasm.c (default_section_type_flags): Append _1 to name with
+       shlib parameter.  Use original name to call new function with
+       implicit flag_pic.
+       (decl_readonly_section): Likewise.
+       (default_elf_select_section): Likewise.
+       (default_unique_section): Likewise.
+       (default_bind_local_p): Likewise.
+       (categorize_decl_for_section): Add shlib parameter to use in place
+       of implicit flag_pic.
+       * output.h: Declare new functions with _1 and shlib argument.
+
 2002-09-03  Janis Johnson  <janis187@us.ibm.com>
 
        * doc/install.texi: Fix typos, formatting problems, and obvious
index fadf5f8e6dced6b6e7ed462d78f6a1fb43776883..bbacd3104562450fb1d28b53fce68993c9c9ed7f 100644 (file)
@@ -468,6 +468,7 @@ extern rtx this_is_asm_operands;
 /* Decide whether DECL needs to be in a writable section.
    RELOC is the same as for SELECT_SECTION.  */
 extern bool decl_readonly_section PARAMS ((tree, int));
+extern bool decl_readonly_section_1 PARAMS ((tree, int, int));
 
 /* User label prefix in effect for this compilation.  */
 extern const char *user_label_prefix;
@@ -508,6 +509,9 @@ extern bool named_section_first_declaration PARAMS((const char *));
 union tree_node;
 extern unsigned int default_section_type_flags PARAMS ((union tree_node *,
                                                        const char *, int));
+extern unsigned int default_section_type_flags_1 PARAMS ((union tree_node *,
+                                                         const char *,
+                                                         int, int));
 
 extern void default_no_named_section PARAMS ((const char *, unsigned int));
 extern void default_elf_asm_named_section PARAMS ((const char *, unsigned int));
@@ -530,13 +534,17 @@ extern void default_select_section PARAMS ((tree, int,
                                            unsigned HOST_WIDE_INT));
 extern void default_elf_select_section PARAMS ((tree, int,
                                                unsigned HOST_WIDE_INT));
+extern void default_elf_select_section_1 PARAMS ((tree, int,
+                                                 unsigned HOST_WIDE_INT, int));
 extern void default_unique_section PARAMS ((tree, int));
+extern void default_unique_section_1 PARAMS ((tree, int, int));
 extern void default_select_rtx_section PARAMS ((enum machine_mode, rtx,
                                                unsigned HOST_WIDE_INT));
 extern void default_elf_select_rtx_section PARAMS ((enum machine_mode, rtx,
                                                    unsigned HOST_WIDE_INT));
 extern const char *default_strip_name_encoding PARAMS ((const char *));
 extern bool default_binds_local_p PARAMS ((tree));
+extern bool default_binds_local_p_1 PARAMS ((tree, int));
 extern void default_globalize_label PARAMS ((FILE *, const char *));
 
 /* Emit data for vtable gc for GNU binutils.  */
index b3ea8aa1c8523b8d64a89e40fd750252114cfcdc..e84a2891153a4b33d67a9c5effe347afff44d2a2 100644 (file)
@@ -4690,12 +4690,22 @@ default_section_type_flags (decl, name, reloc)
      tree decl;
      const char *name;
      int reloc;
+{
+  return default_section_type_flags_1 (decl, name, reloc, flag_pic);
+}
+
+unsigned int
+default_section_type_flags_1 (decl, name, reloc, shlib)
+     tree decl;
+     const char *name;
+     int reloc;
+     int shlib;
 {
   unsigned int flags;
 
   if (decl && TREE_CODE (decl) == FUNCTION_DECL)
     flags = SECTION_CODE;
-  else if (decl && decl_readonly_section (decl, reloc))
+  else if (decl && decl_readonly_section_1 (decl, reloc, shlib))
     flags = 0;
   else
     flags = SECTION_WRITE;
@@ -4913,12 +4923,14 @@ enum section_category
   SECCAT_TBSS
 };
 
-static enum section_category categorize_decl_for_section PARAMS ((tree, int));
+static enum section_category
+categorize_decl_for_section PARAMS ((tree, int, int));
 
 static enum section_category
-categorize_decl_for_section (decl, reloc)
+categorize_decl_for_section (decl, reloc, shlib)
      tree decl;
      int reloc;
+     int shlib;
 {
   enum section_category ret;
 
@@ -4940,16 +4952,16 @@ categorize_decl_for_section (decl, reloc)
               || TREE_SIDE_EFFECTS (decl)
               || ! TREE_CONSTANT (DECL_INITIAL (decl)))
        {
-         if (flag_pic && (reloc & 2))
+         if (shlib && (reloc & 2))
            ret = SECCAT_DATA_REL;
-         else if (flag_pic && reloc)
+         else if (shlib && reloc)
            ret = SECCAT_DATA_REL_LOCAL;
          else
            ret = SECCAT_DATA;
        }
-      else if (flag_pic && (reloc & 2))
+      else if (shlib && (reloc & 2))
        ret = SECCAT_DATA_REL_RO;
-      else if (flag_pic && reloc)
+      else if (shlib && reloc)
        ret = SECCAT_DATA_REL_RO_LOCAL;
       else if (flag_merge_constants < 2)
        /* C and C++ don't allow different variables to share the same
@@ -4963,7 +4975,7 @@ categorize_decl_for_section (decl, reloc)
     }
   else if (TREE_CODE (decl) == CONSTRUCTOR)
     {
-      if ((flag_pic && reloc)
+      if ((shlib && reloc)
          || TREE_SIDE_EFFECTS (decl)
          || ! TREE_CONSTANT (decl))
        ret = SECCAT_DATA;
@@ -4999,7 +5011,16 @@ decl_readonly_section (decl, reloc)
      tree decl;
      int reloc;
 {
-  switch (categorize_decl_for_section (decl, reloc))
+  return decl_readonly_section_1 (decl, reloc, flag_pic);
+}
+
+bool
+decl_readonly_section_1 (decl, reloc, shlib)
+     tree decl;
+     int reloc;
+     int shlib;
+{
+  switch (categorize_decl_for_section (decl, reloc, shlib))
     {
     case SECCAT_RODATA:
     case SECCAT_RODATA_MERGE_STR:
@@ -5021,7 +5042,17 @@ default_elf_select_section (decl, reloc, align)
      int reloc;
      unsigned HOST_WIDE_INT align;
 {
-  switch (categorize_decl_for_section (decl, reloc))
+  default_elf_select_section_1 (decl, reloc, align, flag_pic);
+}
+
+void
+default_elf_select_section_1 (decl, reloc, align, shlib)
+     tree decl;
+     int reloc;
+     unsigned HOST_WIDE_INT align;
+     int shlib;
+{
+  switch (categorize_decl_for_section (decl, reloc, shlib))
     {
     case SECCAT_TEXT:
       /* We're not supposed to be called on FUNCTION_DECLs.  */
@@ -5084,13 +5115,22 @@ void
 default_unique_section (decl, reloc)
      tree decl;
      int reloc;
+{
+  default_unique_section_1 (decl, reloc, flag_pic);
+}
+
+void
+default_unique_section_1 (decl, reloc, shlib)
+     tree decl;
+     int reloc;
+     int shlib;
 {
   bool one_only = DECL_ONE_ONLY (decl);
   const char *prefix, *name;
   size_t nlen, plen;
   char *string;
 
-  switch (categorize_decl_for_section (decl, reloc))
+  switch (categorize_decl_for_section (decl, reloc, shlib))
     {
     case SECCAT_TEXT:
       prefix = one_only ? ".gnu.linkonce.t." : ".text.";
@@ -5204,6 +5244,14 @@ default_strip_name_encoding (str)
 bool
 default_binds_local_p (exp)
      tree exp;
+{
+  return default_binds_local_p_1 (exp, flag_pic);
+}
+
+bool
+default_binds_local_p_1 (exp, shlib)
+     tree exp;
+     int shlib;
 {
   bool local_p;
 
@@ -5224,7 +5272,7 @@ default_binds_local_p (exp)
     local_p = false;
   /* If PIC, then assume that any global name can be overridden by
      symbols resolved from other modules.  */
-  else if (flag_pic)
+  else if (shlib)
     local_p = false;
   /* Uninitialized COMMON variable may be unified with symbols
      resolved from other modules.  */