Objective C V2 (m64) IVAR offset refs from Apple GCC-4.x have an indirection
for m64 code on PPC (which is the only 64b user for Mach-O PIC). Apple GCC
4.x places the indirections in the .data section, however this seems to have
been unintentional - and we are placing the indirections in the non-lazy
symbol pointers section.
gcc/ChangeLog:
2019-10-10 Iain Sandoe <iain@sandoe.co.uk>
* config/darwin.c: Lookup Objective C metadata and force indirection
for IVAR refs.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@276848
138bc75d-0d04-0410-961f-
82ee72b054a4
+2019-10-10 Iain Sandoe <iain@sandoe.co.uk>
+
+ * config/darwin.c: Lookup Objective C metadata and force indirection
+ for IVAR refs.
+
2019-10-10 Michael Meissner <meissner@linux.ibm.com>
* config/rs6000/rs6000.c (quad_address_p): Add check for prefixed
|| (DECL_WEAK (decl) && ! MACHO_SYMBOL_HIDDEN_VIS_P (sym_ref))
|| lookup_attribute ("weakref", DECL_ATTRIBUTES (decl)))
SYMBOL_REF_FLAGS (sym_ref) |= MACHO_SYMBOL_FLAG_MUST_INDIRECT;
+
+#if DARWIN_PPC
+ /* Objective C V2 (m64) IVAR offset refs from Apple GCC-4.x have an
+ indirection for m64 code on PPC. Historically, these indirections
+ also appear in the .data section. */
+ tree o2meta = lookup_attribute ("OBJC2META", DECL_ATTRIBUTES (decl));
+ o2meta = o2meta ? TREE_VALUE (o2meta) : NULL_TREE;
+
+ if (o2meta && strncmp (IDENTIFIER_POINTER (o2meta), "V2_IVRF",7) == 0)
+ SYMBOL_REF_FLAGS (sym_ref) |= MACHO_SYMBOL_FLAG_MUST_INDIRECT;
+#endif
}
void