diff options
Diffstat (limited to 'gas/config/tc-alpha.c')
-rw-r--r-- | gas/config/tc-alpha.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/gas/config/tc-alpha.c b/gas/config/tc-alpha.c index e849a95..4b86d4b 100644 --- a/gas/config/tc-alpha.c +++ b/gas/config/tc-alpha.c @@ -1384,13 +1384,14 @@ load_expression (int targreg, ptr1 = strstr (symname, "..") + 2; if (ptr1 > ptr2) ptr1 = symname; - ensymname = (char *) alloca (ptr2 - ptr1 + 5); + ensymname = (char *) xmalloc (ptr2 - ptr1 + 5); memcpy (ensymname, ptr1, ptr2 - ptr1); memcpy (ensymname + (ptr2 - ptr1), "..en", 5); gas_assert (insn.nfixups + 1 <= MAX_INSN_FIXUPS); insn.fixups[insn.nfixups].reloc = BFD_RELOC_ALPHA_NOP; ensym = symbol_find_or_make (ensymname); + free (ensymname); symbol_mark_used (ensym); /* The fixup must be the same as the BFD_RELOC_ALPHA_BOH case in emit_jsrjmp. See B.4.5.2 of the OpenVMS Linker @@ -1416,13 +1417,14 @@ load_expression (int targreg, ptr1 = strstr (symname, "..") + 2; if (ptr1 > ptr2) ptr1 = symname; - psymname = (char *) alloca (ptr2 - ptr1 + 1); + psymname = (char *) xmalloc (ptr2 - ptr1 + 1); memcpy (psymname, ptr1, ptr2 - ptr1); psymname [ptr2 - ptr1] = 0; gas_assert (insn.nfixups + 1 <= MAX_INSN_FIXUPS); insn.fixups[insn.nfixups].reloc = BFD_RELOC_ALPHA_LDA; psym = symbol_find_or_make (psymname); + free (psymname); symbol_mark_used (psym); insn.fixups[insn.nfixups].exp.X_op = O_subtract; insn.fixups[insn.nfixups].exp.X_add_symbol = psym; @@ -2881,7 +2883,7 @@ emit_jsrjmp (const expressionS *tok, char *ensymname; /* Build the entry name as 'NAME..en'. */ - ensymname = (char *) alloca (symlen + 5); + ensymname = (char *) xmalloc (symlen + 5); memcpy (ensymname, symname, symlen); memcpy (ensymname + symlen, "..en", 5); @@ -2903,6 +2905,7 @@ emit_jsrjmp (const expressionS *tok, insn.fixups[0].procsym = alpha_evax_proc->symbol; insn.nfixups++; alpha_linkage_symbol = 0; + free (ensymname); } #endif @@ -6279,11 +6282,12 @@ tc_gen_reloc (asection *sec ATTRIBUTE_UNUSED, if (pname_len > 4 && strcmp (pname + pname_len - 4, "..en") == 0) { symbolS *sym; - char *my_pname = (char *) alloca (pname_len - 4 + 1); + char *my_pname = (char *) xmalloc (pname_len - 4 + 1); memcpy (my_pname, pname, pname_len - 4); my_pname [pname_len - 4] = 0; sym = symbol_find (my_pname); + free (my_pname); if (sym == NULL) abort (); |