From: Tristan Gingold Date: Tue, 28 Jun 2011 09:23:53 +0000 (+0000) Subject: 2011-06-28 Tristan Gingold X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e1f4d6bd07bd37201961f3efc3705cdd3b1611bf;p=binutils-gdb.git 2011-06-28 Tristan Gingold * config/tc-alpha.c (load_expression): Use alloca instead of xmalloc. (emit_jsrjmp): Ditto. (tc_gen_reloc): Ditto. --- diff --git a/gas/ChangeLog b/gas/ChangeLog index a9092a5a82b..9c8891716cb 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,9 @@ +2011-06-28 Tristan Gingold + + * config/tc-alpha.c (load_expression): Use alloca instead of xmalloc. + (emit_jsrjmp): Ditto. + (tc_gen_reloc): Ditto. + 2011-06-28 Tristan Gingold * config/tc-alpha.c (alpha_evax_proc_hash): Remove. diff --git a/gas/config/tc-alpha.c b/gas/config/tc-alpha.c index 0e9b81ff3a2..013647d13ef 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;