]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/link/internal: remove trampoline for plt on loong64
authorlimeidan <limeidan@loongson.cn>
Wed, 5 Mar 2025 09:47:41 +0000 (17:47 +0800)
committerabner chenc <chenguoqi@loongson.cn>
Thu, 6 Mar 2025 08:18:36 +0000 (00:18 -0800)
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>
src/cmd/link/internal/loong64/asm.go

index 2e69594f92f4263886ee47dc7078663fccf93c0c..8a6cce177e7190220e859e3075ddb82706dd7982 100644 (file)
@@ -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