diff options
author | Jeff Law <law@gcc.gnu.org> | 1995-05-20 23:05:25 -0600 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 1995-05-20 23:05:25 -0600 |
commit | 4f6cd2e6422973675a9ac0468f7a4af1eb875db5 (patch) | |
tree | ef93cdf2d8d124d9a7eab83b8c32ee00dad818ee /gcc/config/pa/pa.c | |
parent | 034c1be0fdf231cecab4424e638060370b0cd7a1 (diff) | |
download | gcc-4f6cd2e6422973675a9ac0468f7a4af1eb875db5.zip gcc-4f6cd2e6422973675a9ac0468f7a4af1eb875db5.tar.gz gcc-4f6cd2e6422973675a9ac0468f7a4af1eb875db5.tar.bz2 |
pa.c (hppa_encode_label): New variable "permanent" to where/how memory is allocated for the new label.
* pa.c (hppa_encode_label): New variable "permanent" to
where/how memory is allocated for the new label. All
callers changed.
From-SVN: r9759
Diffstat (limited to 'gcc/config/pa/pa.c')
-rw-r--r-- | gcc/config/pa/pa.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c index be95729..b402396 100644 --- a/gcc/config/pa/pa.c +++ b/gcc/config/pa/pa.c @@ -4247,15 +4247,26 @@ extern struct obstack *saveable_obstack; /* In HPUX 8.0's shared library scheme, special relocations are needed for function labels if they might be passed to a function in a shared library (because shared libraries don't live in code - space), and special magic is needed to construct their address. */ + space), and special magic is needed to construct their address. + + 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). */ void -hppa_encode_label (sym) +hppa_encode_label (sym, permanent) rtx sym; + int permanent; { char *str = XSTR (sym, 0); int len = strlen (str); - char *newstr = obstack_alloc (saveable_obstack, len + 2) ; + char *newstr; + + if (permanent) + newstr = malloc (len + 2); + else + newstr = obstack_alloc (saveable_obstack, len + 2); if (str[0] == '*') *newstr++ = *str++; |