diff options
author | Tor Lillqvist <tml@iki.fi> | 2012-04-15 01:36:27 +0200 |
---|---|---|
committer | Tor Lillqvist <tml@iki.fi> | 2012-04-15 11:56:48 +0200 |
commit | 4067e629f7fc9e93b8eb36fffc5fdcc0c3fa8906 (patch) | |
tree | 9ba6aaaf88f8db2d3fd46d865115de6a69c45493 /bridges/source/cpp_uno/gcc3_ios_arm/generate-snippets.pl | |
parent | 83ba7b4e8f67cc3a21fbaf476621af509032ae47 (diff) |
Fix crasher and generate PIC for iOS simulator
Had an embarrassing thinko in the assembler generation for the iOS
simulator, had forgotten the $ for a literal number. While at it, make
also the simulator read-only code snippet data structures
position-independent. Some minor comment improvements. Bridge seems to
work now on simulator.
Diffstat (limited to 'bridges/source/cpp_uno/gcc3_ios_arm/generate-snippets.pl')
-rwxr-xr-x | bridges/source/cpp_uno/gcc3_ios_arm/generate-snippets.pl | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/bridges/source/cpp_uno/gcc3_ios_arm/generate-snippets.pl b/bridges/source/cpp_uno/gcc3_ios_arm/generate-snippets.pl index b6bd0e9ffd7f..2e6d6fefaead 100755 --- a/bridges/source/cpp_uno/gcc3_ios_arm/generate-snippets.pl +++ b/bridges/source/cpp_uno/gcc3_ios_arm/generate-snippets.pl @@ -42,11 +42,13 @@ sub gen_x86 ($$$) { my ($funIndex, $vtableOffset, $executor) = @_; printf ("codeSnippet%08x%d%s:\n", $funIndex, $vtableOffset, $executor); - printf ("\tmovl %#08x, %%eax\n", $funIndex); + printf ("\tmovl \$%#08x, %%eax\n", $funIndex); printf ("\tmovl \$%d, %%edx\n", $vtableOffset); printf ("\tjmp _privateSnippetExecutor%s\n", $executor); } +printf (".text\n"); + printf ("#ifdef __arm\n"); printf ("\t.align 4\n"); @@ -60,6 +62,7 @@ foreach my $funIndex (0 .. $nFunIndexes-1) } printf ("#else\n"); +printf ("\t.align 1, 0x90\n"); foreach my $funIndex (0 .. $nFunIndexes-1) { @@ -96,8 +99,8 @@ foreach my $funIndex (0 .. $nFunIndexes-1) printf ("#else\n"); foreach my $executor ('General', 'Void', 'Hyper', 'Float', 'Double', 'Class') { - printf ("\t.long codeSnippet%08x%d%s\n", $funIndex, $vtableOffset, $executor); - printf ("\t.long codeSnippet%08x%d%s\n", $funIndex|0x80000000, $vtableOffset, $executor); + printf ("\t.long codeSnippet%08x%d%s - _codeSnippets\n", $funIndex, $vtableOffset, $executor); + printf ("\t.long codeSnippet%08x%d%s - _codeSnippets\n", $funIndex|0x80000000, $vtableOffset, $executor); } printf ("#endif\n"); } |