aboutsummaryrefslogtreecommitdiff
path: root/gas/config
diff options
context:
space:
mode:
authorSterling Augustine <saugustine@google.com>2010-02-11 19:00:21 +0000
committerSterling Augustine <saugustine@google.com>2010-02-11 19:00:21 +0000
commita89c407e4bd3e184672287b6bb57a19fccbfb463 (patch)
tree1d3f6677a5381ed79534b03cd29d37db95934181 /gas/config
parentb1028c8e8f281d1072e1fd89d8083cb960598a1a (diff)
downloadfsf-binutils-gdb-a89c407e4bd3e184672287b6bb57a19fccbfb463.zip
fsf-binutils-gdb-a89c407e4bd3e184672287b6bb57a19fccbfb463.tar.gz
fsf-binutils-gdb-a89c407e4bd3e184672287b6bb57a19fccbfb463.tar.bz2
2010-02-11 Sterling Augustine <sterling@tensilica.com>
* config/tc-xtensa.c (cache_literal_section): Handle prefixes as well as suffixes.
Diffstat (limited to 'gas/config')
-rw-r--r--gas/config/tc-xtensa.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/gas/config/tc-xtensa.c b/gas/config/tc-xtensa.c
index 8345ecb..f8a8112 100644
--- a/gas/config/tc-xtensa.c
+++ b/gas/config/tc-xtensa.c
@@ -10423,15 +10423,25 @@ cache_literal_section (bfd_boolean use_abs_literals)
}
else
{
- /* If the section name ends with ".text", then replace that suffix
- instead of appending an additional suffix. */
+ /* If the section name begins or ends with ".text", then replace
+ that portion instead of appending an additional suffix. */
size_t len = strlen (text_name);
- if (len >= 5 && strcmp (text_name + len - 5, ".text") == 0)
+ if (len >= 5
+ && (strcmp (text_name + len - 5, ".text") == 0
+ || strncmp (text_name, ".text", 5) == 0))
len -= 5;
name = xmalloc (len + strlen (base_name) + 1);
- strcpy (name, text_name);
- strcpy (name + len, base_name);
+ if (strncmp (text_name, ".text", 5) == 0)
+ {
+ strcpy (name, base_name);
+ strcat (name, text_name + 5);
+ }
+ else
+ {
+ strcpy (name, text_name);
+ strcpy (name + len, base_name);
+ }
}
/* Canonicalize section names to allow renaming literal sections.