Skip to content

Commit e3bdd2e

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 89d25e5 commit e3bdd2e

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
@@ -11090,6 +11090,16 @@ aarch64_anchor_offset (HOST_WIDE_INT offset, HOST_WIDE_INT size,
1109011090
return offset & (~0xfff * size);
1109111091
}
1109211092

11093+
#if TARGET_MACHO
11094+
/* Section anchors are only usable in limited circumstances with the Mach-O
11095+
linker atom model. TODO: figure out when it's worthwhile. */
11096+
static bool
11097+
aarch64_darwin_use_anchor_for_sym_p (const_rtx)
11098+
{
11099+
return false;
11100+
}
11101+
#endif
11102+
1109311103
static rtx
1109411104
aarch64_legitimize_address (rtx x, rtx /* orig_x */, machine_mode mode)
1109511105
{
@@ -24220,6 +24230,11 @@ aarch64_libgcc_floating_mode_supported_p
2422024230
#undef TARGET_MAX_ANCHOR_OFFSET
2422124231
#define TARGET_MAX_ANCHOR_OFFSET 4095
2422224232

24233+
#if TARGET_MACHO
24234+
#undef TARGET_USE_ANCHORS_FOR_SYMBOL_P
24235+
#define TARGET_USE_ANCHORS_FOR_SYMBOL_P aarch64_darwin_use_anchor_for_sym_p
24236+
#endif
24237+
2422324238
#undef TARGET_VECTOR_ALIGNMENT
2422424239
#define TARGET_VECTOR_ALIGNMENT aarch64_simd_vector_alignment
2422524240

0 commit comments

Comments
 (0)