aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-xtensa.c
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@acm.org>2008-05-07 23:13:09 +0000
committerBob Wilson <bob.wilson@acm.org>2008-05-07 23:13:09 +0000
commit51c8ebc1d0399f147cf2dc5f6d2a75458fdf77f8 (patch)
tree365d0fb2ca5eca7efcae1c0244316075216e0627 /bfd/elf32-xtensa.c
parent236369e7e776877959af5263b5e7a21bcce5e0d3 (diff)
downloadgdb-51c8ebc1d0399f147cf2dc5f6d2a75458fdf77f8.zip
gdb-51c8ebc1d0399f147cf2dc5f6d2a75458fdf77f8.tar.gz
gdb-51c8ebc1d0399f147cf2dc5f6d2a75458fdf77f8.tar.bz2
bfd/
* 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.
Diffstat (limited to 'bfd/elf32-xtensa.c')
-rw-r--r--bfd/elf32-xtensa.c38
1 files changed, 32 insertions, 6 deletions
diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c
index 0d744c2..a618d3b 100644
--- a/bfd/elf32-xtensa.c
+++ b/bfd/elf32-xtensa.c
@@ -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);