aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/pa/pa.c
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1995-06-05 08:22:02 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1995-06-05 08:22:02 -0400
commit9d2a6a8e21eccf286a717f144c28b1bc821d2929 (patch)
treedbf03f138fb04dfb461d5eebecfb80244dfae560 /gcc/config/pa/pa.c
parent549fd8ff37d73570f01d6d89ecb6bdc512dc8fdf (diff)
downloadgcc-9d2a6a8e21eccf286a717f144c28b1bc821d2929.zip
gcc-9d2a6a8e21eccf286a717f144c28b1bc821d2929.tar.gz
gcc-9d2a6a8e21eccf286a717f144c28b1bc821d2929.tar.bz2
(hppa_encode_label): Allocate stuff on permanent_obstack rather than
via malloc. From-SVN: r9876
Diffstat (limited to 'gcc/config/pa/pa.c')
-rw-r--r--gcc/config/pa/pa.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index b402396..f1dfae3 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -4242,6 +4242,7 @@ output_call (insn, call_dest, return_pointer)
return "";
}
+extern struct obstack permanent_obstack;
extern struct obstack *saveable_obstack;
/* In HPUX 8.0's shared library scheme, special relocations are needed
@@ -4251,8 +4252,8 @@ extern struct obstack *saveable_obstack;
For reasons too disgusting to describe storage for the new name
is allocated either on the saveable_obstack (released at function
- exit) or via malloc for things that can never change (libcall names
- for example). */
+ exit) or on the permanent_obstack for things that can never change
+ (libcall names for example). */
void
hppa_encode_label (sym, permanent)
@@ -4263,10 +4264,8 @@ hppa_encode_label (sym, permanent)
int len = strlen (str);
char *newstr;
- if (permanent)
- newstr = malloc (len + 2);
- else
- newstr = obstack_alloc (saveable_obstack, len + 2);
+ newstr = obstack_alloc ((permanent ? &permanent_obstack : saveable_obstack),
+ len + 2);
if (str[0] == '*')
*newstr++ = *str++;