go/src/debug
Victor Michel e01a226fad debug/elf: support relocations relative to sections with non-zero addresses
commit 72ec930fa7 added basic support for
relocations, but assumed that the symbol value would be 0, likely because
.debug_info always has address == 0 in the ELF section headers.

CL 195679 added further support for relocations, but explicitly encoded
the original assumption that section addresses would be 0.

This change removes that assumption: all relocations will now be
properly computed based on the target symbol value even when that symbol
is a section with a non-zero address.

Typically, sections that are part of a LOAD program segment have
non-zero addresses. For example, .debug_ranges relocations could be
relative to .text, which usually has an address > 0.

Fixes #40879

Change-Id: Ib0a616bb8b05d6c96d179b03ca33a10946fc5d59
GitHub-Last-Rev: 4200de7326
GitHub-Pull-Request: golang/go#41038
Reviewed-on: https://go-review.googlesource.com/c/go/+/250559
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2020-08-31 18:42:38 +00:00
..
dwarf debug/dwarf: call strings.EqualFold instead of calling Lower twice 2019-10-26 02:36:26 +00:00
elf debug/elf: support relocations relative to sections with non-zero addresses 2020-08-31 18:42:38 +00:00
gosym [dev.link] create runtime.funcnametab 2020-07-31 13:55:07 +00:00
macho all: base64-encode binaries that will cause Apple notarization to fail 2019-11-21 14:55:12 +00:00
pe debug/pe: improve testpoint error message 2020-04-19 21:15:08 +00:00
plan9obj