aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorTristan Gingold <gingold@adacore.com>2011-06-28 09:23:53 +0000
committerTristan Gingold <gingold@adacore.com>2011-06-28 09:23:53 +0000
commite1f4d6bd07bd37201961f3efc3705cdd3b1611bf (patch)
treee48ddc4dfed910c5963a9c6e97a0c94f129466e3 /gas
parent25d41743dc575d878e186cf34bb9cd25daf620ff (diff)
downloadgdb-e1f4d6bd07bd37201961f3efc3705cdd3b1611bf.zip
gdb-e1f4d6bd07bd37201961f3efc3705cdd3b1611bf.tar.gz
gdb-e1f4d6bd07bd37201961f3efc3705cdd3b1611bf.tar.bz2
2011-06-28 Tristan Gingold <gingold@adacore.com>
* config/tc-alpha.c (load_expression): Use alloca instead of xmalloc. (emit_jsrjmp): Ditto. (tc_gen_reloc): Ditto.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog6
-rw-r--r--gas/config/tc-alpha.c11
2 files changed, 13 insertions, 4 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index a9092a5..9c88917 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,11 @@
2011-06-28 Tristan Gingold <gingold@adacore.com>
+ * config/tc-alpha.c (load_expression): Use alloca instead of xmalloc.
+ (emit_jsrjmp): Ditto.
+ (tc_gen_reloc): Ditto.
+
+2011-06-28 Tristan Gingold <gingold@adacore.com>
+
* config/tc-alpha.c (alpha_evax_proc_hash): Remove.
(alpha_evax_proc_data): New variable.
(s_alpha_ent): Prevent nested function. Remove has_insert call.
diff --git a/gas/config/tc-alpha.c b/gas/config/tc-alpha.c
index 0e9b81f..013647d 100644
--- a/gas/config/tc-alpha.c
+++ b/gas/config/tc-alpha.c
@@ -1387,7 +1387,7 @@ load_expression (int targreg,
ptr1 = strstr (symname, "..") + 2;
if (ptr1 > ptr2)
ptr1 = symname;
- ensymname = (char *) xmalloc (ptr2 - ptr1 + 5);
+ ensymname = (char *) alloca (ptr2 - ptr1 + 5);
memcpy (ensymname, ptr1, ptr2 - ptr1);
memcpy (ensymname + (ptr2 - ptr1), "..en", 5);
@@ -1419,7 +1419,7 @@ load_expression (int targreg,
ptr1 = strstr (symname, "..") + 2;
if (ptr1 > ptr2)
ptr1 = symname;
- psymname = (char *) xmalloc (ptr2 - ptr1 + 1);
+ psymname = (char *) alloca (ptr2 - ptr1 + 1);
memcpy (psymname, ptr1, ptr2 - ptr1);
psymname [ptr2 - ptr1] = 0;
@@ -2884,7 +2884,7 @@ emit_jsrjmp (const expressionS *tok,
char *ensymname;
/* Build the entry name as 'NAME..en'. */
- ensymname = (char *) xmalloc (symlen + 5);
+ ensymname = (char *) alloca (symlen + 5);
memcpy (ensymname, symname, symlen);
memcpy (ensymname + symlen, "..en", 5);
@@ -6282,11 +6282,14 @@ tc_gen_reloc (asection *sec ATTRIBUTE_UNUSED,
if (pname_len > 4 && strcmp (pname + pname_len - 4, "..en") == 0)
{
symbolS *sym;
- char *my_pname = xstrdup (pname);
+ char *my_pname = (char *) alloca (pname_len - 4 + 1);
+
+ memcpy (my_pname, pname, pname_len - 4);
my_pname [pname_len - 4] = 0;
sym = symbol_find (my_pname);
if (sym == NULL)
abort ();
+
while (symbol_equated_reloc_p (sym))
{
symbolS *n = symbol_get_value_expression (sym)->X_add_symbol;