mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[dev.link] cmd/link: make symbol attribute setting more reliable
For dupOK symbols, their attributes should be OR'd. Most of the attributes are expected to be set consistently across multiple definitions, but UsedInIface must be OR'd, and for alignment we need to pick the largest one. Currently the attributes are not always OR'd, depending on addSym returning true or false. This doesn't cause any real problem, but it would be a problem if we make type descriptor symbols content-addressable. This CL removes the second result of addSym, and lets preloadSyms always set the attributes. Also removes the alignment handling on addSym, handles it in preloadSyms only. Change-Id: I06b3f0adb733f6681956ea9ef54736baa86ae7bc Reviewed-on: https://go-review.googlesource.com/c/go/+/245720 Reviewed-by: Jeremy Faller <jeremy@golang.org>
This commit is contained in:
parent
c4ee16eda9
commit
847b9be3f6
2 changed files with 33 additions and 51 deletions
|
|
@ -21,11 +21,7 @@ import (
|
|||
// data or relocations).
|
||||
func addDummyObjSym(t *testing.T, ldr *Loader, or *oReader, name string) Sym {
|
||||
idx := uint32(len(ldr.objSyms))
|
||||
s, ok := ldr.addSym(name, 0, or, idx, nonPkgDef, &goobj2.Sym{})
|
||||
if !ok {
|
||||
t.Errorf("AddrSym failed for '" + name + "'")
|
||||
}
|
||||
return s
|
||||
return ldr.addSym(name, 0, or, idx, nonPkgDef, &goobj2.Sym{})
|
||||
}
|
||||
|
||||
func mkLoader() *Loader {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue