Commit 60593797 by Richard Henderson Committed by Richard Henderson

alpha.c (output_epilog [!VMS]): Don't tag global functions if compiling with…

alpha.c (output_epilog [!VMS]): Don't tag global functions if compiling with -fpic -- we want to be able to...

* alpha.c (output_epilog [!VMS]): Don't tag global functions if
compiling with -fpic -- we want to be able to override symbols
properly.
(alpha_expand_block_move): Fix thinko in last change.
* alpha.h (ASM_OUTPUT_MI_THUNK): New define.
* config/alpha/win-nt.h (ASM_OUTPUT_MI_THUNK): New define.
* config/alpha/vms.h (ASM_OUTPUT_MI_THUNK): New undef.

From-SVN: r17503
parent 5e4aab97
Tue Jan 27 05:05:26 1998 Richard Henderson <rth@cygnus.com>
* alpha.c (output_epilog [!VMS]): Don't tag global functions if
compiling with -fpic -- we want to be able to override symbols
properly.
(alpha_expand_block_move): Fix thinko in last change.
* alpha.h (ASM_OUTPUT_MI_THUNK): New define.
* config/alpha/win-nt.h (ASM_OUTPUT_MI_THUNK): New define.
* config/alpha/vms.h (ASM_OUTPUT_MI_THUNK): New undef.
Tue Jan 27 03:21:23 1998 Richard Henderson <rth@cygnus.com>
* alpha.md (abssf, absdf): Revert last change.
......
......@@ -1616,9 +1616,11 @@ alpha_expand_block_move (operands)
/* Ideally we would do nice things when noticing the addressof. */
if (GET_CODE (XEXP (orig_src, 0)) == ADDRESSOF)
orig_src = copy_addr_to_reg (XEXP (orig_src, 0));
orig_src = change_address (orig_src, GET_MODE (orig_src),
copy_addr_to_reg (XEXP (orig_src, 0)));
if (GET_CODE (XEXP (orig_dst, 0)) == ADDRESSOF)
orig_dst = copy_addr_to_reg (XEXP (orig_dst, 0));
orig_dst = change_address (orig_dst, GET_MODE (orig_dst),
copy_addr_to_reg (XEXP (orig_dst, 0)));
/* Handle a block of contiguous words first. */
......@@ -3400,8 +3402,15 @@ output_epilog (file, size)
}
inside_function = FALSE;
/* Show that we know this function if it is called again. */
SYMBOL_REF_FLAG (XEXP (DECL_RTL (current_function_decl), 0)) = 1;
/* Show that we know this function if it is called again.
Don't do this for global functions in object files destined for a
shared library because the function may be overridden by the application
or other libraries.
??? Is this just ELF? */
if (!flag_pic || !TREE_PUBLIC (current_function_decl))
SYMBOL_REF_FLAG (XEXP (DECL_RTL (current_function_decl), 0)) = 1;
}
#endif /* !OPEN_VMS */
......
......@@ -2030,6 +2030,48 @@ literal_section () \
#define ASM_OPEN_PAREN "("
#define ASM_CLOSE_PAREN ")"
/* Output code to add DELTA to the first argument, and then jump to FUNCTION.
Used for C++ multiple inheritance. */
#define ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION) \
do { \
char *fn_name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (FUNCTION)); \
\
fprintf (FILE, "\t.ent "); \
assemble_name (FILE, alpha_function_name); \
fputc ('\n', FILE); \
ASM_OUTPUT_LABEL (FILE, alpha_function_name); \
fprintf (FILE, "\tldgp $29,0($27)\n"); \
fputc ('$', FILE); \
assemble_name (FILE, alpha_function_name); \
fprintf (FILE, "..ng:\n"); \
fprintf (FILE, "\t.frame $30,0,$26,0\n"); \
fprintf (FILE, "\t.prologue 1\n"); \
\
/* Rely on the assembler to macro expand a large delta. */ \
fprintf (FILE, "\tlda $16,%ld($16)\n", (long)(DELTA)); \
\
if (current_file_function_operand (XEXP (DECL_RTL (FUNCTION), 0))) \
{ \
fprintf (FILE, "\tbr $31,$"); \
assemble_name (FILE, fn_name); \
fprintf (FILE, "..ng\n"); \
} \
else \
{ \
fprintf (FILE, "\tlda $27,"); \
assemble_name (FILE, fn_name); \
fprintf (FILE, "\n\tjmp $31,($27),"); \
assemble_name (FILE, fn_name); \
fputc ('\n', FILE); \
} \
\
fprintf (FILE, "\t.end "); \
assemble_name (FILE, alpha_function_name); \
fputc ('\n', FILE); \
} while (0)
/* Define results of standard character escape sequences. */
#define TARGET_BELL 007
#define TARGET_BS 010
......
......@@ -455,6 +455,9 @@ do { \
( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 12), \
sprintf ((OUTPUT), "%s___%d", (NAME), (LABELNO)))
/* ??? VMS uses different linkage. */
#undef ASM_OUTPUT_MI_THUNK
#undef ASM_SPEC
#undef ASM_FINAL_SPEC
#undef LINK_SPEC
......
......@@ -129,3 +129,40 @@ Boston, MA 02111-1307, USA. */
emit_insn (gen_rtx (UNSPEC_VOLATILE, VOIDmode, \
gen_rtvec (1, const0_rtx), 0)); \
}
/* Output code to add DELTA to the first argument, and then jump to FUNCTION.
Used for C++ multiple inheritance. */
#undef ASM_OUTPUT_MI_THUNK
#define ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION) \
do { \
char *fn_name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (FUNCTION)); \
\
fprintf (FILE, "\t.ent "); \
assemble_name (FILE, alpha_function_name); \
fputc ('\n', FILE); \
ASM_OUTPUT_LABEL (FILE, alpha_function_name); \
fprintf (FILE, "\t.frame $30,0,$26,0\n"); \
fprintf (FILE, "\t.prologue 1\n"); \
\
/* Rely on the assembler to macro expand a large delta. */ \
fprintf (FILE, "\tlda $16,%ld($16)\n", (long)(DELTA)); \
\
if (current_file_function_operand (XEXP (DECL_RTL (FUNCTION), 0))) \
{ \
fprintf (FILE, "\tbr $31,"); \
assemble_name (FILE, fn_name); \
fputc ('\n', FILE); \
} \
else \
{ \
fprintf (FILE, "\tjmp $31,"); \
assemble_name (FILE, fn_name); \
fputc ('\n', FILE); \
} \
\
fprintf (FILE, "\t.end "); \
assemble_name (FILE, alpha_function_name); \
fputc ('\n', FILE); \
} 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