Commit 59177a1b authored by wolfgang's avatar wolfgang
Browse files

[project @ 2005-06-13 00:15:58 by wolfgang]

Darwin/x86:
Fix two causes for crashes:
*) align literals to 16 bytes, because Apple's GCC likes to use
   SSE instructions which require this alignment.
*) In print_doctored, recognize global jumps that masquerade as
   local jumps by going via Lfoo$stub or Lfoo$non_lazy_ptr.
parent 3370ed76
......@@ -332,7 +332,7 @@ sub init_TARGET_STUFF {
$T_DOT_WORD = '\.(long|short|byte|fill|space)';
$T_DOT_GLOBAL = '\.globl';
$T_HDR_toc = "\.toc\n";
$T_HDR_literal = "\t\.const\n\t\.align 2\n";
$T_HDR_literal = "\t\.const\n\t\.align 4\n"; # align for SSE
$T_HDR_misc = "\t\.text\n\t\.align 2\n";
$T_HDR_data = "\t\.data\n\t\.align 2\n";
$T_HDR_rodata = "\t\.const\n\t\.align 2\n";
......@@ -1532,6 +1532,16 @@ sub print_doctored {
# fix _all_ non-local jumps:
if ( $TargetPlatform =~ /^.*-apple-darwin.*/ ) {
# On Darwin, we've got local-looking jumps that are
# actually global (i.e. jumps to Lfoo$stub or via
# Lfoo$non_lazy_ptr), so we fix those first.
# In fact, we just fix everything that contains a dollar
# because false positives don't hurt here.
s/^(\tjmp\s+\*?L.*\$.*\n)/$exit_patch$1/g;
}
s/^\tjmp\s+\*${T_X86_PRE_LLBL_PAT}/\tJMP___SL/go;
s/^\tjmp\s+${T_X86_PRE_LLBL_PAT}/\tJMP___L/go;
......
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