+2020-03-22 Iain Sandoe <iain@sandoe.co.uk>
+
+ * config/i386/darwin.h (JUMP_TABLES_IN_TEXT_SECTION): Remove
+ references to Darwin.
+ * config/i386/i386.h (JUMP_TABLES_IN_TEXT_SECTION): Define this
+ unconditionally and comment on why.
+
2020-03-21 Iain Sandoe <iain@sandoe.co.uk>
* config/darwin.c (darwin_mergeable_constant_section): Collect
#undef TARGET_ASM_OUTPUT_IDENT
#define TARGET_ASM_OUTPUT_IDENT default_asm_output_ident_directive
+/* We always want jump tables in the text section:
+ * for PIC code, we need the subtracted symbol to be defined at
+ assembly-time.
+ * for mdynamic-no-pic, we cannot support jump tables in the .const
+ section for weak functions, this looks to ld64 like direct access
+ to the weak symbol from an anonymous atom. */
+
+#undef JUMP_TABLES_IN_TEXT_SECTION
+#define JUMP_TABLES_IN_TEXT_SECTION 1
+
/* Darwin profiling -- call mcount.
If we need a stub, then we unconditionally mark it as used. */
#undef FUNCTION_PROFILER
/* Under some conditions we need jump tables in the text section,
because the assembler cannot handle label differences between
- sections. This is the case for x86_64 on Mach-O for example. */
+ sections. */
#define JUMP_TABLES_IN_TEXT_SECTION \
- (flag_pic && ((TARGET_MACHO && TARGET_64BIT) \
- || (!TARGET_64BIT && !HAVE_AS_GOTOFF_IN_DATA)))
+ (flag_pic && !(TARGET_64BIT || HAVE_AS_GOTOFF_IN_DATA))
/* Switch to init or fini section via SECTION_OP, emit a call to FUNC,
and switch back. For x86 we do this only to save a few bytes that