<feed xmlns='http://www.w3.org/2005/Atom'>
<title>go/src/debug/elf/testdata/multiple-code-sections.c, branch main</title>
<subtitle>Fork of Go programming language with my patches.</subtitle>
<id>http://git.kilabit.info/go/atom?h=main</id>
<link rel='self' href='http://git.kilabit.info/go/atom?h=main'/>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/'/>
<updated>2020-08-31T18:42:38Z</updated>
<entry>
<title>debug/elf: support relocations relative to sections with non-zero addresses</title>
<updated>2020-08-31T18:42:38Z</updated>
<author>
<name>Victor Michel</name>
<email>victor@optimyze.cloud</email>
</author>
<published>2020-08-30T20:43:39Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=e01a226fadcac721e26c12921ca54388c7244d03'/>
<id>urn:sha1:e01a226fadcac721e26c12921ca54388c7244d03</id>
<content type='text'>
commit 72ec930fa70c20ce69b21bf32a7916c04c2e9c2f 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 &gt; 0.

Fixes #40879

Change-Id: Ib0a616bb8b05d6c96d179b03ca33a10946fc5d59
GitHub-Last-Rev: 4200de732641995f3a4958a13a5c78f65b7eae50
GitHub-Pull-Request: golang/go#41038
Reviewed-on: https://go-review.googlesource.com/c/go/+/250559
Run-TryBot: Ian Lance Taylor &lt;iant@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
</content>
</entry>
</feed>
