diff options
Diffstat (limited to 'gcc/config/darwin.c')
-rw-r--r-- | gcc/config/darwin.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c index 952539f..59c603f 100644 --- a/gcc/config/darwin.c +++ b/gcc/config/darwin.c @@ -79,6 +79,12 @@ along with GCC; see the file COPYING3. If not see of MACHO_SYMBOL_STATIC for the code that handles @code{static} symbol indirection. */ +/* For darwin >= 9 (OSX 10.5) the linker is capable of making the necessary + branch islands and we no longer need to emit darwin stubs. + However, if we are generating code for earlier systems (or for use in the + kernel) the stubs might still be required, and this will be set true. */ +int darwin_emit_branch_islands = false; + /* Section names. */ section * darwin_sections[NUM_DARWIN_SECTIONS]; @@ -625,6 +631,9 @@ machopic_indirect_data_reference (rtx orig, rtx reg) rtx machopic_indirect_call_target (rtx target) { + if (! darwin_emit_branch_islands) + return target; + if (GET_CODE (target) != MEM) return target; @@ -1888,12 +1897,19 @@ darwin_override_options (void) flag_exceptions = 0; /* No -fnon-call-exceptions data in kexts. */ flag_non_call_exceptions = 0; + /* We still need to emit branch islands for kernel context. */ + darwin_emit_branch_islands = true; } if (flag_var_tracking && strverscmp (darwin_macosx_version_min, "10.5") >= 0 && debug_info_level >= DINFO_LEVEL_NORMAL && debug_hooks->var_location != do_nothing_debug_hooks.var_location) flag_var_tracking_uninit = 1; + + /* It is assumed that branch island stubs are needed for earlier systems. */ + if (darwin_macosx_version_min + && strverscmp (darwin_macosx_version_min, "10.5") < 0) + darwin_emit_branch_islands = true; } /* Add $LDBL128 suffix to long double builtins. */ |