aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2016-11-10 12:49:06 -0800
committerIan Lance Taylor <iant@golang.org>2016-11-10 22:58:49 +0000
commitc9ed065fbb7514a5da52b92575576cf359aead73 (patch)
treef17b60fce0064a14650b5cb85e3e1da33c946eef
parent63224cab54055eaf1b3af62f3acaf64ff304316c (diff)
downloadgo-c9ed065fbb7514a5da52b92575576cf359aead73.tar.gz
go-c9ed065fbb7514a5da52b92575576cf359aead73.zip
debug/elf: SPARC64 relocation type is only 8 bits
https://docs.oracle.com/cd/E53394_01/html/E54813/chapter6-54839.html#OSLLGchapter6-24: "For 64–bit SPARC Elf64_Rela structures, the r_info field is further broken down into an 8–bit type identifier and a 24–bit type dependent data field. For the existing relocation types, the data field is zero. New relocation types, however, might make use of the data bits. #define ELF64_R_TYPE_ID(info) (((Elf64_Xword)(info)<<56)>>56) " No test for this because the only test would be an invalid object file. Change-Id: I5052ca3bfaf0759e920f9a24a16fd97543b24486 Reviewed-on: https://go-review.googlesource.com/33091 Reviewed-by: Michael Hudson-Doyle <michael.hudson@canonical.com>
-rw-r--r--src/debug/elf/file.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/debug/elf/file.go b/src/debug/elf/file.go
index 0c547669a9..8eeab65df8 100644
--- a/src/debug/elf/file.go
+++ b/src/debug/elf/file.go
@@ -1021,7 +1021,7 @@ func (f *File) applyRelocationsSPARC64(dst []byte, rels []byte) error {
for b.Len() > 0 {
binary.Read(b, f.ByteOrder, &rela)
symNo := rela.Info >> 32
- t := R_SPARC(rela.Info & 0xffff)
+ t := R_SPARC(rela.Info & 0xff)
if symNo == 0 || symNo > uint64(len(symbols)) {
continue