aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/internal
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/internal')
-rw-r--r--src/cmd/internal/goobj/read.go2
-rw-r--r--src/cmd/internal/obj/objfile.go3
-rw-r--r--src/cmd/internal/obj/ppc64/obj9.go5
-rw-r--r--src/cmd/internal/objabi/doc.go1
4 files changed, 10 insertions, 1 deletions
diff --git a/src/cmd/internal/goobj/read.go b/src/cmd/internal/goobj/read.go
index b68fe02eb3..587274401b 100644
--- a/src/cmd/internal/goobj/read.go
+++ b/src/cmd/internal/goobj/read.go
@@ -532,7 +532,7 @@ func (r *objReader) parseObject(prefix []byte) error {
f.Args = r.readInt()
f.Frame = r.readInt()
flags := r.readInt()
- f.Leaf = flags&1 != 0
+ f.Leaf = flags&(1<<0) != 0
f.NoSplit = r.readInt() != 0
f.Var = make([]Var, r.readInt())
for i := range f.Var {
diff --git a/src/cmd/internal/obj/objfile.go b/src/cmd/internal/obj/objfile.go
index c550d43f26..dc22eacdf4 100644
--- a/src/cmd/internal/obj/objfile.go
+++ b/src/cmd/internal/obj/objfile.go
@@ -338,6 +338,9 @@ func (w *objWriter) writeSym(s *LSym) {
if s.ReflectMethod() {
flags |= 1 << 2
}
+ if ctxt.Flag_shared {
+ flags |= 1 << 3
+ }
w.writeInt(flags)
w.writeInt(int64(len(s.Func.Autom)))
for _, a := range s.Func.Autom {
diff --git a/src/cmd/internal/obj/ppc64/obj9.go b/src/cmd/internal/obj/ppc64/obj9.go
index 72e02d39cf..b1509e3813 100644
--- a/src/cmd/internal/obj/ppc64/obj9.go
+++ b/src/cmd/internal/obj/ppc64/obj9.go
@@ -476,6 +476,11 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym, newprog obj.ProgAlloc) {
// generate the addis instruction except as part of the
// load of a large constant, and in that case there is no
// way to use r12 as the source.
+ //
+ // Note that the same condition is tested in
+ // putelfsym in cmd/link/internal/ld/symtab.go
+ // where we set the st_other field to indicate
+ // the presence of these instructions.
q = obj.Appendp(q, c.newprog)
q.As = AWORD
q.Pos = p.Pos
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]