Make __start/__stop symbols protected visibility
authorAlan Modra <amodra@gmail.com>
Mon, 21 Aug 2017 03:58:06 +0000 (13:28 +0930)
committerAlan Modra <amodra@gmail.com>
Mon, 21 Aug 2017 13:59:29 +0000 (23:29 +0930)
They can't be hidden visibility since apparently people use dlsym to
look them up.

bfd/
PR ld/21964
* elf-bfd.h (SYMBOLIC_BIND): Return TRUE for __start/__stop symbols.
* elflink.c (bfd_elf_define_start_stop): Rewrite.
ld/
PR ld/21964
* testsuite/ld-elf/pr21562a.d: Update for changed start/stop symbols.
* testsuite/ld-elf/pr21562b.d: Likewise.
* testsuite/ld-elf/pr21562c.d: Likewise.
* testsuite/ld-elf/pr21562d.d: Likewise.
* testsuite/ld-elf/pr21562e.d: Likewise.
* testsuite/ld-elf/pr21562f.d: Likewise.
* testsuite/ld-elf/pr21562g.d: Likewise.
* testsuite/ld-elf/pr21562h.d: Likewise.
* testsuite/ld-elf/pr21562i.d: Likewise.
* testsuite/ld-elf/pr21562j.d: Likewise.
* testsuite/ld-elf/pr21562k.d: Likewise.
* testsuite/ld-elf/pr21562l.d: Likewise.
* testsuite/ld-elf/pr21562m.d: Likewise.
* testsuite/ld-elf/pr21562n.d: Likewise.
* testsuite/ld-elf/sizeofa.d: Likewise.
* testsuite/ld-elf/sizeofb.d: Likewise.
* testsuite/ld-elf/startofa.d: Likewise.
* testsuite/ld-elf/startofb.d: Likewise.
* testsuite/ld-gc/pr20022.d: Likewise.
* testsuite/ld-gc/start.d: Likewise.
* testsuite/ld-elf/pr21964-1a.c: New file.
* testsuite/ld-elf/pr21964-1b.c: New file.
* testsuite/ld-elf/pr21964-2a.c: New file.
* testsuite/ld-elf/pr21964-2b.c: New file.
* testsuite/ld-elf/shared.exp: Run PR ld/21964 tests.

29 files changed:
bfd/ChangeLog
bfd/elf-bfd.h
bfd/elflink.c
ld/ChangeLog
ld/testsuite/ld-elf/pr21562a.d
ld/testsuite/ld-elf/pr21562b.d
ld/testsuite/ld-elf/pr21562c.d
ld/testsuite/ld-elf/pr21562d.d
ld/testsuite/ld-elf/pr21562e.d
ld/testsuite/ld-elf/pr21562f.d
ld/testsuite/ld-elf/pr21562g.d
ld/testsuite/ld-elf/pr21562h.d
ld/testsuite/ld-elf/pr21562i.d
ld/testsuite/ld-elf/pr21562j.d
ld/testsuite/ld-elf/pr21562k.d
ld/testsuite/ld-elf/pr21562l.d
ld/testsuite/ld-elf/pr21562m.d
ld/testsuite/ld-elf/pr21562n.d
ld/testsuite/ld-elf/pr21964-1a.c [new file with mode: 0644]
ld/testsuite/ld-elf/pr21964-1b.c [new file with mode: 0644]
ld/testsuite/ld-elf/pr21964-2a.c [new file with mode: 0644]
ld/testsuite/ld-elf/pr21964-2b.c [new file with mode: 0644]
ld/testsuite/ld-elf/shared.exp
ld/testsuite/ld-elf/sizeofa.d
ld/testsuite/ld-elf/sizeofb.d
ld/testsuite/ld-elf/startofa.d
ld/testsuite/ld-elf/startofb.d
ld/testsuite/ld-gc/pr20022.d
ld/testsuite/ld-gc/start.d

index 6badc5db567de4cbcdaa03a86cc798746ea08313..15f1a3f03787dcc8984c4b0385be9d41f9b6d320 100644 (file)
@@ -1,3 +1,10 @@
+2017-08-21  Alan Modra  <amodra@gmail.com>
+           H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR ld/21964
+       * elf-bfd.h (SYMBOLIC_BIND): Return TRUE for __start/__stop symbols.
+       * elflink.c (bfd_elf_define_start_stop): Rewrite.
+
 2017-08-21  Hans-Peter Nilsson  <hp@bitrange.com>
 
        PR ld/20125
index 92a8e02e591d6c553f1efa769961a5e66129e221..83958e41e074d62b646e0011a511717223e0f505 100644 (file)
@@ -2802,7 +2802,9 @@ extern asection _bfd_elf_large_com_section;
    library, if any.  A unique symbol can never be bound locally.  */
 #define SYMBOLIC_BIND(INFO, H) \
     (!(H)->unique_global \
-     && ((INFO)->symbolic || ((INFO)->dynamic && !(H)->dynamic)))
+     && ((INFO)->symbolic \
+        || (H)->start_stop \
+        || ((INFO)->dynamic && !(H)->dynamic)))
 
 #ifdef __cplusplus
 }
index f9886dc64571a89be4df1ad40088417b1bcf0d97..ceacb37e4c804796ca6222d1a3e5a824911fff36 100644 (file)
@@ -14260,18 +14260,30 @@ struct bfd_link_hash_entry *
 bfd_elf_define_start_stop (struct bfd_link_info *info,
                           const char *symbol, asection *sec)
 {
-  struct bfd_link_hash_entry *h;
+  struct elf_link_hash_entry *h;
 
-  h = bfd_generic_define_start_stop (info, symbol, sec);
-  if (h != NULL)
+  h = elf_link_hash_lookup (elf_hash_table (info), symbol,
+                           FALSE, FALSE, TRUE);
+  if (h != NULL
+      && (h->root.type == bfd_link_hash_undefined
+         || h->root.type == bfd_link_hash_undefweak
+         || (h->ref_regular && !h->def_regular)))
     {
-      struct elf_link_hash_entry *eh = (struct elf_link_hash_entry *) h;
-      eh->start_stop = 1;
-      eh->u2.start_stop_section = sec;
-      _bfd_elf_link_hash_hide_symbol (info, eh, TRUE);
-      if (ELF_ST_VISIBILITY (eh->other) != STV_INTERNAL)
-       eh->other = ((eh->other & ~ELF_ST_VISIBILITY (-1))
-                    | STV_HIDDEN);
+      h->root.type = bfd_link_hash_defined;
+      h->root.u.def.section = sec;
+      h->root.u.def.value = 0;
+      h->def_regular = 1;
+      h->def_dynamic = 0;
+      h->start_stop = 1;
+      h->u2.start_stop_section = sec;
+      if (symbol[0] == '.')
+       {
+         /* .startof. and .sizeof. symbols are local.  */
+         _bfd_elf_link_hash_hide_symbol (info, h, TRUE);
+       }
+      else if (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
+       h->other = (h->other & ~ELF_ST_VISIBILITY (-1)) | STV_PROTECTED;
+      return &h->root;
     }
-  return h;
+  return NULL;
 }
index a15025608df888e928ed836d3196ace750347832..5e2ddf478e42c837694970c1903fa73dc1725fb6 100644 (file)
@@ -1,3 +1,33 @@
+2017-08-21  H.J. Lu  <hongjiu.lu@intel.com>
+           Alan Modra  <amodra@gmail.com>
+
+       PR ld/21964
+       * testsuite/ld-elf/pr21562a.d: Update for changed start/stop symbols.
+       * testsuite/ld-elf/pr21562b.d: Likewise.
+       * testsuite/ld-elf/pr21562c.d: Likewise.
+       * testsuite/ld-elf/pr21562d.d: Likewise.
+       * testsuite/ld-elf/pr21562e.d: Likewise.
+       * testsuite/ld-elf/pr21562f.d: Likewise.
+       * testsuite/ld-elf/pr21562g.d: Likewise.
+       * testsuite/ld-elf/pr21562h.d: Likewise.
+       * testsuite/ld-elf/pr21562i.d: Likewise.
+       * testsuite/ld-elf/pr21562j.d: Likewise.
+       * testsuite/ld-elf/pr21562k.d: Likewise.
+       * testsuite/ld-elf/pr21562l.d: Likewise.
+       * testsuite/ld-elf/pr21562m.d: Likewise.
+       * testsuite/ld-elf/pr21562n.d: Likewise.
+       * testsuite/ld-elf/sizeofa.d: Likewise.
+       * testsuite/ld-elf/sizeofb.d: Likewise.
+       * testsuite/ld-elf/startofa.d: Likewise.
+       * testsuite/ld-elf/startofb.d: Likewise.
+       * testsuite/ld-gc/pr20022.d: Likewise.
+       * testsuite/ld-gc/start.d: Likewise.
+       * testsuite/ld-elf/pr21964-1a.c: New file.
+       * testsuite/ld-elf/pr21964-1b.c: New file.
+       * testsuite/ld-elf/pr21964-2a.c: New file.
+       * testsuite/ld-elf/pr21964-2b.c: New file.
+       * testsuite/ld-elf/shared.exp: Run PR ld/21964 tests.
+
 2017-08-21  Hans-Peter Nilsson  <hp@bitrange.com>
 
        PR ld/20125
index ecf013f432c579d9c81bac676ca24cf11f16e4ad..e978734db9df07372c3383561140726a849e9c77 100644 (file)
@@ -8,5 +8,5 @@
 #...
   \[[ 0-9]+\] scnfoo[ \t]+PROGBITS[ \t]+[0-9a-f]+ +[0-9a-f]+ +0*10[ \t]+.*
 #...
- +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +LOCAL +DEFAULT +[0-9]+ +___?start_scnfoo
+ +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +GLOBAL +PROTECTED +[0-9]+ +___?start_scnfoo
 #pass
index 063a141741af8c71ff176f228af1d77715220c03..f1d058a67fc29b3c07b4294e9dcadd829d2373be 100644 (file)
@@ -8,5 +8,5 @@
 #...
   \[[ 0-9]+\] scnfoo[ \t]+PROGBITS[ \t]+[0-9a-f]+ +[0-9a-f]+ +0*10[ \t]+.*
 #...
- +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +LOCAL +DEFAULT +[0-9]+ +___?stop_scnfoo
+ +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +GLOBAL +PROTECTED +[0-9]+ +___?stop_scnfoo
 #pass
index 1d72a0d02f150229263da3cea89bacabe96dc250..1bfbff386684e669e10b1c4c5e97eea0f139c059 100644 (file)
@@ -9,5 +9,5 @@
 #...
   \[[ 0-9]+\] scnfoo[ \t]+PROGBITS[ \t]+[0-9a-f]+ +[0-9a-f]+ +0*10[ \t]+.*
 #...
- +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +LOCAL +DEFAULT +[0-9]+ +___?start_scnfoo
+ +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +GLOBAL +PROTECTED +[0-9]+ +___?start_scnfoo
 #pass
index f752a2465a2b532b44494eb0f67a1d265d70900d..4f8e91efc961b800459bbe97abda0819852aa85f 100644 (file)
@@ -9,5 +9,5 @@
 #...
   \[[ 0-9]+\] scnfoo[ \t]+PROGBITS[ \t]+[0-9a-f]+ +[0-9a-f]+ +0*10[ \t]+.*
 #...
- +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +LOCAL +DEFAULT +[0-9]+ +___?stop_scnfoo
+ +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +GLOBAL +PROTECTED +[0-9]+ +___?stop_scnfoo
 #pass
index 769f2f8a4bdff284447e6c655e545436269b2d2d..ee969bd47ad7dee57e6c88e0c13bfa93ddcc8592 100644 (file)
@@ -6,5 +6,5 @@
 #...
   \[[ 0-9]+\] scnfoo[ \t]+PROGBITS[ \t]+[0-9a-f]+ +[0-9a-f]+ +0*10[ \t]+.*
 #...
- +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +LOCAL +DEFAULT +[0-9]+ +___?start_scnfoo
+ +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +GLOBAL +PROTECTED +[0-9]+ +___?start_scnfoo
 #pass
index cb81c2a36bf118e6f2c791a2921542d03b5bc349..119f43e116f4a95cd1c74666e1d16596509ab75c 100644 (file)
@@ -6,5 +6,5 @@
 #...
   \[[ 0-9]+\] scnfoo[ \t]+PROGBITS[ \t]+[0-9a-f]+ +[0-9a-f]+ +0*10[ \t]+.*
 #...
- +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +LOCAL +DEFAULT +[0-9]+ +___?stop_scnfoo
+ +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +GLOBAL +PROTECTED +[0-9]+ +___?stop_scnfoo
 #pass
index 9926416abe9d97b34811c6b225c464bccd59a33f..f3d2a31325c8ab955e12d10750f706919622b8fa 100644 (file)
@@ -6,5 +6,5 @@
 #...
   \[[ 0-9]+\] scnfoo[ \t]+PROGBITS[ \t]+[0-9a-f]+ +[0-9a-f]+ +0*10[ \t]+.*
 #...
- +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +LOCAL +DEFAULT +[0-9]+ +___?start_scnfoo
+ +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +GLOBAL +PROTECTED +[0-9]+ +___?start_scnfoo
 #pass
index 1e723ba099004f991aae9b7fe9b6aadfd5be3807..0517aec9cd73dfb9c8dcdef14a47cc5460c2caf4 100644 (file)
@@ -6,5 +6,5 @@
 #...
   \[[ 0-9]+\] scnfoo[ \t]+PROGBITS[ \t]+[0-9a-f]+ +[0-9a-f]+ +0*10[ \t]+.*
 #...
- +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +LOCAL +DEFAULT +[0-9]+ +___?stop_scnfoo
+ +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +GLOBAL +PROTECTED +[0-9]+ +___?stop_scnfoo
 #pass
index f5b59c54b8b0f6748a28afa2c1a3841a15e3dd65..8baa5832797666bd14bb5883420b9f16df7c99ec 100644 (file)
@@ -9,5 +9,5 @@
 #...
   \[[ 0-9]+\] scnfoo[ \t]+PROGBITS[ \t]+[0-9a-f]+ +[0-9a-f]+ +0*10[ \t]+.*
 #...
- +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +LOCAL +DEFAULT +[0-9]+ +___?start_scnfoo
+ +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +GLOBAL +PROTECTED +[0-9]+ +___?start_scnfoo
 #pass
index 70e311e231d003e19f64445aec16a38cbaf09410..99d987c75ab10e4528f40b04051da64dad53d7b2 100644 (file)
@@ -9,5 +9,5 @@
 #...
   \[[ 0-9]+\] scnfoo[ \t]+PROGBITS[ \t]+[0-9a-f]+ +[0-9a-f]+ +0*10[ \t]+.*
 #...
- +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +LOCAL +DEFAULT +[0-9]+ +___?stop_scnfoo
+ +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +GLOBAL +PROTECTED +[0-9]+ +___?stop_scnfoo
 #pass
index 4c62eb7966e65ea1cdf0612e93a35c078c2c6ade..6aa833497fa3f6a87cc343e0654ca46d00257c90 100644 (file)
@@ -9,5 +9,5 @@
 #...
   \[[ 0-9]+\] \.foo[ \t]+PROGBITS[ \t]+[0-9a-f]+ +[0-9a-f]+ +0*10[ \t]+.*
 #...
- +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +LOCAL +DEFAULT +[0-9]+ +___?start_scnfoo
+ +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +GLOBAL +PROTECTED +[0-9]+ +___?start_scnfoo
 #pass
index b0ba90dd3c00b1155352ee99631552fcef96a929..82bab1e18a113639125e4457aa29f52f5bfa232d 100644 (file)
@@ -9,5 +9,5 @@
 #...
   \[[ 0-9]+\] \.foo[ \t]+PROGBITS[ \t]+[0-9a-f]+ +[0-9a-f]+ +0*10[ \t]+.*
 #...
- +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +LOCAL +DEFAULT +[0-9]+ +___?stop_scnfoo
+ +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +GLOBAL +PROTECTED +[0-9]+ +___?stop_scnfoo
 #pass
index fbcf76f4761eb591d8894ae3279092821d83e734..e1ad8767bd1a56a9e9096c2ec3d9dfef1383c5dd 100644 (file)
@@ -9,5 +9,5 @@
 #...
   \[[ 0-9]+\] \.foo[ \t]+PROGBITS[ \t]+[0-9a-f]+ +[0-9a-f]+ +0*10[ \t]+.*
 #...
- +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +LOCAL +DEFAULT +[0-9]+ +___?start_scnfoo
+ +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +GLOBAL +PROTECTED +[0-9]+ +___?start_scnfoo
 #pass
index 2453169999f48a7517a6cfdd487796484b995224..583c7711ef339a117b360838fabba6859d157018 100644 (file)
@@ -9,5 +9,5 @@
 #...
   \[[ 0-9]+\] \.foo[ \t]+PROGBITS[ \t]+[0-9a-f]+ +[0-9a-f]+ +0*10[ \t]+.*
 #...
- +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +LOCAL +DEFAULT +[0-9]+ +___?stop_scnfoo
+ +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +GLOBAL +PROTECTED +[0-9]+ +___?stop_scnfoo
 #pass
diff --git a/ld/testsuite/ld-elf/pr21964-1a.c b/ld/testsuite/ld-elf/pr21964-1a.c
new file mode 100644 (file)
index 0000000..f2eae53
--- /dev/null
@@ -0,0 +1,11 @@
+extern int __start___verbose[];
+extern int __stop___verbose[];
+int foo (void)
+{
+  static int my_var __attribute__((used, section("__verbose"))) = 5;
+  if (__start___verbose == __stop___verbose
+      || __start___verbose[0] != 5)
+    return -1;
+  else
+    return 0;
+}
diff --git a/ld/testsuite/ld-elf/pr21964-1b.c b/ld/testsuite/ld-elf/pr21964-1b.c
new file mode 100644 (file)
index 0000000..440c937
--- /dev/null
@@ -0,0 +1,24 @@
+#include <stdio.h>
+
+extern int foo (void);
+
+extern int __start___verbose[];
+extern int __stop___verbose[];
+static int my_var __attribute__((used, section("__verbose"))) = 6;
+int bar (void)
+{
+  if (__start___verbose == __stop___verbose)
+    return -1;
+
+  if (__start___verbose[0] != 6)
+    return -2;
+  else
+    return 0;
+}
+
+int main()
+{
+  if (bar () == 0 && foo () == 0)
+    printf ("PASS\n");
+  return 0;
+}
diff --git a/ld/testsuite/ld-elf/pr21964-2a.c b/ld/testsuite/ld-elf/pr21964-2a.c
new file mode 100644 (file)
index 0000000..617ce75
--- /dev/null
@@ -0,0 +1,11 @@
+extern int __start___verbose[];
+extern int __stop___verbose[];
+int foo (void)
+{
+  static int my_var __attribute__((used, section("__verbose"))) = 5;
+  if (__start___verbose == __stop___verbose
+      && __start___verbose[0] != 5)
+    return -1;
+  else
+    return 0;
+}
diff --git a/ld/testsuite/ld-elf/pr21964-2b.c b/ld/testsuite/ld-elf/pr21964-2b.c
new file mode 100644 (file)
index 0000000..5f638a3
--- /dev/null
@@ -0,0 +1,27 @@
+#include <dlfcn.h>
+#include <stdio.h>
+
+int main()
+{
+  void *dl;
+  void *sym;
+  int (*func) (void);
+
+  dl = dlopen("pr21964-2.so", RTLD_LAZY);
+  if (!dl)
+    return 1;
+
+  sym = dlsym(dl, "__start___verbose");
+  if (!sym)
+    return 2;
+
+  func = dlsym(dl, "foo");
+  if (!func)
+    return 3;
+  if (func () == 0)
+    printf ("PASS\n");
+
+  dlclose(dl);
+
+  return 0;
+}
index 8b139ec874dca570bafcbe49c4ece8c5546f2902..0802fa24c6884f067bc6c98fa06b69217b8ad297 100644 (file)
@@ -423,6 +423,12 @@ set build_tests {
   {"Build libpr19073.so"
    "-shared -Wl,--version-script=pr19073.map tmpdir/pr19073a.o" "-fPIC"
    {dummy.c} {{readelf {--dyn-syms --wide} pr19073.rd}} "libpr19073.so"}
+  {"Build pr21964-1.so"
+   "-shared" "-fPIC"
+   {pr21964-1a.c} {} "pr21964-1.so"}
+  {"Build pr21964-2.so"
+   "-shared" "-fPIC"
+   {pr21964-2a.c} {} "pr21964-2.so"}
 }
 
 run_cc_link_tests $build_tests
@@ -540,6 +546,9 @@ set run_tests [list \
     [list "Run pr18458" \
      "-Wl,--no-as-needed,-z,now tmpdir/libpr18458a.so tmpdir/libpr18458b.so" "" \
      {pr18458c.c} "pr18458" "pass.out" ] \
+    [list "Run pr21964-1" \
+     "-Wl,--no-as-needed,-rpath,tmpdir tmpdir/pr21964-1.so" "" \
+     {pr21964-1b.c} "pr21964-1" "pass.out" ] \
 ]
 
 # NetBSD ELF systems do not currently support the .*_array sections.
@@ -586,6 +595,9 @@ set dlopen_run_tests [list \
     [list "Run dl6d1 with --dynamic-list-data and dlopen on libdl6d.so" \
      "-Wl,--no-as-needed,--dynamic-list-data $extralibs" "" \
      {dl6dmain.c} "dl6d1" "dl6b.out" ] \
+    [list "Run pr21964-2" \
+     "-Wl,--no-as-needed,-rpath,tmpdir $extralibs" "" \
+     {pr21964-2b.c} "pr21964-2" "pass.out" ] \
 ]
 
 # Only run them when libdl is available.
index 572ffbd3ece34253513307aec9cc906650ade078..3eaa4e594e947e5d71478fa4a705fbc14181d554 100644 (file)
@@ -6,7 +6,7 @@ Symbol table '\.symtab' contains [0-9]+ entries:
  +Num: +Value +Size Type +Bind +Vis +Ndx Name
  +0: 0+ +0 +NOTYPE +LOCAL +DEFAULT +UND +
 #...
- +[0-9]+: +[a-f0-9]+ +0 +(NOTYPE|OBJECT) +(LOC|GLOB)AL +DEFAULT +[0-9]+ +___?stop_scnfoo
+ +[0-9]+: +[a-f0-9]+ +0 +(NOTYPE|OBJECT) +GLOBAL +(PROTECTED|DEFAULT) +[0-9]+ +___?stop_scnfoo
 #...
  +[0-9]+: +[a-f0-9]+ +0 +(NOTYPE|OBJECT) +GLOBAL +DEFAULT +UND +.sizeof.scnfoo
 #pass
index ac4a6a474e321f7f8da5d5af91cdfe5144a2f55d..c7d4edd55d8161869dca873ef198eb9982dba9cb 100644 (file)
@@ -7,7 +7,5 @@ Symbol table '\.dynsym' contains [0-9]+ entries:
  +Num: +Value +Size Type +Bind +Vis +Ndx Name
  +0: 0+ +0 +NOTYPE +LOCAL +DEFAULT +UND +
 #...
- +[0-9]+: +[a-f0-9]+ +0 +NOTYPE +LOCAL +DEFAULT +[0-9]+ +___?stop_scnfoo
-#...
- +[0-9]+: 0+10 + +0 +NOTYPE +LOCAL +DEFAULT +ABS +.sizeof.scnfoo
+ +[0-9]+: +[a-f0-9]+ +0 +NOTYPE +GLOBAL +PROTECTED +[0-9]+ +___?stop_scnfoo
 #pass
index 07d5ddaec8c4f554011313da958c4975abeb1f08..6a4460f08a0ca6fef5164a9610a2883d6bef0dc9 100644 (file)
@@ -6,7 +6,7 @@ Symbol table '\.symtab' contains [0-9]+ entries:
  +Num: +Value +Size Type +Bind +Vis +Ndx Name
  +0: 0+ +0 +NOTYPE +LOCAL +DEFAULT +UND +
 #...
- +[0-9]+: +[a-f0-9]+ +0 +(NOTYPE|OBJECT) +(LOCAL +DEFAULT +[0-9]+ +___?start_scnfoo|GLOBAL +DEFAULT +UND +.startof.scnfoo)
+ +[0-9]+: +[a-f0-9]+ +0 +(NOTYPE|OBJECT) +GLOBAL +DEFAULT +UND +.startof.scnfoo
 #...
- +[0-9]+: +[a-f0-9]+ +0 +(NOTYPE|OBJECT) +GLOBAL +DEFAULT +(UND +.startof.scnfoo|[0-9]+ +___?start_scnfoo)
+ +[0-9]+: +[a-f0-9]+ +0 +(NOTYPE|OBJECT) +GLOBAL +(PROTECTED|DEFAULT) +[0-9]+ +___?start_scnfoo
 #pass
index 5d659bb8e5eae10a6ca61d8ac860c402053e4f6a..b0cf563340bae3d8d02e4cd0ff312b951869d94d 100644 (file)
@@ -7,7 +7,5 @@ Symbol table '\.dynsym' contains [0-9]+ entries:
  +Num: +Value +Size Type +Bind +Vis +Ndx Name
  +0: 0+ +0 +NOTYPE +LOCAL +DEFAULT +UND +
 #...
- +[0-9]+: +[a-f0-9]+ +0 +NOTYPE +LOCAL +DEFAULT +[0-9]+ +.startof.scnfoo
-#...
- +[0-9]+: +[a-f0-9]+ +0 +NOTYPE +LOCAL +DEFAULT +[0-9]+ +___?start_scnfoo
+ +[0-9]+: +[a-f0-9]+ +0 +NOTYPE +GLOBAL +PROTECTED +[0-9]+ +___?start_scnfoo
 #pass
index 906f73d4e00e61c91f9baebf13f6f2aba2484ec7..40473c278a678ca04daace9b6918bd1007736b11 100644 (file)
@@ -9,5 +9,5 @@
 #...
   \[[ 0-9]+\] _foo[ \t]+PROGBITS[ \t]+[0-9a-f]+ +[0-9a-f]+ +[0-9a-f]+[ \t]+.*
 #...
- +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +LOCAL +DEFAULT +[0-9]+ +__start__foo
+ +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +GLOBAL +PROTECTED +[0-9]+ +__start__foo
 #pass
index 9113b482043d574a88e76dd7095dff21846da185..18e74c109c08dbce747f2b4cda09d3faabf996ab 100644 (file)
@@ -5,5 +5,5 @@
 #notarget: *-*-*aout *-*-*oldld frv-*-linux* metag-*-linux*
 
 #...
-[0-9a-f]+ d +__start__foo
+[0-9a-f]+ D +__start__foo
 #...