summaryrefslogtreecommitdiff
path: root/src/cmd/internal/goobj/read.go
diff options
context:
space:
mode:
authorCherry Zhang <cherryyz@google.com>2020-04-02 12:48:13 -0400
committerCherry Zhang <cherryyz@google.com>2020-04-02 17:24:05 +0000
commitd92a5a80b5c06b5d9915c5f888ab5cac6a94b11e (patch)
tree106ed3a755f8f779223c51c773be132be52f217c /src/cmd/internal/goobj/read.go
parent8cc515ad3fe9f7f45470713ff1cd4faf323aef6a (diff)
downloadgo-git-d92a5a80b5c06b5d9915c5f888ab5cac6a94b11e.tar.gz
[dev.link] cmd: support large function alignment
This ports CL 226997 to the dev.link branch. - The assembler part and old object file writing are unchanged. - Changes to cmd/link are applied to cmd/oldlink. - Add alignment field to new object files for the new linker. Change-Id: Id00f323ae5bdd86b2709a702ee28bcaa9ba962f8 Reviewed-on: https://go-review.googlesource.com/c/go/+/227025 Reviewed-by: Than McIntosh <thanm@google.com>
Diffstat (limited to 'src/cmd/internal/goobj/read.go')
-rw-r--r--src/cmd/internal/goobj/read.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/cmd/internal/goobj/read.go b/src/cmd/internal/goobj/read.go
index 027c77e725..44e619cabb 100644
--- a/src/cmd/internal/goobj/read.go
+++ b/src/cmd/internal/goobj/read.go
@@ -96,6 +96,7 @@ type Var struct {
type Func struct {
Args int64 // size in bytes of argument frame: inputs and outputs
Frame int64 // size in bytes of local variable frame
+ Align uint32 // alignment requirement in bytes for the address of the function
Leaf bool // function omits save of link register (ARM)
NoSplit bool // function omits stack split prologue
TopFrame bool // function is the top of the call stack
@@ -591,6 +592,7 @@ func (r *objReader) parseObject(prefix []byte) error {
s.Func = f
f.Args = r.readInt()
f.Frame = r.readInt()
+ f.Align = uint32(r.readInt())
flags := r.readInt()
f.Leaf = flags&(1<<0) != 0
f.TopFrame = flags&(1<<4) != 0