-
-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(debuginfo): Improve
.o
handling on MachO (#173)
* Change how `MachObject::raw_section` finds segments. Currently `raw_section` finds the given section by assuming that it's within a segment named `__TEXT` or `__DWARF`, finding such a segment, and then searching within that segment. However, this fails for `.o` files, because they have a single nameless segment. As https://github.com/aidansteele/osx-abi-macho-file-format-reference says: > For compactness, an intermediate object file contains only one > segment. This segment has no name; it contains all the sections > destined ultimately for different segments in the final object file. This commit changes `raw_section` so it ignores segment names, and simply searches through all segments. As well as working with `.o` files, the resulting code is a little shorter and simpler. * Allow zero addresses in DWARF units. Because they occur in `.o` files. Without the first change in this commit, debuginfo for entire `.o` files can be missed. Without the second change, debuginfo for the first function (which can start at 0x0) can be missed.
- Loading branch information
1 parent
0f31615
commit e4b3939
Showing
2 changed files
with
20 additions
and
46 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