From 83697981d1b7c752e51265b0642807fd92e064b7 Mon Sep 17 00:00:00 2001 From: sof Date: Mon, 16 Mar 1998 20:23:24 +0000 Subject: [PATCH] [project @ 1998-03-16 20:23:24 by sof] x86: Catch fast entry points fallthroughs via %esi and %edi --- ghc/driver/ghc-asm.lprl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ghc/driver/ghc-asm.lprl b/ghc/driver/ghc-asm.lprl index 95aaa7d..6c6ac74 100644 --- a/ghc/driver/ghc-asm.lprl +++ b/ghc/driver/ghc-asm.lprl @@ -994,9 +994,14 @@ sub mangle_asm { } elsif ( $TargetPlatform =~ /^hppa/ ) { $c =~ s/^\s+ldil.*\n\s+ldo.*\n\s+bv.*\n(.*\n)?\s+\.EXIT/$1\t.EXIT/; } elsif ( $TargetPlatform =~ /^i386-/ ) { + # Reg alloc depending, gcc generated code may jump to the fast entry point via + # a number of registers. $c =~ s/^\tmovl \$${T_US}${symb}_fast\d+,\%edx\n\tjmp \*\%edx\n//; $c =~ s/^\tmovl \$${T_US}${symb}_fast\d+,\%ecx\n\tjmp \*\%ecx\n//; $c =~ s/^\tmovl \$${T_US}${symb}_fast\d+,\%eax\n\tjmp \*\%eax\n//; + # The next two only apply if we're not stealing %esi or %edi. + $c =~ s/^\tmovl \$${T_US}${symb}_fast\d+,\%esi\n\tjmp \*\%esi\n// if ($StolenX86Regs < 3); + $c =~ s/^\tmovl \$${T_US}${symb}_fast\d+,\%edi\n\tjmp \*\%edi\n// if ($StolenX86Regs < 4); } elsif ( $TargetPlatform =~ /^mips-/ ) { $c =~ s/^\tjmp \$31,\(\$27\),0\n\t\.align 4\n\t\.end/\t.align 4\n\t.end/; } elsif ( $TargetPlatform =~ /^m68k-/ ) { -- 1.7.10.4