Skip to content

Commit e508c1c

Browse files
committed
cmd/link/internal/loadelf: support additional ELF relocations on mips64
LLVM on openbsd/mips64 generates R_MIPS_GOT_HI16 and R_MIPS_GOT_LO16 relocations, so teach cmd/link/internal/loadelf about both of these. Updates #43005 Change-Id: Ic45ea8b901d44dcbdbf355411ee434dcd7670a92 Reviewed-on: https://go-review.googlesource.com/c/go/+/275894 Trust: Joel Sing <[email protected]> Reviewed-by: Cherry Zhang <[email protected]>
1 parent 58e381b commit e508c1c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

+4
Original file line numberDiff line numberDiff line change
@@ -969,13 +969,17 @@ func relSize(arch *sys.Arch, pn string, elftype uint32) (uint8, error) {
969969
case MIPS | uint32(elf.R_MIPS_HI16)<<16,
970970
MIPS | uint32(elf.R_MIPS_LO16)<<16,
971971
MIPS | uint32(elf.R_MIPS_GOT16)<<16,
972+
MIPS | uint32(elf.R_MIPS_GOT_HI16)<<16,
973+
MIPS | uint32(elf.R_MIPS_GOT_LO16)<<16,
972974
MIPS | uint32(elf.R_MIPS_GPREL16)<<16,
973975
MIPS | uint32(elf.R_MIPS_GOT_PAGE)<<16,
974976
MIPS | uint32(elf.R_MIPS_JALR)<<16,
975977
MIPS | uint32(elf.R_MIPS_GOT_OFST)<<16,
976978
MIPS64 | uint32(elf.R_MIPS_HI16)<<16,
977979
MIPS64 | uint32(elf.R_MIPS_LO16)<<16,
978980
MIPS64 | uint32(elf.R_MIPS_GOT16)<<16,
981+
MIPS64 | uint32(elf.R_MIPS_GOT_HI16)<<16,
982+
MIPS64 | uint32(elf.R_MIPS_GOT_LO16)<<16,
979983
MIPS64 | uint32(elf.R_MIPS_GPREL16)<<16,
980984
MIPS64 | uint32(elf.R_MIPS_GOT_PAGE)<<16,
981985
MIPS64 | uint32(elf.R_MIPS_JALR)<<16,

0 commit comments

Comments
 (0)