[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>
This commit is contained in:
Cherry Zhang 2020-04-02 12:48:13 -04:00
parent 8cc515ad3f
commit d92a5a80b5
12 changed files with 144 additions and 40 deletions

View file

@ -1616,6 +1616,9 @@ func (l *Loader) preloadSyms(r *oReader, kind int) {
strings.HasPrefix(name, "runtime.gcbits.") {
l.SetAttrNotInSymbolTable(gi, true)
}
if a := osym.Align(); a != 0 {
l.SetSymAlign(gi, int32(a))
}
}
}