Commit 3a73cd7c by Iain Sandoe Committed by Iain Sandoe

[Darwin, machopic 4/n] Arrange to indirect IVARs when needed.

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.

From-SVN: r276848
parent eb870e5e
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> 2019-10-10 Michael Meissner <meissner@linux.ibm.com>
* config/rs6000/rs6000.c (quad_address_p): Add check for prefixed * config/rs6000/rs6000.c (quad_address_p): Add check for prefixed
......
...@@ -1270,6 +1270,17 @@ darwin_encode_section_info (tree decl, rtx rtl, int first) ...@@ -1270,6 +1270,17 @@ darwin_encode_section_info (tree decl, rtx rtl, int first)
|| (DECL_WEAK (decl) && ! MACHO_SYMBOL_HIDDEN_VIS_P (sym_ref)) || (DECL_WEAK (decl) && ! MACHO_SYMBOL_HIDDEN_VIS_P (sym_ref))
|| lookup_attribute ("weakref", DECL_ATTRIBUTES (decl))) || lookup_attribute ("weakref", DECL_ATTRIBUTES (decl)))
SYMBOL_REF_FLAGS (sym_ref) |= MACHO_SYMBOL_FLAG_MUST_INDIRECT; 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 void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment