[dev.link] all: merge branch 'master' into dev.link

Clean merge.

Change-Id: If78d97b9ac69511e4de7aa9532257d4fabebdcbc
This commit is contained in:
Cherry Zhang 2020-07-31 13:21:24 -04:00
commit c4ee16eda9
27 changed files with 661 additions and 324 deletions

View file

@ -2070,17 +2070,6 @@ func ldshlibsyms(ctxt *Link, shlib string) {
l.SetSymElfType(s, elf.ST_TYPE(elfsym.Info))
su.SetSize(int64(elfsym.Size))
if elfsym.Section != elf.SHN_UNDEF {
// If it's not undefined, mark the symbol as reachable
// so as to protect it from dead code elimination,
// even if there aren't any explicit references to it.
// Under the previous sym.Symbol based regime this
// wasn't necessary, but for the loader-based deadcode
// it is definitely needed.
//
// FIXME: have a more general/flexible mechanism for this?
//
l.SetAttrReachable(s, true)
// Set .File for the library that actually defines the symbol.
l.SetSymPkg(s, libpath)