Commit 9d2a6a8e by Richard Kenner

(hppa_encode_label): Allocate stuff on permanent_obstack rather than

via malloc.

From-SVN: r9876
parent 549fd8ff
...@@ -4242,6 +4242,7 @@ output_call (insn, call_dest, return_pointer) ...@@ -4242,6 +4242,7 @@ output_call (insn, call_dest, return_pointer)
return ""; return "";
} }
extern struct obstack permanent_obstack;
extern struct obstack *saveable_obstack; extern struct obstack *saveable_obstack;
/* In HPUX 8.0's shared library scheme, special relocations are needed /* In HPUX 8.0's shared library scheme, special relocations are needed
...@@ -4251,8 +4252,8 @@ extern struct obstack *saveable_obstack; ...@@ -4251,8 +4252,8 @@ extern struct obstack *saveable_obstack;
For reasons too disgusting to describe storage for the new name For reasons too disgusting to describe storage for the new name
is allocated either on the saveable_obstack (released at function is allocated either on the saveable_obstack (released at function
exit) or via malloc for things that can never change (libcall names exit) or on the permanent_obstack for things that can never change
for example). */ (libcall names for example). */
void void
hppa_encode_label (sym, permanent) hppa_encode_label (sym, permanent)
...@@ -4263,10 +4264,8 @@ hppa_encode_label (sym, permanent) ...@@ -4263,10 +4264,8 @@ hppa_encode_label (sym, permanent)
int len = strlen (str); int len = strlen (str);
char *newstr; char *newstr;
if (permanent) newstr = obstack_alloc ((permanent ? &permanent_obstack : saveable_obstack),
newstr = malloc (len + 2); len + 2);
else
newstr = obstack_alloc (saveable_obstack, len + 2);
if (str[0] == '*') if (str[0] == '*')
*newstr++ = *str++; *newstr++ = *str++;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment