]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/link/internal/loadelf: correct the relocation size of R_LARCH_64
authorlimeidan <limeidan@loongson.cn>
Thu, 14 Sep 2023 12:11:07 +0000 (20:11 +0800)
committerThan McIntosh <thanm@google.com>
Thu, 14 Sep 2023 17:34:12 +0000 (17:34 +0000)
Change-Id: If3eaca8b92e8f5265c7763d13021a6353b9df9b6
Reviewed-on: https://go-review.googlesource.com/c/go/+/528455
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: abner chenc <chenguoqi@loongson.cn>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

src/cmd/link/internal/loadelf/ldelf.go

index 72c2093d4e11158a278935d2849284938e8f0dc1..5f802f5547005b21e87d0e99485288663908f9c4 100644 (file)
@@ -1027,11 +1027,13 @@ func relSize(arch *sys.Arch, pn string, elftype uint32) (uint8, uint8, error) {
                LOONG64 | uint32(elf.R_LARCH_SOP_PUSH_ABSOLUTE)<<16,
                LOONG64 | uint32(elf.R_LARCH_MARK_LA)<<16,
                LOONG64 | uint32(elf.R_LARCH_SOP_POP_32_S_0_10_10_16_S2)<<16,
-               LOONG64 | uint32(elf.R_LARCH_64)<<16,
                LOONG64 | uint32(elf.R_LARCH_MARK_PCREL)<<16,
                LOONG64 | uint32(elf.R_LARCH_32_PCREL)<<16:
                return 4, 4, nil
 
+       case LOONG64 | uint32(elf.R_LARCH_64)<<16:
+               return 8, 8, nil
+
        case S390X | uint32(elf.R_390_8)<<16:
                return 1, 1, nil