Skip to content

Commit ab5cf59

Browse files
iainscatap
authored andcommitted
Darwin, Arm64 : Disable section anchors for now.
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 gcc-mirror#13. (cherry picked from commit 78ccb496faa54d0e87540b97a540ed63087bc953) Signed-off-by: Kirill A. Korinsky <[email protected]>
1 parent 8452b4a commit ab5cf59

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

gcc/config/aarch64/aarch64.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10984,6 +10984,16 @@ aarch64_anchor_offset (HOST_WIDE_INT offset, HOST_WIDE_INT size,
1098410984
return offset & (~0xfff * size);
1098510985
}
1098610986

10987+
#if TARGET_MACHO
10988+
/* Section anchors are only usable in limited circumstances with the Mach-O
10989+
linker atom model. TODO: figure out when it's worthwhile. */
10990+
static bool
10991+
aarch64_darwin_use_anchor_for_sym_p (const_rtx)
10992+
{
10993+
return false;
10994+
}
10995+
#endif
10996+
1098710997
static rtx
1098810998
aarch64_legitimize_address (rtx x, rtx /* orig_x */, machine_mode mode)
1098910999
{
@@ -24054,6 +24064,11 @@ aarch64_libgcc_floating_mode_supported_p
2405424064
#undef TARGET_MAX_ANCHOR_OFFSET
2405524065
#define TARGET_MAX_ANCHOR_OFFSET 4095
2405624066

24067+
#if TARGET_MACHO
24068+
#undef TARGET_USE_ANCHORS_FOR_SYMBOL_P
24069+
#define TARGET_USE_ANCHORS_FOR_SYMBOL_P aarch64_darwin_use_anchor_for_sym_p
24070+
#endif
24071+
2405724072
#undef TARGET_VECTOR_ALIGNMENT
2405824073
#define TARGET_VECTOR_ALIGNMENT aarch64_simd_vector_alignment
2405924074

0 commit comments

Comments
 (0)