From 07a21f657b3cf514236673a0532296f69e29d629 Mon Sep 17 00:00:00 2001 From: partain <unknown> Date: Tue, 13 Jun 2000 15:35:29 +0000 Subject: [PATCH] [project @ 2000-06-13 15:35:29 by partain] After Andy Gill's late-95 changes --- ghc/driver/mangler/ghc-asm.lprl | 42 ++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/ghc/driver/mangler/ghc-asm.lprl b/ghc/driver/mangler/ghc-asm.lprl index 2643ded5b8d9..4a4834cea494 100644 --- a/ghc/driver/mangler/ghc-asm.lprl +++ b/ghc/driver/mangler/ghc-asm.lprl @@ -1,6 +1,6 @@ %************************************************************************ %* * -\section[Driver-asm-fiddling]{Fiddling with assembler files (iX86)} +\section[Driver-asm-fiddling]{Fiddling with assembler files} %* * %************************************************************************ @@ -13,6 +13,12 @@ stuff to do with the C stack. Any other required tidying up. \end{itemize} +%************************************************************************ +%* * +\subsection{Constants for various architectures} +%* * +%************************************************************************ + \begin{code} sub init_TARGET_STUFF { @@ -58,6 +64,34 @@ sub init_TARGET_STUFF { $T_MOVE_DIRVS = '^\s*(\.align\s+\d+(,0x90)?\n|\.globl\s+\S+\n|\.text\n|\.data\n|\.section\s+.*\n|\.type\s+.*\n|\.Lfe.*\n\t\.size\s+.*\n|\.size\s+.*\n|\.ident.*\n)'; $T_COPY_DIRVS = '\.(globl)'; + $T_hsc_cc_PAT = '\.string.*\)(hsc|cc) (.*)\\\\t(.*)"'; + $T_DOT_WORD = '\.long'; + $T_HDR_string = "\.section\t\.rodata\n"; # or just use .text??? (WDP 95/11) + $T_HDR_misc = "\.text\n\t\.align 16\n"; + $T_HDR_data = "\.data\n\t\.align 4\n"; # ToDo: change align?? + $T_HDR_consist = "\.text\n"; + $T_HDR_closure = "\.data\n\t\.align 4\n"; # ToDo: change align? + $T_HDR_info = "\.text\n\t\.align 16\n"; # NB: requires padding + $T_HDR_entry = "\.text\n"; # no .align so we're right next to _info (arguably wrong...?) + $T_HDR_fast = "\.text\n\t\.align 16\n"; + $T_HDR_vector = "\.text\n\t\.align 16\n"; # NB: requires padding + $T_HDR_direct = "\.text\n\t\.align 16\n"; + + } elsif ( $TargetPlatform =~ /^powerpc-.*/ ) { + + $T_STABBY = 0; # 1 iff .stab things (usually if a.out format) + $T_US = '\.'; # _ if symbols have an underscore on the front + $T_DO_GC = 'PerformGC_wrapper'; + $T_PRE_APP = 'NOT APPLICABLE'; # regexp that says what comes before APP/NO_APP + $T_CONST_LBL = '^LC\.\.(\d+):$'; # regexp for what such a lbl looks like + $T_POST_LBL = ':'; + $T_PRE_LLBL_PAT = '\.L'; + $T_PRE_LLBL = '.L'; + $T_X86_BADJMP = 'NOT APPLICABLE'; + + $T_MOVE_DIRVS = '^\s*(\.align\s+\d+(,0x90)?\n|\.globl\s+\S+\n|\.text\n|\.data\n|\.section\s+.*\n|\.type\s+.*\n|\.Lfe.*\n\t\.size\s+.*\n|\.size\s+.*\n|\.ident.*\n)'; + $T_COPY_DIRVS = '\.(globl)'; + $T_hsc_cc_PAT = '\.string.*\)(hsc|cc) (.*)\\\\t(.*)"'; $T_DOT_WORD = '\.long'; $T_HDR_string = "\.section\t\.rodata\n"; # or just use .text??? (WDP 95/11) @@ -102,6 +136,12 @@ print STDERR "T_HDR_direct: $T_HDR_direct\n"; } \end{code} +%************************************************************************ +%* * +\subsection{Mangle away} +%* * +%************************************************************************ + \begin{code} sub mangle_asm { local($in_asmf, $out_asmf) = @_; -- GitLab