diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-16 19:27:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-16 19:27:10 +0000 |
commit | 32c8b04ddb6829a3f5f7267a666b4caa3cf38a1f (patch) | |
tree | 6e5b1b98afaeadd19ba7fd4b710f71cbf187942e /src/cmd/link | |
parent | Adding upstream version 1.22.1. (diff) | |
download | golang-1.22-32c8b04ddb6829a3f5f7267a666b4caa3cf38a1f.tar.xz golang-1.22-32c8b04ddb6829a3f5f7267a666b4caa3cf38a1f.zip |
Adding upstream version 1.22.2.upstream/1.22.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/cmd/link')
-rw-r--r-- | src/cmd/link/internal/ppc64/asm.go | 17 | ||||
-rw-r--r-- | src/cmd/link/internal/riscv64/asm.go | 4 |
2 files changed, 3 insertions, 18 deletions
diff --git a/src/cmd/link/internal/ppc64/asm.go b/src/cmd/link/internal/ppc64/asm.go index 09647d8..de5614e 100644 --- a/src/cmd/link/internal/ppc64/asm.go +++ b/src/cmd/link/internal/ppc64/asm.go @@ -474,24 +474,9 @@ func rewriteABIFuncReloc(ctxt *ld.Link, ldr *loader.Loader, tname string, r load r.SetAdd(int64((n - minReg) * offMul)) firstUse = !ldr.AttrReachable(ts) if firstUse { - ldr.SetAttrReachable(ts, true) // This function only becomes reachable now. It has been dropped from // the text section (it was unreachable until now), it needs included. - // - // Similarly, TOC regeneration should not happen for these functions, - // remove it from this save/restore function. - if ldr.AttrShared(ts) { - sb := ldr.MakeSymbolUpdater(ts) - sb.SetData(sb.Data()[8:]) - sb.SetSize(sb.Size() - 8) - relocs := sb.Relocs() - // Only one PCREL reloc to .TOC. should be present. - if relocs.Count() != 1 { - log.Fatalf("Unexpected number of relocs in %s\n", ldr.SymName(ts)) - } - sb.ResetRelocs() - - } + ldr.SetAttrReachable(ts, true) } return ts, firstUse } diff --git a/src/cmd/link/internal/riscv64/asm.go b/src/cmd/link/internal/riscv64/asm.go index d95de6c..6a4dd01 100644 --- a/src/cmd/link/internal/riscv64/asm.go +++ b/src/cmd/link/internal/riscv64/asm.go @@ -170,8 +170,8 @@ func genSymsLate(ctxt *ld.Link, ldr *loader.Loader) { relocs := ldr.Relocs(s) for ri := 0; ri < relocs.Count(); ri++ { r := relocs.At(ri) - if r.Type() != objabi.R_RISCV_PCREL_ITYPE && r.Type() != objabi.R_RISCV_PCREL_STYPE && - r.Type() != objabi.R_RISCV_TLS_IE { + if r.Type() != objabi.R_RISCV_CALL && r.Type() != objabi.R_RISCV_PCREL_ITYPE && + r.Type() != objabi.R_RISCV_PCREL_STYPE && r.Type() != objabi.R_RISCV_TLS_IE { continue } if r.Off() == 0 && ldr.SymType(s) == sym.STEXT { |