1
0
mirror of https://github.com/golang/go synced 2024-09-29 08:24:36 -06:00
go/misc/cgo/testcarchive
Ian Lance Taylor 5331e7e9df cmd/internal/obj, cmd/link: fix st_other field on PPC64
In PPC64 ELF files, the st_other field indicates the number of
prologue instructions between the global and local entry points.
We add the instructions in the compiler and assembler if -shared is used.
We were assuming that the instructions were present when building a
c-archive or PIE or doing dynamic linking, on the assumption that those
are the cases where the go tool would be building with -shared.
That assumption fails when using some other tool, such as Bazel,
that does not necessarily use -shared in exactly the same way.

This CL records in the object file whether a symbol was compiled
with -shared (this will be the same for all symbols in a given compilation)
and uses that information when setting the st_other field.

Fixes #20290.

Change-Id: Ib2b77e16aef38824871102e3c244fcf04a86c6ea
Reviewed-on: https://go-review.googlesource.com/43051
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Michael Hudson-Doyle <michael.hudson@canonical.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2017-05-09 23:36:51 +00:00
..
src runtime: enable/disable SIGPROF if needed when profiling 2017-02-09 18:53:34 +00:00
carchive_test.go cmd/internal/obj, cmd/link: fix st_other field on PPC64 2017-05-09 23:36:51 +00:00
main2.c runtime: handle SIGPIPE in c-archive and c-shared programs 2017-02-03 20:07:36 +00:00
main3.c misc/cgo/testcarchive: add missing header 2017-03-09 16:42:46 +00:00
main4.c misc/cgo: decrease test failure timeouts 2016-11-17 16:31:34 +00:00
main5.c runtime: handle SIGPIPE in c-archive and c-shared programs 2017-02-03 20:07:36 +00:00
main6.c runtime: enable/disable SIGPROF if needed when profiling 2017-02-09 18:53:34 +00:00
main_unix.c misc/cgo/testcarchive: split main.c into unix and non-unix 2016-03-26 00:57:23 +00:00
main_windows.c misc/cgo/testcarchive: split main.c into unix and non-unix 2016-03-26 00:57:23 +00:00
main.c misc/cgo/testcarchive: split main.c into unix and non-unix 2016-03-26 00:57:23 +00:00