]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.13] runtime: fix textOff for multiple text sections
authorLynn Boger <laboger@linux.vnet.ibm.com>
Mon, 28 Oct 2019 13:29:40 +0000 (09:29 -0400)
committerCarlos Amedee <carlos@golang.org>
Wed, 4 Dec 2019 17:11:27 +0000 (17:11 +0000)
commit6eee9903c7f970defbc0c9770397790b2bed5709
treefc45378028bb4c5126a926d01d0c5aebfcad7421
parent4f81a326d0c1e27d36254c664a349e75e638ae00
[release-branch.go1.13] runtime: fix textOff for multiple text sections

If a compilation has multiple text sections, code in
textOff must compare the offset argument against the range
for each text section to determine which one it is in.
The comparison looks like this:

if uintptr(off) >= sectaddr && uintptr(off) <= sectaddr+sectlen

If the off value being compared is equal to sectaddr+sectlen then it
is not within the range of the text section but after it. The
comparison should be just '<'.

Fixes #35211

Change-Id: I114633fd734563d38f4e842dd884c6c239f73c95
Reviewed-on: https://go-review.googlesource.com/c/go/+/203817
Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
(cherry picked from commit 0ae9389609f23dc905c58fc2ad7bcc16b770f337)
Reviewed-on: https://go-review.googlesource.com/c/go/+/203819
Run-TryBot: Carlos Amedee <carlos@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
src/runtime/type.go