]> Cypherpunks repositories - gostls13.git/commit
debug/elf: regularize DWARF section loading
authorAustin Clements <austin@google.com>
Wed, 4 Mar 2015 15:58:21 +0000 (10:58 -0500)
committerAustin Clements <austin@google.com>
Tue, 10 Mar 2015 02:32:19 +0000 (02:32 +0000)
commit4ee347b0ad1e0aa7c917138dd623cffa9b68ebbf
tree6297256965850af0c45980f7c7f85f40b2f24e13
parentcc009687bc30793097166b4aaf21ed34d7192809
debug/elf: regularize DWARF section loading

Previously, different DWARF sections had relocations applied in very
different ways.  .debug_info was relocated, but only on x86-64 and 386
and using hard-coded relocation section names instead of relocation
links.  .debug_abbrev and .debug_str were never relocated (which is
excusable because they shouldn't need it).  .debug_types sections were
relocated on all architectures and found their relocation section
using a relocation link because section names could be ambiguous.

Simplify all of this so that every DWARF section that has a linked
relocation section gets those relocations applied.

This prepares this code to load .debug_line sections without the need
for yet more ad hoc relocation logic.

Change-Id: Ia00ac8e656b22f22bb31a5f6ef9b0f23cda64d19
Reviewed-on: https://go-review.googlesource.com/6780
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/debug/elf/file.go