From 5331e7e9df017374a05a66497fd367e165b8aaf5 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 9 May 2017 14:34:16 -0700 Subject: 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 TryBot-Result: Gobot Gobot Reviewed-by: Michael Hudson-Doyle Reviewed-by: Matthew Dempsky --- src/cmd/internal/objabi/doc.go | 1 + 1 file changed, 1 insertion(+) (limited to 'src/cmd/internal/objabi') diff --git a/src/cmd/internal/objabi/doc.go b/src/cmd/internal/objabi/doc.go index 7b93fc19e5..dc37817a61 100644 --- a/src/cmd/internal/objabi/doc.go +++ b/src/cmd/internal/objabi/doc.go @@ -77,6 +77,7 @@ // 1<<0 leaf // 1<<1 C function // 1<<2 function may call reflect.Type.Method +// 1<<3 function compiled with -shared // - nlocal [int] // - local [nlocal automatics] // - pcln [pcln table] -- cgit v1.3