]> Cypherpunks repositories - gostls13.git/commitdiff
debug/elf,cmd/link: add additional MIPS64 relocation type
authorJoel Sing <joel@sing.id.au>
Sat, 18 Feb 2023 05:41:25 +0000 (16:41 +1100)
committerJoel Sing <joel@sing.id.au>
Fri, 8 Sep 2023 04:32:10 +0000 (04:32 +0000)
Add R_MIPS_PC32 which is a 32 bit PC relative relocation.

These are produced by LLVM on mips64.

Fixes #61974

Change-Id: I7b6c6848e40249e6d5ea474ea53c9d7e3ab23f88
Reviewed-on: https://go-review.googlesource.com/c/go/+/469395
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Joel Sing <joel@sing.id.au>
Reviewed-by: Junxian Zhu <zhujunxian@oss.cipunited.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

api/next/61974.txt [new file with mode: 0644]
src/cmd/link/internal/loadelf/ldelf.go
src/debug/elf/elf.go

diff --git a/api/next/61974.txt b/api/next/61974.txt
new file mode 100644 (file)
index 0000000..d231a62
--- /dev/null
@@ -0,0 +1,2 @@
+pkg debug/elf, const R_MIPS_PC32 = 248 #61974
+pkg debug/elf, const R_MIPS_PC32 R_MIPS #61974
index dfa0ad78043932d5a1a921433faf951348eabe44..72c2093d4e11158a278935d2849284938e8f0dc1 100644 (file)
@@ -1018,7 +1018,8 @@ func relSize(arch *sys.Arch, pn string, elftype uint32) (uint8, uint8, error) {
                MIPS64 | uint32(elf.R_MIPS_CALL16)<<16,
                MIPS64 | uint32(elf.R_MIPS_GPREL32)<<16,
                MIPS64 | uint32(elf.R_MIPS_64)<<16,
-               MIPS64 | uint32(elf.R_MIPS_GOT_DISP)<<16:
+               MIPS64 | uint32(elf.R_MIPS_GOT_DISP)<<16,
+               MIPS64 | uint32(elf.R_MIPS_PC32)<<16:
                return 4, 4, nil
 
        case LOONG64 | uint32(elf.R_LARCH_SOP_PUSH_PCREL)<<16,
index c982c684ba7b91d167a2d2bb4c13c9c8c2130700..35b0e3bc83806d6104d3a47d27001ad08224b7db 100644 (file)
@@ -2216,6 +2216,8 @@ const (
        R_MIPS_TLS_TPREL64     R_MIPS = 48 /* TP-relative offset, 64 bit */
        R_MIPS_TLS_TPREL_HI16  R_MIPS = 49 /* TP-relative offset, high 16 bits */
        R_MIPS_TLS_TPREL_LO16  R_MIPS = 50 /* TP-relative offset, low 16 bits */
+
+       R_MIPS_PC32 R_MIPS = 248 /* 32 bit PC relative reference */
 )
 
 var rmipsStrings = []intName{
@@ -2267,6 +2269,7 @@ var rmipsStrings = []intName{
        {48, "R_MIPS_TLS_TPREL64"},
        {49, "R_MIPS_TLS_TPREL_HI16"},
        {50, "R_MIPS_TLS_TPREL_LO16"},
+       {248, "R_MIPS_PC32"},
 }
 
 func (i R_MIPS) String() string   { return stringName(uint32(i), rmipsStrings, false) }