debug/elf: apply more relocations when reading DWARF data sections
The elf reader's method for reading in DWARF section data has support
for applying selected relocations when the debug/dwarf readers are
being used on relocatable objects. This patch extends the set of
relocations applied slightly. In particlar, prior to this for some
architectures we were only applying relocations whose target symbol
was a section symbol; now we also include some relocations that target
other symbols. This is needed to get meaningful values for compilation
unit DIE low_pc attributes, which typically target a specific function
symbol in text.
Fixes #31363.
Change-Id: I34b02e7904cd7f2dea74197f73fa648141d15212
Reviewed-on: https://go-review.googlesource.com/c/go/+/195679
Reviewed-by: Ian Lance Taylor <iant@golang.org>
diff --git a/src/cmd/link/dwarf_test.go b/src/cmd/link/dwarf_test.go
index 897b2fc..f33082e 100644
--- a/src/cmd/link/dwarf_test.go
+++ b/src/cmd/link/dwarf_test.go
@@ -167,7 +167,7 @@
func TestDWARF(t *testing.T) {
testDWARF(t, "", true)
- if runtime.GOOS == "darwin" && !testing.Short() {
+ if !testing.Short() {
t.Run("c-archive", func(t *testing.T) {
testDWARF(t, "c-archive", true)
})