From 6cb8c839f931540c9e5451a9514c728025c0aaaf Mon Sep 17 00:00:00 2001 From: limeidan Date: Wed, 5 Mar 2025 17:47:41 +0800 Subject: [PATCH] cmd/link/internal: remove trampoline for plt on loong64 When trampoline is called, the plt symbol has not been added. If we add tramp here, plt will not work. Change-Id: I64e5d2be9e08f78ca5e8a9dcb267620a481d4416 Reviewed-on: https://go-review.googlesource.com/c/go/+/654918 Reviewed-by: Cherry Mui LUCI-TryBot-Result: Go LUCI Reviewed-by: Junyang Shao Reviewed-by: Michael Pratt Reviewed-by: abner chenc --- src/cmd/link/internal/loong64/asm.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cmd/link/internal/loong64/asm.go b/src/cmd/link/internal/loong64/asm.go index 2e69594f92..8a6cce177e 100644 --- a/src/cmd/link/internal/loong64/asm.go +++ b/src/cmd/link/internal/loong64/asm.go @@ -263,9 +263,9 @@ func trampoline(ctxt *ld.Link, ldr *loader.Loader, ri int, rs, s loader.Sym) { r := relocs.At(ri) switch r.Type() { case objabi.ElfRelocOffset + objabi.RelocType(elf.R_LARCH_B26): - // Host object relocations that will be turned into a PLT call. - // The PLT may be too far. Insert a trampoline for them. - fallthrough + // Nothing to do. + // The plt symbol has not been added. If we add tramp + // here, plt will not work. case objabi.R_CALLLOONG64: var t int64 // ldr.SymValue(rs) == 0 indicates a cross-package jump to a function that is not yet -- 2.51.0