This is a follow-up to CL 536400.
Fixes #64446
Change-Id: I35646732f62cb1937fd448f94ea518544d4295d4
GitHub-Last-Rev:
55db18a909fd44e6b2f2b98fd1a44ad01bb37932
GitHub-Pull-Request: golang/go#64448
Reviewed-on: https://go-review.googlesource.com/c/go/+/545835
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Run-TryBot: Jes Cok <xigua67damn@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
return nil, err
}
+ dynSize := 8
+ if f.Class == ELFCLASS64 {
+ dynSize = 16
+ }
+ if len(d)%dynSize != 0 {
+ return nil, errors.New("length of dynamic section is not a multiple of dynamic entry size")
+ }
+
// Parse the .dynamic section as a string of bytes.
var vals []uint64
for len(d) > 0 {