mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/6l, cmd/internal/ld: handle R_PCREL to function in other shared library
An ELF linker handles a PC-relative reference to an STT_FUNC defined in a shared library by building a PLT entry and referring to that, so do the same in 6l. Fixes #10690 Change-Id: I061a96fd4400d957e301d0ac86760ce256910e1d Reviewed-on: https://go-review.googlesource.com/9711 Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
c661cb01f7
commit
9f5d0bff41
4 changed files with 31 additions and 21 deletions
|
|
@ -1197,6 +1197,7 @@ func ldshlibsyms(shlib string) {
|
|||
s.Name, shlib, lsym.File)
|
||||
}
|
||||
lsym.Type = obj.SDYNIMPORT
|
||||
lsym.ElfType = elf.ST_TYPE(s.Info)
|
||||
lsym.File = libpath
|
||||
if strings.HasPrefix(lsym.Name, "type.") {
|
||||
data := make([]byte, s.Size)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue