[Darwin, machopic 8/n] Back out part of PR71767 fix.
authorIain Sandoe <iain@sandoe.co.uk>
Sun, 13 Oct 2019 18:58:50 +0000 (18:58 +0000)
committerIain Sandoe <iains@gcc.gnu.org>
Sun, 13 Oct 2019 18:58:50 +0000 (18:58 +0000)
We applied a conservative, but fairly large, hammer to fix PR71767.
However, ideally, we want minimise the number of symbols visible to
ld64 and to match the cases emitted by clang (since that's what ld64
is expecting).  Now we've improved the handling of indirections, we
can make the indirection symbols local when they are in the regular
non-lazy symbol pointers section.  We will continue to make any
indirections in the data section visible (since right now we have no
way to track if a given symbol follows a weak global).
This change makes no difference to handling of labels for constants
(to be revised in a future patch).

There's a mechanical change to a number of tests (allowing 'l' or 'L'
as the indirection symbol prefix).

gcc/ChangeLog:

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

* config/darwin.c (machopic_indirection_name): Rework the
function to emit linker-visible symbols only for indirections
in the data section.  Clean up the code and update comments.

gcc/testsuite/ChangeLog:

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

* gcc.target/i386/indirect-thunk-1.c: Allow 'l' or 'L' in
indirection label prefix, for Darwin.
* gcc.target/i386/indirect-thunk-2.c: Likewise.
* gcc.target/i386/indirect-thunk-3.c: Likewise.
* gcc.target/i386/indirect-thunk-4.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-1.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-2.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-3.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-4.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-5.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-6.c: Likewise.
* gcc.target/i386/indirect-thunk-extern-1.c: Likewise.
* gcc.target/i386/indirect-thunk-extern-2.c: Likewise.
* gcc.target/i386/indirect-thunk-extern-3.c: Likewise.
* gcc.target/i386/indirect-thunk-extern-4.c: Likewise.
* gcc.target/i386/indirect-thunk-inline-1.c: Likewise.
* gcc.target/i386/indirect-thunk-inline-2.c: Likewise.
* gcc.target/i386/indirect-thunk-inline-3.c: Likewise.
* gcc.target/i386/indirect-thunk-inline-4.c: Likewise.
* gcc.target/i386/pr32219-2.c: Likewise.
* gcc.target/i386/pr32219-3.c: Likewise.
* gcc.target/i386/pr32219-4.c: Likewise.
* gcc.target/i386/pr32219-7.c: Likewise.
* gcc.target/i386/pr32219-8.c: Likewise.
* gcc.target/i386/ret-thunk-14.c: Likewise.
* gcc.target/i386/ret-thunk-15.c: Likewise.
* gcc.target/i386/ret-thunk-9.c: Likewise.

From-SVN: r276943

29 files changed:
gcc/ChangeLog
gcc/config/darwin.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/indirect-thunk-1.c
gcc/testsuite/gcc.target/i386/indirect-thunk-2.c
gcc/testsuite/gcc.target/i386/indirect-thunk-3.c
gcc/testsuite/gcc.target/i386/indirect-thunk-4.c
gcc/testsuite/gcc.target/i386/indirect-thunk-attr-1.c
gcc/testsuite/gcc.target/i386/indirect-thunk-attr-2.c
gcc/testsuite/gcc.target/i386/indirect-thunk-attr-3.c
gcc/testsuite/gcc.target/i386/indirect-thunk-attr-4.c
gcc/testsuite/gcc.target/i386/indirect-thunk-attr-5.c
gcc/testsuite/gcc.target/i386/indirect-thunk-attr-6.c
gcc/testsuite/gcc.target/i386/indirect-thunk-extern-1.c
gcc/testsuite/gcc.target/i386/indirect-thunk-extern-2.c
gcc/testsuite/gcc.target/i386/indirect-thunk-extern-3.c
gcc/testsuite/gcc.target/i386/indirect-thunk-extern-4.c
gcc/testsuite/gcc.target/i386/indirect-thunk-inline-1.c
gcc/testsuite/gcc.target/i386/indirect-thunk-inline-2.c
gcc/testsuite/gcc.target/i386/indirect-thunk-inline-3.c
gcc/testsuite/gcc.target/i386/indirect-thunk-inline-4.c
gcc/testsuite/gcc.target/i386/pr32219-2.c
gcc/testsuite/gcc.target/i386/pr32219-3.c
gcc/testsuite/gcc.target/i386/pr32219-4.c
gcc/testsuite/gcc.target/i386/pr32219-7.c
gcc/testsuite/gcc.target/i386/pr32219-8.c
gcc/testsuite/gcc.target/i386/ret-thunk-14.c
gcc/testsuite/gcc.target/i386/ret-thunk-15.c
gcc/testsuite/gcc.target/i386/ret-thunk-9.c

index c72f4d86729c34d21efad8477542cf008293dc8e..61c8a0f14826ce05b651afdfcc5e52c09c31708d 100644 (file)
@@ -1,3 +1,9 @@
+2019-10-13  Iain Sandoe  <iain@sandoe.co.uk>
+
+       * config/darwin.c (machopic_indirection_name): Rework the
+       function to emit linker-visible symbols only for indirections
+       in the data section.  Clean up the code and update comments.
+
 2019-10-13  Iain Sandoe  <iain@sandoe.co.uk>
 
        * config/darwin.c (machopic_indirect_data_reference): Remove
index eefffee55f634e16ab0e1e7ab65dd8cd99a9f0ad..8635fc2b441caba4ffecc27c88915d0705d82b10 100644 (file)
@@ -495,7 +495,7 @@ indirection_hasher::equal (machopic_indirection *s, const char *k)
 /* Return the name of the non-lazy pointer (if STUB_P is false) or
    stub (if STUB_B is true) corresponding to the given name.
 
-  If we have a situation like:
+  PR71767 - If we have a situation like:
 
 global_weak_symbol:
   ....
@@ -504,36 +504,22 @@ Lnon_weak_local:
 
   ld64 will be unable to split this into two atoms (because the "L" makes
   the second symbol 'invisible').  This means that legitimate direct accesses
-  to the second symbol will appear to be non-allowed direct accesses to an
-  atom of type weak, global which are not allowed.
+  to the second symbol will appear to be direct accesses to an atom of type
+  weak, global which are not allowed.
 
-  To avoid this, we make the indirections have a leading 'l' (lower-case L)
-  which has a special meaning: linker can see this and use it to determine
-  atoms, but it is not placed into the final symbol table.
-
-  The implementation here is somewhat heavy-handed in that it will also mark
-  indirections to the __IMPORT,__pointers section the same way which is
-  really unnecessary, since ld64 _can_ split those into atoms as they are
-  fixed size.  FIXME: determine if this is a penalty worth extra code to
-  fix.
+  To avoid this, we make any data-section indirections have a leading 'l'
+  (lower-case L) which has a special meaning: linker can see this and use
+  it to determine  atoms, but it is not placed into the final symbol table.
 
+  Symbols in the non-lazy symbol pointers section (or stubs) do not have this
+  problem because ld64 already knows the size of each entry.
 */
 
 const char *
 machopic_indirection_name (rtx sym_ref, bool stub_p)
 {
-  char *buffer;
   const char *name = XSTR (sym_ref, 0);
-  size_t namelen = strlen (name);
-  machopic_indirection *p;
-  bool needs_quotes;
-  const char *suffix;
-  char L_or_l = 'L';
-  const char *prefix = user_label_prefix;
-  const char *quote = "";
-  tree id;
-
-  id = maybe_get_identifier (name);
+  tree id = maybe_get_identifier (name);
   if (id)
     {
       tree id_orig = id;
@@ -541,43 +527,47 @@ machopic_indirection_name (rtx sym_ref, bool stub_p)
       while (IDENTIFIER_TRANSPARENT_ALIAS (id))
        id = TREE_CHAIN (id);
       if (id != id_orig)
-       {
-         name = IDENTIFIER_POINTER (id);
-         namelen = strlen (name);
-       }
+       name = IDENTIFIER_POINTER (id);
     }
 
+  const char *prefix = user_label_prefix;
+  /* If we are emitting the label 'verbatim' then omit the U_L_P and count
+     the name without the leading '*'.  */
   if (name[0] == '*')
     {
       prefix = "";
       ++name;
-      --namelen;
     }
 
-  needs_quotes = name_needs_quotes (name);
-  if (needs_quotes)
-    {
-      quote = "\"";
-    }
-
-  if (stub_p)
-    suffix = STUB_SUFFIX;
-  else
-    {
-      suffix = NON_LAZY_POINTER_SUFFIX;
-      /* Let the linker see this.  */
-      L_or_l = 'l';
-    }
-
-  buffer = XALLOCAVEC (char, 2  /* strlen ("&L") or ("&l") */
-                  + strlen (prefix)
-                  + namelen
-                  + strlen (suffix)
-                  + 2 * strlen (quote)
-                  + 1 /* '\0' */);
+  /* Here we are undoing a number of causes that placed some indirections
+     (apparently erroneously) into the .data section.  Specifically, some
+     symbols that are ABI mandated indirections and some hidden symbols
+     were being placed there - which cause difficulties with later
+     versions of ld64.  Iff (after these checks) some symbol still gets an
+     indirection in the data section, we want to adjust the indirection
+     name to be linker visible to deal with PR71767 (notes above).  */
+  bool nlsp_in_data_section =
+       ! MACHO_SYMBOL_MUST_INDIRECT_P (sym_ref)
+    && ! MACHO_SYMBOL_HIDDEN_VIS_P (sym_ref)
+    && (machopic_symbol_defined_p (sym_ref) || SYMBOL_REF_LOCAL_P (sym_ref))
+    && ! indirect_data (sym_ref);
+
+  const char *suffix = stub_p ? STUB_SUFFIX : NON_LAZY_POINTER_SUFFIX;
+  /* If the indirection is in the data section, let the linker see it.  */
+  char L_or_l = (!stub_p && nlsp_in_data_section) ? 'l' : 'L';
+  /* We have mangled symbols with spaces and punctuation which typically
+     need surrounding in quotes for the assembler to consume them.  */
+  const char *quote = name_needs_quotes (name) ? "\"" : "";
+  char *buffer = XALLOCAVEC (char, 2  /* strlen ("&L") or ("&l") */
+                            + strlen (prefix)
+                            + strlen (name)
+                            + strlen (suffix)
+                            + 2 * strlen (quote)
+                            + 1 /* '\0' */);
 
   /* Construct the name of the non-lazy pointer or stub.  */
-  sprintf (buffer, "&%s%c%s%s%s%s", quote, L_or_l, prefix, name, suffix, quote);
+  sprintf (buffer, "&%s%c%s%s%s%s", quote, L_or_l, prefix, name,
+          suffix, quote);
 
   if (!machopic_indirections)
     machopic_indirections = hash_table<indirection_hasher>::create_ggc (37);
@@ -586,10 +576,9 @@ machopic_indirection_name (rtx sym_ref, bool stub_p)
     = machopic_indirections->find_slot_with_hash (buffer,
                                                  htab_hash_string (buffer),
                                                  INSERT);
+  machopic_indirection *p;
   if (*slot)
-    {
-      p = *slot;
-    }
+    p = *slot;
   else
     {
       p = ggc_alloc<machopic_indirection> ();
@@ -597,18 +586,7 @@ machopic_indirection_name (rtx sym_ref, bool stub_p)
       p->ptr_name = xstrdup (buffer);
       p->stub_p = stub_p;
       p->used = false;
-      /* Here we are undoing a number of causes that placed some indirections
-        (apparently erroneously) into the .data section.  Specifically, some
-        symbols that are ABI mandated indirections and some hidden symbols
-        were being placed there - which cause difficulties with later
-        versions of ld64.
-      */
-      p->nlsp_in_data_section =
-          ! MACHO_SYMBOL_MUST_INDIRECT_P (sym_ref)
-       && ! MACHO_SYMBOL_HIDDEN_VIS_P (sym_ref)
-       && (machopic_symbol_defined_p (sym_ref)
-           || SYMBOL_REF_LOCAL_P (sym_ref))
-       && ! indirect_data (sym_ref);
+      p->nlsp_in_data_section = nlsp_in_data_section;
       *slot = p;
     }
 
index eca8cc6e44dabde8490642c7df9ecb225ec34666..c14075b80c3d43f6915f04c1de791fb52986c5e1 100644 (file)
@@ -1,3 +1,33 @@
+2019-10-13  Iain Sandoe  <iain@sandoe.co.uk>
+
+       * gcc.target/i386/indirect-thunk-1.c: Allow 'l' or 'L' in
+       indirection label prefix, for Darwin.
+       * gcc.target/i386/indirect-thunk-2.c: Likewise.
+       * gcc.target/i386/indirect-thunk-3.c: Likewise.
+       * gcc.target/i386/indirect-thunk-4.c: Likewise.
+       * gcc.target/i386/indirect-thunk-attr-1.c: Likewise.
+       * gcc.target/i386/indirect-thunk-attr-2.c: Likewise.
+       * gcc.target/i386/indirect-thunk-attr-3.c: Likewise.
+       * gcc.target/i386/indirect-thunk-attr-4.c: Likewise.
+       * gcc.target/i386/indirect-thunk-attr-5.c: Likewise.
+       * gcc.target/i386/indirect-thunk-attr-6.c: Likewise.
+       * gcc.target/i386/indirect-thunk-extern-1.c: Likewise.
+       * gcc.target/i386/indirect-thunk-extern-2.c: Likewise.
+       * gcc.target/i386/indirect-thunk-extern-3.c: Likewise.
+       * gcc.target/i386/indirect-thunk-extern-4.c: Likewise.
+       * gcc.target/i386/indirect-thunk-inline-1.c: Likewise.
+       * gcc.target/i386/indirect-thunk-inline-2.c: Likewise.
+       * gcc.target/i386/indirect-thunk-inline-3.c: Likewise.
+       * gcc.target/i386/indirect-thunk-inline-4.c: Likewise.
+       * gcc.target/i386/pr32219-2.c: Likewise.
+       * gcc.target/i386/pr32219-3.c: Likewise.
+       * gcc.target/i386/pr32219-4.c: Likewise.
+       * gcc.target/i386/pr32219-7.c: Likewise.
+       * gcc.target/i386/pr32219-8.c: Likewise.
+       * gcc.target/i386/ret-thunk-14.c: Likewise.
+       * gcc.target/i386/ret-thunk-15.c: Likewise.
+       * gcc.target/i386/ret-thunk-9.c: Likewise.
+
 2019-10-13  Damian Rouson  <damain@sourceryinstitue.org>
 
        PR fortran/91513
index 052d24dabdfadbde080d30f66ea4f71bc8b41cc2..e2914a8333cc7cb52800c78f1001c57f346fe2a5 100644 (file)
@@ -14,7 +14,7 @@ male_indirect_jump (long offset)
 
 /* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*dispatch" { target *-*-linux* } } } */
 /* { dg-final { scan-assembler {movq[ \t]*_dispatch} { target { lp64 && *-*-darwin* } } } } */
-/* { dg-final { scan-assembler {movl[ \t]*l_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
+/* { dg-final { scan-assembler {movl[ \t]*[Ll]_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
 /* { dg-final { scan-assembler "jmp\[ \t\]*_?__x86_indirect_thunk_(r|e)ax" } } */
 /* { dg-final { scan-assembler {jmp[ \t]*\.?LIND} } } */
 /* { dg-final { scan-assembler {call[ \t]*\.?LIND} } } */
index 2cfbd728b4b779a3da4ede9866fd3f7127691545..d2b7c74b1434fb966b1484a29fd7efd0955010c7 100644 (file)
@@ -14,7 +14,7 @@ male_indirect_jump (long offset)
 
 /* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*dispatch" { target *-*-linux* } } } */
 /* { dg-final { scan-assembler {movq[ \t]*_dispatch} { target { lp64 && *-*-darwin* } } } } */
-/* { dg-final { scan-assembler {movl[ \t]*l_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
+/* { dg-final { scan-assembler {movl[ \t]*[Ll]_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
 /* { dg-final { scan-assembler "jmp\[ \t\]*_?__x86_indirect_thunk_(r|e)ax" } } */
 /* { dg-final { scan-assembler {jmp[ \t]*\.?LIND} } } */
 /* { dg-final { scan-assembler {call[ \t]*\.?LIND} } } */
index 59bb08613b797abc98ccae62564ba920fa4bbd09..129fb2125f014a49c62003b964d1201789c737c1 100644 (file)
@@ -15,7 +15,7 @@ male_indirect_jump (long offset)
 
 /* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*dispatch" { target *-*-linux* } } } */
 /* { dg-final { scan-assembler {movq[ \t]*_dispatch} { target { lp64 && *-*-darwin* } } } } */
-/* { dg-final { scan-assembler {movl[ \t]*l_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
+/* { dg-final { scan-assembler {movl[ \t]*[Ll]_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
 /* { dg-final { scan-assembler "call\[ \t\]*_?__x86_indirect_thunk_(r|e)ax" } } */
 /* { dg-final { scan-assembler {jmp[ \t]*\.?LIND} } } */
 /* { dg-final { scan-assembler {call[ \t]*\.?LIND} } } */
index 59640fab8f1203a486b11d833684162ebe3320e9..01996fb029f87c4a8a4342cc2ba8fa06dedfa46d 100644 (file)
@@ -15,7 +15,7 @@ male_indirect_jump (long offset)
 
 /* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*dispatch" { target *-*-linux* } } } */
 /* { dg-final { scan-assembler {movq[ \t]*_dispatch} { target { lp64 && *-*-darwin* } } } } */
-/* { dg-final { scan-assembler {movl[ \t]*l_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
+/* { dg-final { scan-assembler {movl[ \t]*[Ll]_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
 /* { dg-final { scan-assembler "call\[ \t\]*_?__x86_indirect_thunk_(r|e)ax" } } */
 /* { dg-final { scan-assembler {jmp[ \t]*\.?LIND} } } */
 /* { dg-final { scan-assembler {call[ \t]*\.?LIND} } } */
index 8620bf1d8361c479c483c8e6d69c76e195b92e7d..1493e18243bf4b103d3a2a059562ed845f3d5e4b 100644 (file)
@@ -17,7 +17,7 @@ male_indirect_jump (long offset)
 
 /* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*dispatch" { target *-*-linux* } } } */
 /* { dg-final { scan-assembler {movq[ \t]*_dispatch} { target { lp64 && *-*-darwin* } } } } */
-/* { dg-final { scan-assembler {movl[ \t]*l_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
+/* { dg-final { scan-assembler {movl[ \t]*[Ll]_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
 /* { dg-final { scan-assembler "jmp\[ \t\]*_?__x86_indirect_thunk_(r|e)ax" } } */
 /* { dg-final { scan-assembler {jmp[ \t]*\.?LIND} } } */
 /* { dg-final { scan-assembler {call[ \t]*\.?LIND} } } */
index 42e8341696570bd9edf93aada556cf8ccf281c7d..3ddd4980b69162e962e351d1c889be1a8bf23235 100644 (file)
@@ -15,7 +15,7 @@ male_indirect_jump (long offset)
 
 /* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*dispatch" { target *-*-linux* } } } */
 /* { dg-final { scan-assembler {movq[ \t]*_dispatch} { target { lp64 && *-*-darwin* } } } } */
-/* { dg-final { scan-assembler {movl[ \t]*l_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
+/* { dg-final { scan-assembler {movl[ \t]*[Ll]_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
 /* { dg-final { scan-assembler "jmp\[ \t\]*_?__x86_indirect_thunk_(r|e)ax" } } */
 /* { dg-final { scan-assembler {jmp[ \t]*\.?LIND} } } */
 /* { dg-final { scan-assembler {call[ \t]*\.?LIND} } } */
index 6a9c51337d9a9bbe998b8519890795cff57df439..43d5f95b4fb4cfdb48c4c44ccae04f4f89d54966 100644 (file)
@@ -17,7 +17,7 @@ male_indirect_jump (long offset)
 
 /* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*dispatch" { target *-*-linux* } } } */
 /* { dg-final { scan-assembler {movq[ \t]*_dispatch} { target { lp64 && *-*-darwin* } } } } */
-/* { dg-final { scan-assembler {movl[ \t]*l_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
+/* { dg-final { scan-assembler {movl[ \t]*[Ll]_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
 /* { dg-final { scan-assembler-times {jmp[ \t]*\.?LIND} 2 } } */
 /* { dg-final { scan-assembler-times {call[ \t]*\.?LIND} 2 } } */
 /* { dg-final { scan-assembler {\tpause} } } */
index 85ec57b5a8d31c02bb2fa5e67c8029e360065368..bf62636c63cc7849d6525063251992e4c4842928 100644 (file)
@@ -16,7 +16,7 @@ male_indirect_jump (long offset)
 
 /* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*dispatch" { target *-*-linux* } } } */
 /* { dg-final { scan-assembler {movq[ \t]*_dispatch} { target { lp64 && *-*-darwin* } } } } */
-/* { dg-final { scan-assembler {movl[ \t]*l_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
+/* { dg-final { scan-assembler {movl[ \t]*[Ll]_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
 /* { dg-final { scan-assembler-times {jmp[ \t]*\.?LIND} 2 } } */
 /* { dg-final { scan-assembler-times {call[ \t]*\.?LIND} 2 } } */
 /* { dg-final { scan-assembler {\tpause} } } */
index db1d8fb9979201781cd837e7017a1fe4cfa441b5..27ba82932e4e2978f39975fa404c4bf9d9ae9643 100644 (file)
@@ -17,7 +17,7 @@ male_indirect_jump (long offset)
 
 /* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*dispatch" { target *-*-linux* } } } */
 /* { dg-final { scan-assembler {movq[ \t]*_dispatch} { target { lp64 && *-*-darwin* } } } } */
-/* { dg-final { scan-assembler {movl[ \t]*l_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
+/* { dg-final { scan-assembler {movl[ \t]*[Ll]_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
 /* { dg-final { scan-assembler "call\[ \t\]*_?__x86_indirect_thunk_(r|e)ax" } } */
 /* { dg-final { scan-assembler-not {\t(lfence|pause)} } } */
 /* { dg-final { scan-assembler-not {jmp[ \t]*\.?LIND} } } */
index 24fc43b3ba584ce1caa0da140b09e56c1bc52b61..bdf15d36bac6abaa9a3cddc76b9aebaff7b88ebd 100644 (file)
@@ -16,7 +16,7 @@ male_indirect_jump (long offset)
 
 /* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*dispatch" { target *-*-linux* } } } */
 /* { dg-final { scan-assembler {movq[ \t]*_dispatch} { target { lp64 && *-*-darwin* } } } } */
-/* { dg-final { scan-assembler {movl[ \t]*l_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
+/* { dg-final { scan-assembler {movl[ \t]*[Ll]_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
 /* { dg-final { scan-assembler "call\[ \t\]*_?__x86_indirect_thunk_(r|e)ax" } } */
 /* { dg-final { scan-assembler-not {\t(lfence|pause)} } } */
 /* { dg-final { scan-assembler-not {jmp[ \t]*\.?LIND} } } */
index 3dc02f80ff5963ab5b269217b20652bf8b00b546..c30c331c23b18315187e890650584378df59d4d0 100644 (file)
@@ -14,7 +14,7 @@ male_indirect_jump (long offset)
 
 /* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*dispatch" { target *-*-linux* } } } */
 /* { dg-final { scan-assembler {movq[ \t]*_dispatch} { target { lp64 && *-*-darwin* } } } } */
-/* { dg-final { scan-assembler {movl[ \t]*l_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
+/* { dg-final { scan-assembler {movl[ \t]*[Ll]_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
 /* { dg-final { scan-assembler "jmp\[ \t\]*_?__x86_indirect_thunk_(r|e)ax" } } */
 /* { dg-final { scan-assembler-not {\t(lfence|pause)} } } */
 /* { dg-final { scan-assembler-not {jmp[ \t]*\.?LIND} } } */
index c4adae23dd34cd098dfa5157374c0594e50d5fd2..7edd73130275efcf7ba3f74fb420aa547fa519ef 100644 (file)
@@ -14,7 +14,7 @@ male_indirect_jump (long offset)
 
 /* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*dispatch" { target *-*-linux* } } } */
 /* { dg-final { scan-assembler {movq[ \t]*_dispatch} { target { lp64 && *-*-darwin* } } } } */
-/* { dg-final { scan-assembler {movl[ \t]*l_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
+/* { dg-final { scan-assembler {movl[ \t]*[Ll]_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
 /* { dg-final { scan-assembler "jmp\[ \t\]*_?__x86_indirect_thunk_(r|e)ax" } } */
 /* { dg-final { scan-assembler-not {\t(lfence|pause)} } } */
 /* { dg-final { scan-assembler-not {jmp[ \t]*\.?LIND} } } */
index b800b40b0558cc6358e17fcebbe6cc8721ff5a2c..8e391797c5e9059770c79d9742ff4cac94019d71 100644 (file)
@@ -15,7 +15,7 @@ male_indirect_jump (long offset)
 
 /* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*dispatch" { target *-*-linux* } } } */
 /* { dg-final { scan-assembler {movq[ \t]*_dispatch} { target { lp64 && *-*-darwin* } } } } */
-/* { dg-final { scan-assembler {movl[ \t]*l_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
+/* { dg-final { scan-assembler {movl[ \t]*[Ll]_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
 /* { dg-final { scan-assembler "call\[ \t\]*_?__x86_indirect_thunk_(r|e)ax" } } */
 /* { dg-final { scan-assembler-not {\t(lfence|pause)} } } */
 /* { dg-final { scan-assembler-not {jmp[ \t]*\.?LIND} } } */
index f68902ddc25dcb8323a1d28abd2fedb822f2df2c..6033d13e8a7fb3af34f6d65a6da2141a570681d7 100644 (file)
@@ -15,6 +15,6 @@ male_indirect_jump (long offset)
 
 /* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*dispatch" { target *-*-linux* } } } */
 /* { dg-final { scan-assembler {movq[ \t]*_dispatch} { target { lp64 && *-*-darwin* } } } } */
-/* { dg-final { scan-assembler {movl[ \t]*l_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
+/* { dg-final { scan-assembler {movl[ \t]*[Ll]_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
 /* { dg-final { scan-assembler "call\[ \t\]*_?__x86_indirect_thunk_(r|e)ax" } } */
 /* { dg-final { scan-assembler-not {\t(lfence|pause)} } } */
index 7301490d49c09060f3ba3ef5beff6343a725f798..ef3577d29341130ea92681da0d6df7449160e6b6 100644 (file)
@@ -14,7 +14,7 @@ male_indirect_jump (long offset)
 
 /* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*dispatch" { target *-*-linux* } } } */
 /* { dg-final { scan-assembler {movq[ \t]*_dispatch} { target { lp64 && *-*-darwin* } } } } */
-/* { dg-final { scan-assembler {movl[ \t]*l_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
+/* { dg-final { scan-assembler {movl[ \t]*[Ll]_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
 /* { dg-final { scan-assembler {jmp[ \t]*\.?LIND} } } */
 /* { dg-final { scan-assembler {call[ \t]*\.?LIND} } } */
 /* { dg-final { scan-assembler {\tpause} } } */
index ef1ba02978d889c45b7c4d8c970db22de04b84c6..f26a5fb901529317ad2b98456ea02a4cda468e77 100644 (file)
@@ -14,7 +14,7 @@ male_indirect_jump (long offset)
 
 /* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*dispatch" { target *-*-linux* } } } */
 /* { dg-final { scan-assembler {movq[ \t]*_dispatch} { target { lp64 && *-*-darwin* } } } } */
-/* { dg-final { scan-assembler {movl[ \t]*l_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
+/* { dg-final { scan-assembler {movl[ \t]*[Ll]_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
 /* { dg-final { scan-assembler {jmp[ \t]*\.?LIND} } } */
 /* { dg-final { scan-assembler {call[ \t]*\.?LIND} } } */
 /* { dg-final { scan-assembler {\tpause} } } */
index 58de8f0393e3cf04682125eb48622ae523c22273..3b8a1eeaffb3867481f578ae9fc2c5cf84f9dd37 100644 (file)
@@ -15,7 +15,7 @@ male_indirect_jump (long offset)
 
 /* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*dispatch" { target *-*-linux* } } } */
 /* { dg-final { scan-assembler {movq[ \t]*_dispatch} { target { lp64 && *-*-darwin* } } } } */
-/* { dg-final { scan-assembler {movl[ \t]*l_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
+/* { dg-final { scan-assembler {movl[ \t]*[Ll]_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
 /* { dg-final { scan-assembler-times {jmp[ \t]*\.?LIND} 2 } } */
 /* { dg-final { scan-assembler-times {call[ \t]*\.?LIND} 2 } } */
 /* { dg-final { scan-assembler-times {\tpause} 1 } } */
index 3be3ce07527c4f78b5798838480ffe5ff6cae37b..40d31803a2e78b577f5915e3ce403b0e51bd59f2 100644 (file)
@@ -15,7 +15,7 @@ male_indirect_jump (long offset)
 
 /* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*dispatch" { target *-*-linux* } } } */
 /* { dg-final { scan-assembler {movq[ \t]*_dispatch} { target { lp64 && *-*-darwin* } } } } */
-/* { dg-final { scan-assembler {movl[ \t]*l_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
+/* { dg-final { scan-assembler {movl[ \t]*[Ll]_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
 /* { dg-final { scan-assembler-times {jmp[ \t]*\.?LIND} 2 } } */
 /* { dg-final { scan-assembler-times {call[ \t]*\.?LIND} 2 } } */
 /* { dg-final { scan-assembler-times {\tpause} 1 } } */
index cb587db47aaf9fba7b64c8601af291fe7068cb48..b6212f7dd4c93632f265fa4b881080df9734b3e1 100644 (file)
@@ -20,5 +20,5 @@ foo ()
 /* { dg-final { scan-assembler "movl\[ \t\]xxx@GOT\\(%\[^,\]*\\), %" { target { ia32 && { ! *-*-darwin* } } } } } */
 
 /* Darwin m32 defaults to PIC but common symbols need to be indirected.  */
-/* { dg-final { scan-assembler {movl[ \t]l_xxx\$non_lazy_ptr-L1\$pb\(%eax\),[ \t]%eax} { target { ia32 && *-*-darwin* } } } } */
+/* { dg-final { scan-assembler {movl[ \t][Ll]_xxx\$non_lazy_ptr-L1\$pb\(%eax\),[ \t]%eax} { target { ia32 && *-*-darwin* } } } } */
 
index f9cfca7d72c5bf7e35c76810712ac99c274bda60..a1b0df28d0d886c07154fd3e46bfbe5a7e6668bf 100644 (file)
@@ -24,4 +24,4 @@ foo ()
 
 /* For Darwin, we need PIC to allow PIE, but also we must indirect weak symbols so that
    they can be indirected.  Again, dyld knows how to deal with this. */
-/* { dg-final { scan-assembler {movl[ \t]l_xxx\$non_lazy_ptr-L1\$pb\(%eax\),[ \t]%eax} { target { ia32 && *-*-darwin* } } } } */
+/* { dg-final { scan-assembler {movl[ \t][Ll]_xxx\$non_lazy_ptr-L1\$pb\(%eax\),[ \t]%eax} { target { ia32 && *-*-darwin* } } } } */
index 0ac0674ae179ed43c4509a086cf9420765e03eb2..31d0710b7ed9b62b7703a59ca29b22ef6df18929 100644 (file)
@@ -21,4 +21,4 @@ foo ()
 /* { dg-final { scan-assembler "movl\[ \t\]xxx@GOT\\(%\[^,\]*\\), %" { target { ia32 && { ! *-*-darwin* } } } } } */
 
 /* Darwin m32 equivalent (indirect and PIC).  */
-/* { dg-final { scan-assembler {movl[ \t]l_xxx\$non_lazy_ptr-L1\$pb\(%eax\),[ \t]%eax} { target { ia32 && *-*-darwin* } } } } */
+/* { dg-final { scan-assembler {movl[ \t][Ll]_xxx\$non_lazy_ptr-L1\$pb\(%eax\),[ \t]%eax} { target { ia32 && *-*-darwin* } } } } */
index 469e9e38b076e9c9aa6cfab3cdf756c21e3e70b0..20fef8dd0638987856d546d9e720091dd27c577c 100644 (file)
@@ -23,4 +23,4 @@ foo ()
 /* { dg-final { scan-assembler-not "movl\[ \t\]xxx@GOT\\(%\[^,\]*\\), %eax" { target { ia32 && { ! *-*-darwin* } } } } } */
 
 /* Darwin m32 equivalent (indirect and PIC).  */
-/* { dg-final { scan-assembler {movl[ \t]l_xxx\$non_lazy_ptr-L1\$pb\(%eax\),[ \t]%eax} { target { ia32 && *-*-darwin* } } } } */
+/* { dg-final { scan-assembler {movl[ \t][Ll]_xxx\$non_lazy_ptr-L1\$pb\(%eax\),[ \t]%eax} { target { ia32 && *-*-darwin* } } } } */
index 75eb287fc595f325d423b330c248a1b30e08284a..767928f049ec76326e85e3003f2cf9b3ca49d90a 100644 (file)
@@ -21,4 +21,4 @@ foo ()
 /* { dg-final { scan-assembler "movl\[ \t\]xxx@GOT\\(%\[^,\]*\\), %" { target { ia32 && { ! *-*-darwin* } } } } } */
 
 /* Darwin m32 default to PIC but needs indirection for the weak symbol.  */
-/* { dg-final { scan-assembler {movl[ \t]l_xxx\$non_lazy_ptr-L1\$pb\(%eax\),[ \t]%eax} { target { ia32 && *-*-darwin* } } } } */
+/* { dg-final { scan-assembler {movl[ \t][Ll]_xxx\$non_lazy_ptr-L1\$pb\(%eax\),[ \t]%eax} { target { ia32 && *-*-darwin* } } } } */
index 3eaddee8c34bcdbb27191ca108dba527436e4e2f..881f541772c900abb65dff544512d948d1261d8f 100644 (file)
@@ -19,6 +19,6 @@ foo (void)
 /* { dg-final { scan-assembler {call[ \t]*\.?LIND} } } */
 /* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*bar" { target *-*-linux* } } } */
 /* { dg-final { scan-assembler {movq[ \t]*_bar} { target { lp64 && *-*-darwin* } } } } */
-/* { dg-final { scan-assembler {movl[ \t]*l_bar\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
+/* { dg-final { scan-assembler {movl[ \t]*[Ll]_bar\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
 /* { dg-final { scan-assembler "call\[ \t\]*_?__x86_indirect_thunk_(r|e)ax" } } */
 /* { dg-final { scan-assembler-not "pushq\[ \t\]%rax" } } */
index 2793f72cdc1e5d72b13326e575d03dc322d84407..5687440bf31d19ae29e658b34f16fc708907d5b5 100644 (file)
@@ -19,6 +19,6 @@ foo (void)
 /* { dg-final { scan-assembler-times {\tlfence} 1 } } */
 /* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*bar" { target *-*-linux* } } } */
 /* { dg-final { scan-assembler {movq[ \t]*_bar} { target { lp64 && *-*-darwin* } } } } */
-/* { dg-final { scan-assembler {movl[ \t]*l_bar\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
+/* { dg-final { scan-assembler {movl[ \t]*[Ll]_bar\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
 /* { dg-final { scan-assembler "call\[ \t\]*_?__x86_indirect_thunk_(r|e)ax" } } */
 /* { dg-final { scan-assembler-not "pushq\[ \t\]%rax" } } */
index 63af6741e05203c2c66bb7273b654ddff062f978..3d4497000dcecc5edc66ebe829de8a51a16e8c04 100644 (file)
@@ -17,7 +17,7 @@ foo (void)
 /* { dg-final { scan-assembler "_?__x86_return_thunk:" } } */
 /* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*bar" { target *-*-linux* } } } */
 /* { dg-final { scan-assembler {movq[ \t]*_bar} { target { lp64 && *-*-darwin* } } } } */
-/* { dg-final { scan-assembler {movl[ \t]*l_bar\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
+/* { dg-final { scan-assembler {movl[ \t]*[Ll]_bar\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
 /* { dg-final { scan-assembler-times {\tpause} 2 } } */
 /* { dg-final { scan-assembler-times {\tlfence} 2 } } */
 /* { dg-final { scan-assembler "call\[ \t\]*_?__x86_indirect_thunk_(r|e)ax" } } */