Commit 4f6cd2e6 by Jeff Law

pa.c (hppa_encode_label): New variable "permanent" to where/how memory is…

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
parent 034c1be0
...@@ -4247,15 +4247,26 @@ extern struct obstack *saveable_obstack; ...@@ -4247,15 +4247,26 @@ 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
for function labels if they might be passed to a function for function labels if they might be passed to a function
in a shared library (because shared libraries don't live in code 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 void
hppa_encode_label (sym) hppa_encode_label (sym, permanent)
rtx sym; rtx sym;
int permanent;
{ {
char *str = XSTR (sym, 0); char *str = XSTR (sym, 0);
int len = strlen (str); 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] == '*') if (str[0] == '*')
*newstr++ = *str++; *newstr++ = *str++;
......
...@@ -1511,7 +1511,7 @@ do \ ...@@ -1511,7 +1511,7 @@ do \
_rtl = TREE_CST_RTL (DECL); \ _rtl = TREE_CST_RTL (DECL); \
SYMBOL_REF_FLAG (XEXP (_rtl, 0)) = 1; \ SYMBOL_REF_FLAG (XEXP (_rtl, 0)) = 1; \
if (TREE_CODE (DECL) == FUNCTION_DECL) \ if (TREE_CODE (DECL) == FUNCTION_DECL) \
hppa_encode_label (XEXP (DECL_RTL (DECL), 0));\ hppa_encode_label (XEXP (DECL_RTL (DECL), 0), 0);\
} \ } \
} \ } \
while (0) while (0)
...@@ -1897,7 +1897,7 @@ readonly_data () \ ...@@ -1897,7 +1897,7 @@ readonly_data () \
#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, RTL) \ #define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, RTL) \
do { fputs ("\t.IMPORT ", FILE); \ do { fputs ("\t.IMPORT ", FILE); \
if (!function_label_operand (RTL, VOIDmode)) \ if (!function_label_operand (RTL, VOIDmode)) \
hppa_encode_label (RTL); \ hppa_encode_label (RTL, 1); \
assemble_name (FILE, XSTR ((RTL), 0)); \ assemble_name (FILE, XSTR ((RTL), 0)); \
fputs (",CODE\n", FILE); \ fputs (",CODE\n", FILE); \
} while (0) } while (0)
......
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