1
0
mirror of https://github.com/golang/go synced 2024-11-06 13:26:11 -07:00
go/src/debug
Victor Michel 8a5a6f46dc debug/elf: don't apply DWARF relocations for ET_EXEC binaries
Some ET_EXEC binaries might have relocations for non-loadable sections
like .debug_info. These relocations must not be applied, because:
* They may be incorrect
* The correct relocations were already applied at link time

Binaries in Linux Kernel debug packages like Fedora/Centos kernel-debuginfo
are such examples. Relocations for .debug_* sections are included in the
final binaries because they are compiled with --emit-relocs, but the resulting
relocations are incorrect and shouldn't be used when reading DWARF sections.

Fixes #46673

Change-Id: I2b4214f1584bfc243446d0eaee41512657325b95
GitHub-Last-Rev: 8350fad059
GitHub-Pull-Request: golang/go#46698
Reviewed-on: https://go-review.googlesource.com/c/go/+/327009
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2021-06-14 22:13:47 +00:00
..
dwarf debug/dwarf: delay array type fixup to handle type cycles 2021-05-13 12:32:21 +00:00
elf debug/elf: don't apply DWARF relocations for ET_EXEC binaries 2021-06-14 22:13:47 +00:00
gosym all: update to use os.ReadFile, os.WriteFile, os.CreateTemp, os.MkdirTemp 2020-12-09 19:12:23 +00:00
macho debug/macho: fix a typo in macho.go 2021-05-14 00:56:52 +00:00
pe all: do not test internal linking on windows/arm64 2021-04-23 21:48:37 +00:00
plan9obj