Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(debuginfo): Improve .o handling on MachO (#173) #173

Merged
merged 2 commits into from
Mar 17, 2020

Commits on Dec 5, 2019

  1. 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.
    nnethercote committed Dec 5, 2019
    Configuration menu
    Copy the full SHA
    9e6c5c6 View commit details
    Browse the repository at this point in the history
  2. 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.
    nnethercote committed Dec 5, 2019
    Configuration menu
    Copy the full SHA
    7d4ca78 View commit details
    Browse the repository at this point in the history