Skip to content

Commit e2a0ebc

Browse files
iainsfxcoudert
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.
1 parent c8d7958 commit e2a0ebc

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
@@ -11403,6 +11403,16 @@ aarch64_anchor_offset (HOST_WIDE_INT offset, HOST_WIDE_INT size,
1140311403
return offset & (~0xfff * size);
1140411404
}
1140511405

11406+
#if TARGET_MACHO
11407+
/* Section anchors are only usable in limited circumstances with the Mach-O
11408+
linker atom model. TODO: figure out when it's worthwhile. */
11409+
static bool
11410+
aarch64_darwin_use_anchor_for_sym_p (const_rtx)
11411+
{
11412+
return false;
11413+
}
11414+
#endif
11415+
1140611416
static rtx
1140711417
aarch64_legitimize_address (rtx x, rtx /* orig_x */, machine_mode mode)
1140811418
{
@@ -26049,6 +26059,11 @@ aarch64_libgcc_floating_mode_supported_p
2604926059
#undef TARGET_MAX_ANCHOR_OFFSET
2605026060
#define TARGET_MAX_ANCHOR_OFFSET 4095
2605126061

26062+
#if TARGET_MACHO
26063+
#undef TARGET_USE_ANCHORS_FOR_SYMBOL_P
26064+
#define TARGET_USE_ANCHORS_FOR_SYMBOL_P aarch64_darwin_use_anchor_for_sym_p
26065+
#endif
26066+
2605226067
#undef TARGET_VECTOR_ALIGNMENT
2605326068
#define TARGET_VECTOR_ALIGNMENT aarch64_simd_vector_alignment
2605426069

0 commit comments

Comments
 (0)