Skip to content

Commit

Permalink
Darwin, Arm64 : Disable section anchors for now.
Browse files Browse the repository at this point in the history
Section anchors are tricky with the ld64 atom model.  It is possible
to make them work in a sub-set of circumstances.

TODO: determine those cases and apply fixes to deal with them.

This fixes issue #13.
  • Loading branch information
iains committed Sep 12, 2020
1 parent ea3f928 commit ca70c56
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions gcc/config/aarch64/aarch64.c
Original file line number Diff line number Diff line change
Expand Up @@ -11027,6 +11027,16 @@ aarch64_anchor_offset (HOST_WIDE_INT offset, HOST_WIDE_INT size,
return offset & (~0xfff * size);
}

#if TARGET_MACHO
/* Section anchors are only usable in limited circumstances with the Mach-O
linker atom model. TODO: figure out when it's worthwhile. */
static bool
aarch64_darwin_use_anchor_for_sym_p (const_rtx)
{
return false;
}
#endif

static rtx
aarch64_legitimize_address (rtx x, rtx /* orig_x */, machine_mode mode)
{
Expand Down Expand Up @@ -24188,6 +24198,11 @@ aarch64_libgcc_floating_mode_supported_p
#undef TARGET_MAX_ANCHOR_OFFSET
#define TARGET_MAX_ANCHOR_OFFSET 4095

#if TARGET_MACHO
#undef TARGET_USE_ANCHORS_FOR_SYMBOL_P
#define TARGET_USE_ANCHORS_FOR_SYMBOL_P aarch64_darwin_use_anchor_for_sym_p
#endif

#undef TARGET_VECTOR_ALIGNMENT
#define TARGET_VECTOR_ALIGNMENT aarch64_simd_vector_alignment

Expand Down

0 comments on commit ca70c56

Please sign in to comment.