-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
debug/dwarf: don't try to parse addr/rnglists header
In an executable, the debug_addr and debug_rnglists sections are assembled by concatenating the input sections, and each input section has a header, and each header may have different attributes. So just parsing the single header isn't right. Parsing the header is not necessary to handle offsets into these sections which is all we do. Looking at the header is also problematic because GCC with -gsplit-dwarf when using DWARF versions 2 through 4 emits a .debug_addr section, but it has no header. The header was only added for DWARF 5. So we can't parse the header at all for that case, and we can't even detect that case in general. This CL also fixes SeekPC with addrx and strx formats, by not using the wrong compilation unit to find the address or string base. To make that work when parsing the compilation unit itself, we add support for delay the resolution of those values until we know the base. New test binaries built with gcc -gdwarf-5 -no-pie debug/dwarf/testdata/line[12].c (gcc (Debian 10.2.0-15) 10.2.0) clang -gdwarf-5 -no-pie debug/dwarf/testdata/line[12].c (clang version 9.0.1-14) Change-Id: I66783e0eded629bf80c467767f781164d344a54d Reviewed-on: https://go-review.googlesource.com/c/go/+/277233 Trust: Ian Lance Taylor <[email protected]> Reviewed-by: Than McIntosh <[email protected]>
- Loading branch information
1 parent
be10af7
commit 828746e
Showing
6 changed files
with
164 additions
and
151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.