cmd/link/internal/loadelf: set AttrExternal on text section symbols

PPC64 processes external object relocations against the section
symbols. This needs to be set correctly to determine the type of
PLT stub to generate when both Go and External code make PLT calls.

Change-Id: I5abdd5a0473866164083c33e80324dffcc1707f0
Reviewed-on: https://go-review.googlesource.com/c/go/+/488895
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Paul Murphy <murp@ibm.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
This commit is contained in:
Paul E. Murphy 2023-04-25 16:41:51 -05:00 committed by Paul Murphy
parent 39957b5d89
commit d816f85f78
1 changed files with 1 additions and 0 deletions

View File

@ -540,6 +540,7 @@ func Load(l *loader.Loader, arch *sys.Arch, localSymVersion int, f *bio.Reader,
}
if sect.type_ == elf.SHT_PROGBITS {
sb.SetData(sect.base[:sect.size])
sb.SetExternal(true)
}
sb.SetSize(int64(sect.size))