[Darwin] There is no need to distinguish PIC/non-PIC symbol stubs.
authorIain Sandoe <iain@sandoe.co.uk>
Tue, 13 Aug 2019 19:03:46 +0000 (19:03 +0000)
committerIain Sandoe <iains@gcc.gnu.org>
Tue, 13 Aug 2019 19:03:46 +0000 (19:03 +0000)
So we can use a single flag for both, and rename this now, before a confusing
name gets into the wild.

gcc/

2019-08-13 Iain Sandoe <iain@sandoe.co.uk>

* config/darwin.c (machopic_indirect_call_target): Rename symbol stub
flag.
(darwin_override_options): Likewise.
* config/darwin.h: Likewise.
* config/darwin.opt: Likewise.
* config/i386/i386.c (output_pic_addr_const): Likewise.
* config/rs6000/darwin.h: Likewise.
* config/rs6000/rs6000.c (rs6000_call_darwin_1): Likewise.
* config/i386/darwin.h (TARGET_MACHO_PICSYM_STUBS): Rename to ...
... this TARGET_MACHO_SYMBOL_STUBS.
(FUNCTION_PROFILER):Likewise.
* config/i386/i386.h: Likewise.

gcc/testsuite/

2019-08-13  Iain Sandoe  <iain@sandoe.co.uk>

* obj-c++.dg/stubify-1.mm: Rename symbol stub option.
* obj-c++.dg/stubify-2.mm: Likewise.
* objc.dg/stubify-1.m: Likewise.
* objc.dg/stubify-2.m: Likewise.

From-SVN: r274397

14 files changed:
gcc/ChangeLog
gcc/config/darwin.c
gcc/config/darwin.h
gcc/config/darwin.opt
gcc/config/i386/darwin.h
gcc/config/i386/i386.c
gcc/config/i386/i386.h
gcc/config/rs6000/darwin.h
gcc/config/rs6000/rs6000.c
gcc/testsuite/ChangeLog
gcc/testsuite/obj-c++.dg/stubify-1.mm
gcc/testsuite/obj-c++.dg/stubify-2.mm
gcc/testsuite/objc.dg/stubify-1.m
gcc/testsuite/objc.dg/stubify-2.m

index e42fcf4698c26b3818139be6e62d35532c16c7eb..070986ec3f75a98416a3eafb66d9264df822645d 100644 (file)
@@ -1,3 +1,18 @@
+2019-08-13 Iain Sandoe <iain@sandoe.co.uk>
+
+       * config/darwin.c (machopic_indirect_call_target): Rename symbol stub
+       flag.
+       (darwin_override_options): Likewise.
+       * config/darwin.h: Likewise.
+       * config/darwin.opt: Likewise.
+       * config/i386/i386.c (output_pic_addr_const): Likewise.
+       * config/rs6000/darwin.h: Likewise.
+       * config/rs6000/rs6000.c (rs6000_call_darwin_1): Likewise.
+       * config/i386/darwin.h (TARGET_MACHO_PICSYM_STUBS): Rename to ...
+       ... this TARGET_MACHO_SYMBOL_STUBS.
+       (FUNCTION_PROFILER):Likewise.
+       * config/i386/i386.h: Likewise.
+
 2019-08-13  Uroš Bizjak  <ubizjak@gmail.com>
 
        * config/i386/i386.md (ix86_expand_vector_extract) <case E_V2SImode>:
index 5ac092583ba112b0b539f55ccb183259952766df..fdd23c49bbe4eb925b29a2643410f2c126de9f8c 100644 (file)
@@ -788,7 +788,7 @@ machopic_indirect_data_reference (rtx orig, rtx reg)
 rtx
 machopic_indirect_call_target (rtx target)
 {
-  if (! darwin_picsymbol_stubs)
+  if (! darwin_symbol_stubs)
     return target;
 
   if (GET_CODE (target) != MEM)
@@ -3268,13 +3268,13 @@ darwin_override_options (void)
      Linkers that don't need stubs, don't need the EH symbol markers either.
   */
 
-  if (!global_options_set.x_darwin_picsymbol_stubs)
+  if (!global_options_set.x_darwin_symbol_stubs)
     {
       if (darwin_target_linker)
        {
          if (strverscmp (darwin_target_linker, MIN_LD64_OMIT_STUBS) < 0)
            {
-             darwin_picsymbol_stubs = true;
+             darwin_symbol_stubs = true;
              ld_needs_eh_markers = true;
            }
        }
@@ -3283,15 +3283,15 @@ darwin_override_options (void)
          /* If we don't know the linker version and we're targeting an old
             system, we know no better than to assume the use of an earlier
             linker.  */
-         darwin_picsymbol_stubs = true;
+         darwin_symbol_stubs = true;
          ld_needs_eh_markers = true;
        }
     }
-  else if (DARWIN_X86 && darwin_picsymbol_stubs && TARGET_64BIT)
+  else if (DARWIN_X86 && darwin_symbol_stubs && TARGET_64BIT)
     {
       inform (input_location,
              "%<-mpic-symbol-stubs%> is not required for 64b code (ignored)");
-      darwin_picsymbol_stubs = false;
+      darwin_symbol_stubs = false;
     }
 
   if (generating_for_darwin_version >= 9)
index ab5ad03f175d4d20061ba8c66f31587a3785b198..93dc638f8bbc657ebca10568c4688887c7f49342 100644 (file)
@@ -1019,7 +1019,7 @@ extern void darwin_driver_init (unsigned int *,struct cl_decoded_option **);
    _tested_ version known to support this so far.  */
 #define MIN_LD64_NO_COAL_SECTS "236.4"
 
-/* From at least version 62.1, ld64 can build PIC indirection stubs as
+/* From at least version 62.1, ld64 can build symbol indirection stubs as
    needed, and there is no need for the compiler to emit them.  */
 #define MIN_LD64_OMIT_STUBS "62.1"
 
index d7e5e7bfcab98297f59d63c2951c01ec046e9ff0..7f5616cbe078fe59d2daf08f26179063b24c0245 100644 (file)
@@ -75,9 +75,9 @@ mone-byte-bool
 Target RejectNegative Report Var(darwin_one_byte_bool)
 Set sizeof(bool) to 1.
 
-mpic-symbol-stubs
-Target Report Var(darwin_picsymbol_stubs) Init(0)
-Force generation of PIC symbol stubs.
+msymbol-stubs
+Target Report Var(darwin_symbol_stubs) Init(0)
+Force generation of external symbol indirection stubs.
 
 ; Some code-gen may be improved / adjusted if the linker is sufficiently modern.
 mtarget-linker=
index 84afedccfb254d3c7dc3e353411947d4e70cd4f6..385d253692063301caf51bd2f976b1183f364ae4 100644 (file)
@@ -91,8 +91,8 @@ along with GCC; see the file COPYING3.  If not see
 #define WCHAR_TYPE_SIZE 32
 
 /* Generate pic symbol indirection stubs if this is true.  */
-#undef TARGET_MACHO_PICSYM_STUBS
-#define TARGET_MACHO_PICSYM_STUBS (darwin_picsymbol_stubs)
+#undef TARGET_MACHO_SYMBOL_STUBS
+#define TARGET_MACHO_SYMBOL_STUBS (darwin_symbol_stubs)
 
 /* For compatibility with OSX system tools, use the new style of pic stub
    if this is set (default).  */
@@ -243,7 +243,7 @@ along with GCC; see the file COPYING3.  If not see
 #undef FUNCTION_PROFILER
 #define FUNCTION_PROFILER(FILE, LABELNO)                               \
   do {                                                                 \
-    if (TARGET_MACHO_PICSYM_STUBS                                      \
+    if (TARGET_MACHO_SYMBOL_STUBS                                      \
        && MACHOPIC_INDIRECT && !TARGET_64BIT)                          \
       {                                                                        \
        const char *name = machopic_mcount_stub_name ();                \
index e278d9c76dfe418ad499571122947d998fa4a83d..d762d3ffe3285330ba792c070928534682a129a3 100644 (file)
@@ -11445,7 +11445,7 @@ output_pic_addr_const (FILE *file, rtx x, int code)
       break;
 
     case SYMBOL_REF:
-      if (TARGET_64BIT || ! TARGET_MACHO_PICSYM_STUBS)
+      if (TARGET_64BIT || ! TARGET_MACHO_SYMBOL_STUBS)
        output_addr_const (file, x);
       else
        {
index fba015c4260c937f68b19203ec1730df7d45cf82..800d7c4c4e34ec71d0715114e87910b71084cc6b 100644 (file)
@@ -647,7 +647,7 @@ extern tree x86_mfence;
 /* Replace MACH-O, ifdefs by in-line tests, where possible. 
    (a) Macros defined in config/i386/darwin.h  */
 #define TARGET_MACHO 0
-#define TARGET_MACHO_PICSYM_STUBS 0
+#define TARGET_MACHO_SYMBOL_STUBS 0
 #define MACHOPIC_ATT_STUB 0
 /* (b) Macros defined in config/darwin.h  */
 #define MACHO_DYNAMIC_NO_PIC_P 0
index ee44236961730c884727e95794c1af476de70f5f..150dc4f4cdd879cc851769a939c3744eca6db733 100644 (file)
@@ -62,9 +62,6 @@
     }                                                  \
   while (0)
 
-/* Generate pic symbol stubs if this is true.  */
-extern int darwin_emit_picsym_stub;
-
 #define SUBTARGET_OVERRIDE_OPTIONS darwin_rs6000_override_options ()
 
 #define C_COMMON_OVERRIDE_OPTIONS do {                                 \
index 4080c82c05f3b6a2dfd6b976d36ad81d666e0153..d1eb08ab199f3aa4adc58c9ab16412d5093ccc5a 100644 (file)
@@ -12943,7 +12943,7 @@ print_operand (FILE *file, rtx x, int code)
        {
          const char *name = XSTR (x, 0);
 #if TARGET_MACHO
-         if (darwin_picsymbol_stubs
+         if (darwin_symbol_stubs
              && MACHOPIC_INDIRECT
              && machopic_classify_symbol (x) == MACHOPIC_UNDEFINED_FUNCTION)
            name = machopic_indirection_name (x, /*stub_p=*/true);
@@ -19481,7 +19481,7 @@ get_prev_label (tree function_name)
   return NULL_TREE;
 }
 
-/* Generate PIC and indirect symbol stubs.  */
+/* Generate external symbol indirection stubs (PIC and non-PIC).  */
 
 void
 machopic_output_stub (FILE *file, const char *symb, const char *stub)
@@ -24523,8 +24523,9 @@ rs6000_call_darwin_1 (rtx value, rtx func_desc, rtx tlsarg,
   if ((cookie_val & CALL_LONG) != 0
       && GET_CODE (func_desc) == SYMBOL_REF)
     {
-      /* FIXME: the longcall opt should not hang off picsymbol stubs.  */
-      if (darwin_picsymbol_stubs && TARGET_32BIT)
+      /* FIXME: the longcall opt should not hang off this flag, it is most
+        likely incorrect for kernel-mode code-generation.  */
+      if (darwin_symbol_stubs && TARGET_32BIT)
        make_island = true; /* Do nothing yet, retain the CALL_LONG flag.  */
       else
        {
index 4514664a751f99503cec0d78334992aade4d29e5..58577092480e2b4baf8d7dd82c45c2d4d7d400d7 100644 (file)
@@ -1,3 +1,10 @@
+2019-08-13  Iain Sandoe  <iain@sandoe.co.uk>
+
+       * obj-c++.dg/stubify-1.mm: Rename symbol stub option.
+       * obj-c++.dg/stubify-2.mm: Likewise.
+       * objc.dg/stubify-1.m: Likewise.
+       * objc.dg/stubify-2.m: Likewise.
+
 2013-08-13  Thomas Koenig  <tkoenig@gcc.gnu.org>
 
        PR fortran/90563
index b82167e5e7c689e67adcf69d4e1e95ab2fa66f0d..a32e282519cd158c49db97c284d02eba2feb6e0f 100644 (file)
@@ -4,7 +4,7 @@
 /* { dg-do compile { target *-*-darwin* } } */
 /* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */
 /* { dg-require-effective-target ilp32 } */
-/* { dg-options "-Os -mdynamic-no-pic -fno-exceptions -mmacosx-version-min=10.4 -mpic-symbol-stubs" } */
+/* { dg-options "-Os -mdynamic-no-pic -fno-exceptions -mmacosx-version-min=10.4 -msymbol-stubs" } */
 
 typedef struct objc_object { } *id ;
 int x = 41 ;
index ee8e342c5f59ea71adc8fac076c9e26616e5d1c7..69fea8def42e896c4c105d5cf49c8b2c53b8f9c5 100644 (file)
@@ -4,7 +4,7 @@
 /* { dg-do compile { target *-*-darwin* } } */
 /* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */
 /* { dg-require-effective-target ilp32 } */
-/* { dg-options "-mdynamic-no-pic -fdump-rtl-jump -mmacosx-version-min=10.4 -mpic-symbol-stubs" } */
+/* { dg-options "-mdynamic-no-pic -fdump-rtl-jump -mmacosx-version-min=10.4 -msymbol-stubs" } */
 
 typedef struct objc_object { } *id ;
 int x = 41 ;
index 1e160a162deb402d378744b10889bd2be1171093..641595ccfe4c62597b422edc831ca27139999fec 100644 (file)
@@ -4,7 +4,7 @@
 /* { dg-do compile { target *-*-darwin* } } */
 /* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */
 /* { dg-require-effective-target ilp32 } */
-/* { dg-options "-Os -mdynamic-no-pic -mmacosx-version-min=10.4 -mpic-symbol-stubs" } */
+/* { dg-options "-Os -mdynamic-no-pic -mmacosx-version-min=10.4 -msymbol-stubs" } */
 
 typedef struct objc_object { } *id ;
 int x = 41 ;
index 1f53b9ccb7251fc4f41226ada9d566d34203d6cd..904ac44b2526cd281d1cdebe5f8019a4d80f8f6c 100644 (file)
@@ -4,7 +4,7 @@
 /* { dg-do compile { target *-*-darwin* } } */
 /* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */
 /* { dg-require-effective-target ilp32 } */
-/* { dg-options "-mdynamic-no-pic -fdump-rtl-jump -mmacosx-version-min=10.4 -mpic-symbol-stubs" } */
+/* { dg-options "-mdynamic-no-pic -fdump-rtl-jump -mmacosx-version-min=10.4 -msymbol-stubs" } */
 
 typedef struct objc_object { } *id ;
 int x = 41 ;