Skip to content

Commit

Permalink
cmd/link: propagate FromAssembly attribute when cloning symbols to ex…
Browse files Browse the repository at this point in the history
…ternal

When a symbol is cloned to external (in order to edit it),
propagate the FromAssembly attribute, so the linker knows it is
(originally) an assembly symbol, and can treat it specially (e.g.
for stack maps).

This should fix the Linux/RISCV64 builder.

Change-Id: Icc956bcc43b79f328983a60835b05fd50f22326a
Reviewed-on: https://go-review.googlesource.com/c/go/+/587926
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Than McIntosh <thanm@google.com>
  • Loading branch information
cherrymui committed May 24, 2024
1 parent 23778fc commit 5c7d774
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/cmd/link/internal/loader/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,11 @@ func (l *Loader) IsFileLocal(i Sym) bool {
// object file generated by the Go assembler.
func (l *Loader) IsFromAssembly(i Sym) bool {
if l.IsExternal(i) {
pp := l.getPayload(i)
if pp.objidx != 0 {
r := l.objs[pp.objidx]
return r.FromAssembly()
}
return false
}
r, _ := l.toLocal(i)
Expand Down

0 comments on commit 5c7d774

Please sign in to comment.