Preserve program header flags when passing them through loadelf.Load.
They shouldn't be coerced to 0 on non-ARM platforms which set them
such as ppc64le.
Change-Id: I022613356f910d812de2fc22eac949960eeb53b3
Reviewed-on: https://go-review.googlesource.com/c/go/+/300950
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Emmanuel Odeke <emmanuel@orijtech.com>
return nil, 0, fmt.Errorf("loadelf: %s: %v", pn, fmt.Sprintf(str, args...))
}
+ ehdrFlags = initEhdrFlags
+
base := f.Offset()
var hdrbuf [64]byte