1
0
mirror of https://github.com/golang/go synced 2024-11-08 15:16:25 -07:00
go/src/cmd/internal/goobj
Cherry Zhang 7bd0b61000 cmd/internal/goobj: accept int64 in readInt
The counter part, writeInt in cmd/internal/obj, writes int64s.
So the reader side should also read int64s. This may cause a
larger range of values being accepted, some of which should
not be that large. This is probably ok: for example, for
size/index/length, the very large value (due to corruption)
may be well past the end and causes other errors. And we did
not do much bound check anyway.

One exmaple where this matters is ARM32's object file. For one
type of relocation it encodes the instruction into Reloc.Add
field (which itself may be problematic and worth fix) and the
instruction encoding overflows int32, causing ARM32 object
file being rejected by goobj (and so objdump and nm) before.

Unskip ARM32 object file tests in goobj, nm, and objdump.

Updates #19811.

Change-Id: Ia46c2b68df5f1c5204d6509ceab6416ad6372315
Reviewed-on: https://go-review.googlesource.com/69010
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2017-11-01 18:23:58 +00:00
..
testdata cmd/internal/goobj: parse native objects in the archive 2017-09-10 12:46:44 +00:00
goobj_test.go cmd/internal/goobj: accept int64 in readInt 2017-11-01 18:23:58 +00:00
read.go cmd/internal/goobj: accept int64 in readInt 2017-11-01 18:23:58 +00:00