bfd/
authorBob Wilson <bob.wilson@acm.org>
Wed, 7 May 2008 23:13:09 +0000 (23:13 +0000)
committerBob Wilson <bob.wilson@acm.org>
Wed, 7 May 2008 23:13:09 +0000 (23:13 +0000)
        * elf32-xtensa.c (xtensa_property_section_name): New.
        (xtensa_make_property_section): New.
        (xtensa_get_property_section): Make static.  Do not create a new
        section if it does not exist.
gas/
        * config/tc-xtensa.c (xtensa_create_property_segments): Use
        xtensa_make_property_section instead of xtensa_get_property_section.
        (xtensa_create_xproperty_segments): Likewise.

bfd/ChangeLog
bfd/elf32-xtensa.c
gas/ChangeLog
gas/config/tc-xtensa.c

index 0a8e250f3874f48a8719854a3dfc66b145a8c5b6..0e1ce2cda6cab33d1d31233b1db0dcc231ec2cf9 100644 (file)
@@ -1,3 +1,10 @@
+2008-05-07  Bob Wilson  <bob.wilson@acm.org>
+
+       * elf32-xtensa.c (xtensa_property_section_name): New.
+       (xtensa_make_property_section): New.
+       (xtensa_get_property_section): Make static.  Do not create a new
+       section if it does not exist.
+
 2008-05-08  Alan Modra  <amodra@bigpond.net.au>
 
        * elf32-spu.c (spu_elf_special_sections): Add "._ea".
index 0d744c220e1035e3618ff619bed936cad9eb64b7..a618d3bbbba0f0866e44a8d404ad6e49fb24ae70 100644 (file)
@@ -108,7 +108,8 @@ static bfd_boolean xtensa_is_littable_section (asection *);
 static bfd_boolean xtensa_is_proptable_section (asection *);
 static int internal_reloc_compare (const void *, const void *);
 static int internal_reloc_matches (const void *, const void *);
-extern asection *xtensa_get_property_section (asection *, const char *);
+static asection *xtensa_get_property_section (asection *, const char *);
+extern asection *xtensa_make_property_section (asection *, const char *);
 static flagword xtensa_get_property_predef_flags (asection *);
 
 /* Other functions called directly by the linker.  */
@@ -9716,12 +9717,11 @@ match_section_group (bfd *abfd ATTRIBUTE_UNUSED, asection *sec, void *inf)
 
 static int linkonce_len = sizeof (".gnu.linkonce.") - 1;
 
-asection *
-xtensa_get_property_section (asection *sec, const char *base_name)
+static char *
+xtensa_property_section_name (asection *sec, const char *base_name)
 {
   const char *suffix, *group_name;
   char *prop_sec_name;
-  asection *prop_sec;
 
   group_name = elf_group_name (sec);
   if (group_name)
@@ -9763,10 +9763,36 @@ xtensa_get_property_section (asection *sec, const char *base_name)
   else
     prop_sec_name = strdup (base_name);
 
+  return prop_sec_name;
+}
+
+
+static asection *
+xtensa_get_property_section (asection *sec, const char *base_name)
+{
+  char *prop_sec_name;
+  asection *prop_sec;
+
+  prop_sec_name = xtensa_property_section_name (sec, base_name);
+  prop_sec = bfd_get_section_by_name_if (sec->owner, prop_sec_name,
+                                        match_section_group,
+                                        (void *) elf_group_name (sec));
+  free (prop_sec_name);
+  return prop_sec;
+}
+
+
+asection *
+xtensa_make_property_section (asection *sec, const char *base_name)
+{
+  char *prop_sec_name;
+  asection *prop_sec;
+
   /* Check if the section already exists.  */
+  prop_sec_name = xtensa_property_section_name (sec, base_name);
   prop_sec = bfd_get_section_by_name_if (sec->owner, prop_sec_name,
                                         match_section_group,
-                                        (void *) group_name);
+                                        (void *) elf_group_name (sec));
   /* If not, create it.  */
   if (! prop_sec)
     {
@@ -9779,7 +9805,7 @@ xtensa_get_property_section (asection *sec, const char *base_name)
       if (! prop_sec)
        return 0;
 
-      elf_group_name (prop_sec) = group_name;
+      elf_group_name (prop_sec) = elf_group_name (sec);
     }
 
   free (prop_sec_name);
index a27a0c94a173cb23e969a30e14ccb528e0547f9e..ac546609fc87524831b92bb309a8dda14ad29251 100644 (file)
@@ -1,3 +1,9 @@
+2008-05-07  Bob Wilson  <bob.wilson@acm.org>
+
+       * config/tc-xtensa.c (xtensa_create_property_segments): Use
+       xtensa_make_property_section instead of xtensa_get_property_section.
+       (xtensa_create_xproperty_segments): Likewise.
+
 2008-05-02  H.J. Lu  <hongjiu.lu@intel.com>
 
        * NEWS: Mention XSAVE, EPT and MOVBE.
index 101c150f815f2aa56ce2fa7cb2df309dad4382c2..ace81a87b56ceb1d4c74b23e028e1d259193d47e 100644 (file)
@@ -492,7 +492,7 @@ static segT cache_literal_section (bfd_boolean);
 
 /* Import from elf32-xtensa.c in BFD library.  */
 
-extern asection *xtensa_get_property_section (asection *, const char *);
+extern asection *xtensa_make_property_section (asection *, const char *);
 
 /* op_placement_info functions.  */
 
@@ -10395,7 +10395,7 @@ xtensa_create_property_segments (frag_predicate property_function,
        {
          segment_info_type *xt_seg_info;
          xtensa_block_info **xt_blocks;
-         segT prop_sec = xtensa_get_property_section (sec, section_name_base);
+         segT prop_sec = xtensa_make_property_section (sec, section_name_base);
 
          prop_sec->output_section = prop_sec;
          subseg_set (prop_sec, 0);
@@ -10497,7 +10497,7 @@ xtensa_create_xproperty_segments (frag_flags_fn flag_fn,
        {
          segment_info_type *xt_seg_info;
          xtensa_block_info **xt_blocks;
-         segT prop_sec = xtensa_get_property_section (sec, section_name_base);
+         segT prop_sec = xtensa_make_property_section (sec, section_name_base);
 
          prop_sec->output_section = prop_sec;
          subseg_set (prop_sec, 0);
This page took 0.032809 seconds and 4 git commands to generate.