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 <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: abner chenc <chenguoqi@loongson.cn>
This commit is contained in:
limeidan 2025-03-05 17:47:41 +08:00 committed by abner chenc
parent 6ba91df153
commit 6cb8c839f9
1 changed files with 3 additions and 3 deletions

View File

@ -263,9 +263,9 @@ func trampoline(ctxt *ld.Link, ldr *loader.Loader, ri int, rs, s loader.Sym) {
r := relocs.At(ri) r := relocs.At(ri)
switch r.Type() { switch r.Type() {
case objabi.ElfRelocOffset + objabi.RelocType(elf.R_LARCH_B26): case objabi.ElfRelocOffset + objabi.RelocType(elf.R_LARCH_B26):
// Host object relocations that will be turned into a PLT call. // Nothing to do.
// The PLT may be too far. Insert a trampoline for them. // The plt symbol has not been added. If we add tramp
fallthrough // here, plt will not work.
case objabi.R_CALLLOONG64: case objabi.R_CALLLOONG64:
var t int64 var t int64
// ldr.SymValue(rs) == 0 indicates a cross-package jump to a function that is not yet // ldr.SymValue(rs) == 0 indicates a cross-package jump to a function that is not yet