]> Cypherpunks.ru repositories - gostls13.git/commitdiff
cmd/link/internal/loadelf: set AttrExternal on text section symbols
authorPaul E. Murphy <murp@ibm.com>
Tue, 25 Apr 2023 21:41:51 +0000 (16:41 -0500)
committerPaul Murphy <murp@ibm.com>
Wed, 26 Apr 2023 15:25:47 +0000 (15:25 +0000)
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>

src/cmd/link/internal/loadelf/ldelf.go

index 7ac769999663d0390c8217a8ee935c47d13a0c96..c1bfec059d91ba6e4b2ee61eb364dd285a4fc651 100644 (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))