Default powerpc64 to --plt-thread-safe for Go
authorAlan Modra <amodra@gmail.com>
Wed, 19 Nov 2014 22:22:46 +0000 (08:52 +1030)
committerAlan Modra <amodra@gmail.com>
Wed, 19 Nov 2014 22:27:31 +0000 (08:57 +1030)
Go is multi-threaded, so use thread-safe plt stubs.  __go_go doesn't
actually start threads, but is a convenient libgo function with a
reasonably unique name that is called by all Go executables.  (Threads
are started by a static function of libgo, runtime_newosproc, called
by a whole lot of global functions, including runtime_starttheworld
and runtime_main.)

bfd/
* elf64-ppc.c (ppc64_elf_size_stubs): Add __go_go to thread_starters.
gold/
* powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.

bfd/ChangeLog
bfd/elf64-ppc.c
gold/ChangeLog
gold/powerpc.cc

index 579cca27d58c132b9a554025d5eacb8e334c1579..265730615030e83876aa4a8584a88882abe4e1c5 100644 (file)
@@ -1,3 +1,7 @@
+2014-11-20  Alan Modra  <amodra@gmail.com>
+
+       * elf64-ppc.c (ppc64_elf_size_stubs): Add __go_go to thread_starters.
+
 2014-11-18  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR ld/17618
index 0b65ab19cbaaa64566bb07190f649310b0d2e427..901a88d9232d4e3a112a1bc2ef64a64d0674c806 100644 (file)
@@ -11979,6 +11979,8 @@ ppc64_elf_size_stubs (struct bfd_link_info *info)
          "GOMP_parallel_loop_runtime_start",
          "GOMP_parallel_sections",
          "GOMP_parallel_sections_start",
+         /* libgo */
+         "__go_go",
        };
       unsigned i;
 
index ec76ab9d618a0d5359ef7012726d5adb8a5fe89b..20ace5b8c907281b33648a443baf6dcf76a74860 100644 (file)
@@ -1,3 +1,7 @@
+2014-11-20  Alan Modra  <amodra@gmail.com>
+
+       * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
+
 2014-11-13  H.J. Lu  <hongjiu.lu@intel.com>
 
        * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
index 828bc1674c3d3af9cdb76323423310f5b3585de7..500be1fd0db71259d0207e50d3eaf3169f2d744b 100644 (file)
@@ -2720,6 +2720,8 @@ Target_powerpc<size, big_endian>::do_relax(int pass,
              "GOMP_parallel_loop_runtime_start",
              "GOMP_parallel_sections",
              "GOMP_parallel_sections_start",
+             /* libgo */
+             "__go_go",
            };
 
          if (parameters->options().shared())