]> Cypherpunks repositories - gostls13.git/commit
cmd/link: fix loadelf failed on MIPS family
authorMeng Zhuo <mengzhuo1203@gmail.com>
Fri, 6 Dec 2019 08:13:44 +0000 (16:13 +0800)
committerCherry Zhang <cherryyz@google.com>
Mon, 9 Dec 2019 18:22:59 +0000 (18:22 +0000)
commitffa5c85c9227a212fe1a91a6d54da56a9e754f1f
treeed4a0e3b03f8e5cc749c324ef50f7c7cdda24513
parenta3a630b0d2829ab74ac623fc2ae92864bd61d391
cmd/link: fix loadelf failed on MIPS family

The relocation of MIPS64 family ELF is different with other architecure according
to the document from Linux-MIPS

https://www.linux-mips.org/pub/linux/mips/doc/ABI/elf64-2.4.pdf

In "2.9 Relocation" it shows relocation section contains five parts:

1. r_sym Elf64_Word Symbol index
2. r_ssym Elf64_Byte Special symbol
3. r_type3 Elf64_Byte Relocation type
4. r_type2 Elf64_Byte Relocation type
5. r_type Elf64_Byte Relocation type

This CL makes loadelf aware the difference.

Update #35779

Change-Id: Ib221665641972b1c2bfea5a496e3118e5dc0bc45
Reviewed-on: https://go-review.googlesource.com/c/go/+/209317
Run-TryBot: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/cmd/link/elf_test.go
src/cmd/link/internal/loadelf/ldelf.go