mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/link: preserve elf phdr flags when loading external objects
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>
This commit is contained in:
parent
860704317e
commit
bd0fc0b9c3
1 changed files with 2 additions and 0 deletions
|
|
@ -252,6 +252,8 @@ func Load(l *loader.Loader, arch *sys.Arch, localSymVersion int, f *bio.Reader,
|
||||||
return nil, 0, fmt.Errorf("loadelf: %s: %v", pn, fmt.Sprintf(str, args...))
|
return nil, 0, fmt.Errorf("loadelf: %s: %v", pn, fmt.Sprintf(str, args...))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ehdrFlags = initEhdrFlags
|
||||||
|
|
||||||
base := f.Offset()
|
base := f.Offset()
|
||||||
|
|
||||||
var hdrbuf [64]byte
|
var hdrbuf [64]byte
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue