cmd/internal/objfile: only consider executable segments for load address
authorIan Lance Taylor <iant@golang.org>
Fri, 3 Aug 2018 21:52:54 +0000 (14:52 -0700)
committerDr. Tobias Quathamer <toddy@debian.org>
Mon, 26 Nov 2018 21:50:39 +0000 (21:50 +0000)
commit9728dbd38d87f814649c8ddc627fd5bab4aead00
tree6cb95d17bc13510968b23db02b62b8fc6036f903
parent8d5b3631e31a4cff3cfd62ee212c469a6b0b553a
cmd/internal/objfile: only consider executable segments for load address

Reportedly on some new Fedora systems the linker is producing extra
load segments, basically making the dynamic section non-executable.
We were assuming that the first load segment could be used to
determine the program's load offset, but that is no longer true.
Use the first executable load segment instead.

Fixes #26369

Change-Id: I5ee31ddeef2e8caeed3112edc5149065a6448456
Reviewed-on: https://go-review.googlesource.com/127895
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Gbp-Pq: Name only-consider-executable-segments.patch
src/cmd/internal/objfile/elf.go